I am having some trouble using Triacs in order to dim a light bulb operating at 220V AC, I am a student at school and I don't have any background about using Triacs or Diacs or so, so I seeked the internet for circuits which uses a microcontroller in order to control the Triac to control the speed of an AC fan or brightness of a light bulb. enter image description here So I got this circuit which I understand it all except there is a part I didn't understand in the circuit so that's why I am asking here for help. enter image description here So my question is concerned about this IC the MCT2e which I think is an optocoupler, how can this IC detect the zero crossing in the AC wave ? Although the input in this IC is rectified using a bridge rectifier ? And also what is this IC properties ? Can any general purpose optocoupler be used or there is special specs. For it ? in short I want to know the principle of how this part of the circuit works in order to detect the zero crossing point in the AC wave.

Thanks in advance.

  • 3
    \$\begingroup\$ Playing around with this circuit could kill you if you don't understand the dangers. Since you "don't have any background" I am not inclined to nudge you along that path. Take the time to learn the fundamentals before trying something like this; your great-grandchildren will thank you. \$\endgroup\$ Commented Dec 9, 2019 at 13:48
  • \$\begingroup\$ @ElliotAlderson I appreciate you but I meant I don't have backgrounds in using Triac but I made a lot of digital AC switching using relays and I know the dangers I face quite well specially because my country uses 220V. \$\endgroup\$ Commented Dec 9, 2019 at 14:09
  • \$\begingroup\$ OK, what does it mean to you when you say that the input to the optocoupler is rectified? What does that signal look like? You ask about the "properties" of the optocoupler but have you tried to search for the datasheet of an MCT2E? \$\endgroup\$ Commented Dec 9, 2019 at 14:14
  • 2
    \$\begingroup\$ No, the rectifier does not produce a dc voltage. If you don't know what the output of the rectifier will look like then you really have no business working with these lethal voltages. \$\endgroup\$ Commented Dec 9, 2019 at 19:24
  • 2
    \$\begingroup\$ It doesn't detect the zero cross so much as it just detects when there is enough voltage to light the LED in the optocoupler. Try not to use DC to when referring to unipolar voltages or currents. There is an old guy at work here who does that and its infuriating because you never know if he is referring to the unipolar signal itself, or the constant DC component of the unipolar signal. \$\endgroup\$
    – DKNguyen
    Commented Dec 9, 2019 at 21:46

1 Answer 1


The rectifier 'rectifies' ('puts right' or 'corrects') the negative halves of the AC cycle to make the voltage always positive, but doesn't make it smooth. It still goes down to zero at the end of each half cycle.

Here's the result of an LTspice simulation of your circuit:-

enter image description here

The blue trace is the 220V AC mains (divided by 20 to make the other traces more visible). Green is the rectifier output voltage, and red is the outocoupler output (ZVC).

The LED in the optocoupler shines light on the phototransistor, which then draws current proportional to the LED current. As the rectified voltage drops close to zero the LED gets less current, so the transistor draws less current and the voltage at pin 2 (ZVC) rises. This tells the Arduino that the mains cycle is close to the zero crossing point.

Optocouplers are used to safely send signals between circuits which operate on different voltages. This is called galvanic isolation because there is no direct electrical connection between the input and output. In this circuit the rectified voltage is still at mains potential so optocouplers are required to isolate the mains from the Arduino, allowing it to be connected to other equipment and handled without getting an electric shock.

The MCT2e is a standard optocoupler (similar to 4N25 etc.) with a minimum current transfer ratio (CTR) of 20%. Any optocoupler with similar specs should work fine. If you use an optocoupler with much higher CTR then the zero crossing pulse will be a bit wider due to its greater sensitivity.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.