Hello Geeks,
I was wondering whether i can use pwm channels on N78E059A Nuvoton micro-controller as lamp dimmer. I have actually done a pwm code on ESP8266 WiFi module but the problem is that the lamp flickers a lot, so i was wondering whether pwm channels can help me or not. I think i need fading effect in-order to stop flickering of the lamp ?
The hardware with me is N78E059A (8051 core with pwm channels), MOC3041 opto coupler for triac BT12 and an incandescent lamp.
Any help will be helpful.
Okies after reading your reply and doing some homework over the internet i came to know that to implement dimmer using micro controller i need to implement zero-crossing detection without which dimming is not possible.
Thanks for your valued reply. It helped me a lot.
"without which dimming is not possible"
Dimming is possible without zero-crossing detection. It's just that not in a design with a triac/quadrac, since when you have a component that you can't turn off on request you instead have to control when it is turned on. So the zero-crossing is important to decide the turn-on time.
If using a component that can be turned both on and off on request, it's possible to ignore the mains frequency and instead turn on/off the power at a much higher frequency. Then it's possible to use PWM and ignore the zero-crossing. The disadvantage is that switch transistors have losses when they turn on/off since the switching isn't instant and in the middle of switching they look like resistors with a significant resistance which means in the middle of the switching they behave like heating elements. Old switch transistors were too inefficient and/or expensive which is why the triac solution was common 20-30 years ago.
The advantage with switching at a much higher frequency is that on average it still produces a sinusoidal load with a bit of low-pass filtering. The triac solution creates very ugly distortion of the sinus wave which affects other customers and the grid - the power company doesn't like consumers who only want to consume the tail part of each half-wave while not loading the network on the leading half of the half-waves. That's not a load the generators are designed to support. And such a load produces huge amounts of overtones that will radiate from the cables.
Okay,
I am not that much into the power theory. I am basically a programmer who like to do embedded programming and do some hardware assembly with the help of people like you. After reading your last reply i think i should go with MOC3021 with zero crossing detection for firing the triac. Actually i have one circuit in that i don't see zero crossing circuit. If i have time i will email you the image of that circuit may be you can have a say on how dimming is implemented on it.