Hi every one,
Recently i did the project called ceiling fan control using PIC18F45K50 . When I am trying to control the fan PWM pin coming from the microcontroller getting failed .For fan controlling I am using a NXP application notes(http://cache.freescale.com/files/microcontrollers/doc/app_note/AN3471.pdf). Here i attached my schematic. Is there any mistake in my circuit? Aand i given a isolation MOC3021.

Also what is the output voltage of the MCU?
If it is 3.3 Volts, the led will get to less current.
It is recommended to use a drive current of 15 mA for the led in the MOC.
Also you may try to add a snubber circuit as in the application circuit:

What is "microcontroller PWM"? Is it synchronized with the zero crossings
of the mains per the application note?

While at it, can you expand on wht you mean by "fail"? Do you mean the fan does not even turn on?

Click to expand...

Thank you for u r reply DickCappels .
1) "Microcontroller pwm" is the signal coming from the micro controller to the MOC3021.
2) No iam not using the zero crossing.
3)fan is running with respect to the pwm duty cycle but after some time that particuler pwm pin coming from the microcontroller pin going fail .That pin is not doing any functionality.

Also what is the output voltage of the MCU?
If it is 3.3 Volts, the led will get to less current.
It is recommended to use a drive current of 15 mA for the led in the MOC.
Also you may try to add a snubber circuit as in the application circuit:

In the schematic I posted, the 39 Ohm and 10 nF are for snubbing the triac.
It will reduce the dV/dt.
See the attached application note for more info.

Bertus

Click to expand...

Thank you Bertus.
I will try today and what about the traic .can i use any type traic or is there any particuler traic ?.And what about my schematic ? is there any wrong in that because i did as per NXP AN3471 application note.