# Motor control using MOC3041 optocoupler

Thread Starter

#### flaviodsilva

Joined Apr 30, 2022
5
I'm currently doing my master thesis, and I'm now at a point where I have to control a few AC motors with a microcontroller. From my previous study about the subject, and from previous similar thesis, I've noticed a common practice is to use an optocoupler to separate low voltage from high voltage, and a TRIAC to draw current to the motors.
As far as choosing an optocoupler goes, I've decided to go with one that as zero crossing detection (MOC3041), since I don't need phase control and the small delay doesn't affect the desired function. The datasheet of MOC3041 shows a circuit, but I can't quite understand some aspects of it, namely the values of the resistors.

Here's my take on it, I would appreciate if you correct me if something is wrong:
• Rin is used to pull the necessary current for the LED diode of MOC3041, which is max. 15mA (extracted from datasheet). I'm using an ESP32 microcontroller, so the Vcc will be 3.3V, resulting in a value of Rin = 3.3 / 0.015 = 220 (or higher).
• The 360 ohm one should be obtained in order to pull the necessary current for the TRIAC gate to conduct. The peak gate current of the TRIAC I'm using (BT139) is 2A, and the peak current surge current for the MOC diode is 1A, resulting in a resistance higher than 240V/1A > 240 ohm, so I guess 360 should be ok in my circuit.
• I don't quite understand the use of the 330 ohm resistor. I've read some stuff about it, most of the opinions are that it is useful to have it, but not always necessary.
• The RC snubber would be necessary in my case to remove potential electromagnetic noise. The figure says to use 39 ohm, or 360 ohm for highly inductive loads. How do I determine if the motors that I have fit this profile?
• How do you determine the power rating for the resistors? I've read you can use P=fCV^2 to determine it. In my case, P = 50hz * 0.01uF *240^2 = 0.0288, so I would be fine with regular 1/4 W resistor. Although, I've read some people that used those and they would burn, and it only worked with 1 or 2 W resistors.

Thank you in advance, any tips are appreciated!

#### MaxHeadRoom

Joined Jul 18, 2013
27,000
Did you study the data in the Fairchild AN-3006 and AN-3003?

#### Ian0

Joined Aug 7, 2020
7,441
The 330Ω resistor is unnecessary.
The 360Ω is determined by the gate current of the main triac, and the maximum zero-crossing voltage (20V).
I use 100Ω 1W for a 50mA gate triac such as BTA12-600BW, because resistor sizes smaller than 2512 won't withstand 340V.
Current only flows through the 360Ω resistor for the time it takes the triac to trigger (about 1us) so power dissipation is negligible.
Popular values for the snubber are 100Ω/100nF and 47Ω/47nF. The power dissipation of the resistor depends ONLY on the capacitor value. The power dissipation in the resistor is much higher for a random-phase opto-coupler. Use 1W resistors because quarter-watt resistors don't have enough voltage rating.

If you are using an opto-triac, you don't need a sensitive-gate main triac, so don't use one. Use a 50mA gate triac such as BTA12-600B or BTA12-600BW. Mistriggering is much more likely with a sensitive gate triac.
The BW type triac is marketed as "snubberless" because it will withstand a high dV/dt. The opto-triac isn't quite as good with dV/dt so best to keep the snubber, but zero-crossing opto-triacs will generally manage without.

Thread Starter

#### flaviodsilva

Joined Apr 30, 2022
5
Did you study the data in the Fairchild AN-3006 and AN-3003?
Thank you for the answer. I dind't, but I've looked at them now, and it did help clarifying some aspects of my initial doubts

Thread Starter

#### flaviodsilva

Joined Apr 30, 2022
5
The 330Ω resistor is unnecessary.
The 360Ω is determined by the gate current of the main triac, and the maximum zero-crossing voltage (20V).
I use 100Ω 1W for a 50mA gate triac such as BTA12-600BW, because resistor sizes smaller than 2512 won't withstand 340V.
Current only flows through the 360Ω resistor for the time it takes the triac to trigger (about 1us) so power dissipation is negligible.
Popular values for the snubber are 100Ω/100nF and 47Ω/47nF. The power dissipation of the resistor depends ONLY on the capacitor value. The power dissipation in the resistor is much higher for a random-phase opto-coupler. Use 1W resistors because quarter-watt resistors don't have enough voltage rating.

If you are using an opto-triac, you don't need a sensitive-gate main triac, so don't use one. Use a 50mA gate triac such as BTA12-600B or BTA12-600BW. Mistriggering is much more likely with a sensitive gate triac.
The BW type triac is marketed as "snubberless" because it will withstand a high dV/dt. The opto-triac isn't quite as good with dV/dt so best to keep the snubber, but zero-crossing opto-triacs will generally manage without.
How did you come up with the 100Ω value? I can't understand that.
As for the TRIAC that I'm using, I'm a bit limited to the ones that we have at the university, since delivery times tend to be large nowadays.
Thank you for the answer! It was really useful

#### Ian0

Joined Aug 7, 2020
7,441
The opto can't trigger if the voltage is more than 20V, so the highest the gate current could possibly be is 20V/100Ω = 200mA. That's more than enough to trigger a 50mA gate triac. The more the better (until the maximum gate current is exceeded) as it ensures a fast turn-on.
If you've more than one choice of triac, use the one with the highest trigger current - it will be less susceptible to false triggering.
BTA12-600B, BTA12-600BW, BTA16-600B and BTA16-600BW don't seem to be difficult to get. (in stock at Farnell) I have found the opto-triacs rather trickier to find than the triacs.
If you really want to make it reliable, use a pair of thyristors.

Thread Starter

#### flaviodsilva

Joined Apr 30, 2022
5
The opto can't trigger if the voltage is more than 20V, so the highest the gate current could possibly be is 20V/100Ω = 200mA. That's more than enough to trigger a 50mA gate triac. The more the better (until the maximum gate current is exceeded) as it ensures a fast turn-on.
If you've more than one choice of triac, use the one with the highest trigger current - it will be less susceptible to false triggering.
BTA12-600B, BTA12-600BW, BTA16-600B and BTA16-600BW don't seem to be difficult to get. (in stock at Farnell) I have found the opto-triacs rather trickier to find than the triacs.
If you really want to make it reliable, use a pair of thyristors.
Understood. Thanks for the input, really appreciate it.

#### Alec_t

Joined Sep 17, 2013
13,424
Vcc will be 3.3V, resulting in a value of Rin = 3.3 / 0.015 = 220 (or higher).
No. You forgot to factor in the Vfwd of the opto-LED.

Thread Starter

#### flaviodsilva

Joined Apr 30, 2022
5
No. You forgot to factor in the Vfwd of the opto-LED.
Fairchild AN-3006 helped clarify that. Rin should be (Vcc-Vf)/If. I'm just not sure about what value should be used for If

#### Ian0

Joined Aug 7, 2020
7,441
If is 5mA, 10mA or 15mA depending on which device you are using. Vf=1.5V maximum according to the datasheet.