Friday, January 20, 2012

Optically Isolated Zero Crossing Detector

Since I am still waiting for my PCBs to arrive, I decided to take some time to design a proper and accurate zero crossing detector, that can be used to create a microcontroller based dimmer.

Proper zero crossing detection is essential when creating a dimmer with a triac controlled by a microcontroller. The circuits I encountered online either used transformers or were not optically isolated towards the microcontroller (like http://ww1.microchip.com/downloads/en/AppNotes/00521c.pdf).


The "heart" of the circuit are two operational amplifiers (in one package) with an open collector. Transistors C1-C4 and diodes D1-D4 represent the tranformless dual voltage power supply, which powers the operational amplifiers. Resistors R1-R4 provide the reference voltage of about 3V.

When the input voltage (sensed over the R5) exceedes +3V or is lower than -3V the IC1A or IC1B output transistors are connected towards the negative voltage and no current is running through the led in the optocoupler.
When neither of op amps is active (sense voltage is between -3V and +3V) the optocoupler led is active and the optocoupler's output transistor connects the external INT pin to the ground, triggering the interrupt.

The circuit was only tested on a protoboard, so take caution when implementing it in your design.

No comments:

Post a Comment