0

enter image description here

Thanks to the suggestions, I modified my circuit, hopefully making it a bit safer

I'm having trouble choosing R6 though, in the datasheet for the triac (L4004L3), this one datasheet

Igt = 3mA, so if I calculated the resistor value for peak voltage and 30mA current

R = Vpeak/I = 230/30mA = About 8k

But now lets say the triac is triggered when the AC voltage is 10V

I = V/R = 10/8k = 1.25mA

But since Igt is 3mA, the triac wont turn on

If I try choosing higher currents, the resistor power increases

Right now it's sitting at

P = I^2 * R = 0.03^2 * 8k = 7.2W peak power

And also whats the minimum current needed to turn the photocoupler on or activate the other side ?

For R2, I calculated it this way, for a chosen current of 10mA

R2 = Vpeak/I = 230/10mA = 23k

For R5, chosen current 10mA. I think the max the MCU can source is around 20mA

R5 = (V-Vled)/I = (5-1.2)/10mA = 380 ohms

Deadshot
  • 197
  • 5
  • 20
  • Possible duplicate of http://electronics.stackexchange.com/questions/258214/light-dimmer-circuit-need-some-help-with-connections – winny Sep 16 '16 at 20:26

1 Answers1

1

R6 is determined by the maximum current the opto can withstand if turned on at the peak of the cycle. It has little to nothing to do (directly) with the triac gate sensitivity- except that if you make the resistor large and the triac is insensitive it will not be able to turn on 100% and the output waveform will likely be significantly lopsided (DC content). Something like 220 ohms will be fine (but it should ideally be a flameproof type).

The power dissipation will be very low because the triac turns on and shunts the resistor so little current flows through it. 250mW is fine. Unless the triac doesn't turn on (say a bit of solder shorts MT1 and gate) in which case the resistor will likely go up in flames with 200W+ dissipation assuming a low load resistance (refer to the final sentence in the above paragraph).


Now, as far as R5 is concerned, 10mA maximum is fine (the GPIO output will not be 5V with 10mA being drawn, so it won't be quite 10mA) but you should specify the MOC3023 which is guaranteed to turn on with 5mA. If you really want to use a 3021 then you can add a transistor which will more reliably drive the opto.

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
  • Thanks, Also do I need a resistor between the AC supply and bridge rectifier ?, it says the max forward current is 2A, or is the current already determined by R2 – Deadshot Sep 17 '16 at 09:51