0

So basically I want to build a dimmer circuit. If I connect an optocoupler to the PWM pin on the MCU and a triac to the optocoupler with an incandescent bulb and generate a square wave something like this:

enter image description here

In the above example I was using 80% brightness. So basically, the mains frequency is 50Hz and so the generated square wave would be 100Hz with 80% duty cycle. How well would this work ?

Deadshot
  • 197
  • 5
  • 20

2 Answers2

2

so the generated square wave would be 100 Hz with 80% duty cycle.

Yes, you would trigger the triac 100 times per second.

No, you don't need a square wave. You just need a pulse. Once triggered the triac will stay on until the next zero cross.

See

Transistor
  • 168,990
  • 12
  • 186
  • 385
1

You don't want PWM, what you want is to detect the zero crossing (using an isolated circuit, of course) and then delay between almost nothing and almost one half cycle and at the end of that delay you spit out a narrow pulse (something like 100usec) through a (NON-zero crossing type) triac-output optocoupler MOCxxx.

If you are too close to the beginning of the AC cycle the triac/triac opto will not reach holding current and you get no light rather than close to 100% so you could stretch the pulse a bit if it's at the beginning of the cycle.

If your pulse extends just a bit past the next zero crossing then you will get 100% rather than 0%.

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
  • @Deadshot, as said by others, you wouldn't/couldn't produce a PWM waveform but would be using phase control instead. There's plenty on phase control on the Internet that you can read further on. – TonyM Sep 13 '16 at 22:29