Optoisolator concerns - Page 1
Forum section: electronics / beginners

author: wheezardth
author_rank: Newbie
timestamp: November 11, 2012, 05:46:07 pm
content: Hello Folks!I'm trying to make an 230V Mains AC detection module for a circuit I'm building.I'm using this:But instead of the LED, I'm driving an optoisolator.Do you think that thishttp://www.vishay.com/docs/83540/cny64.pdf,the CNY64 from VISHAY, would be fitting?I have not designed for AC yet, so all comments are welcome!

author: SeanB
author_rank: Super Contributor
timestamp: November 11, 2012, 06:14:43 pm
content: Place a 1M 0.5W resistor across the capacitor to discharge it, and you can safely make it a 0.22uF 250VAC class X or class X1 component, a lower current through the opto will still work. If you do not want to use a leaded resistor use 4 220k 0408 SMD resistor in series to replace it, you have to use at least 4 to get the voltage across each resistor low enough.Make the 220r resistor 1k or so, it will reduce the surge current through the LED a little with spikes. Make sure it is a 1W resistor. Add a 275V MOV across the input as well for spike clipping, along with a 1A mains rated fuse.Other than that it is a simple circuit, it does need attention to clearance distance between mains side and the output side, and for the bridge diodes you can use almost any diode, from a 1n4148 to a 1n4007, it only is handling 20ma and under 5V in most cases. You can also add a zener diode of anything from 10-30V in parallel with the LED to provide a current path if the opto goes open circuit. If you add it in series it makes the zero crossing pulses a little wider so that the output side can more reliably trigger from them. There will be a phase shift from the capacitor, so do not use this to drive any phase switch other than a zero cross switching one.

author: PA0PBZ
author_rank: Super Contributor
timestamp: November 11, 2012, 07:59:48 pm
content: Why the bridge? The led is capable of doing the rectifying by itself I'd think, or do you want a 100Hz pulse?

author: SeanB
author_rank: Super Contributor
timestamp: November 11, 2012, 08:04:23 pm
content: Bridge or a anti-parallel diode. With the bridge it is easier to filter to give a mains present signal, and it will go no signal faster than the 50Hz one.

author: Gall
author_rank: Frequent Contributor
timestamp: November 11, 2012, 08:17:30 pm
content: There are optocouplers with AC input (two LEDs inside). Take a look at i.e. Vishay H11AA1 (or many others).When working with mains voltage, two things are very important. First, the fuse of proper rating. It should always be used. The wall outlet is capable of kilowatts of power in case of short-circuit. Second, every capacitor should discharge quickly after disconecting power. Usually this is done by connecting resistors in parallel with capacitors. Even if the capacitor is too small to hold any dangerous charge, it is still very annoying to get a light electric shock from a disconnected plug every time you touch it.

author: Zero999
author_rank: Super Contributor
timestamp: November 12, 2012, 11:37:24 am
content: Another simpler option is to AC couple using Y1 capacitors but it's more prone to EMI isses.

author: wheezardth
author_rank: Newbie
timestamp: November 13, 2012, 02:02:43 pm
content: Wow! Guys, thanks for the overwhelming amount of great feedback!So, this is something like that, am I right?My understanding ends with the situation with the zeners - what is the reason of providing a current path if the opto blows?What would be stressed if the zener is not there in an OC situation?Thanks a ton, you are enormously helpful!

author: SeanB
author_rank: Super Contributor
timestamp: November 13, 2012, 05:22:07 pm
content: CP1 should be connected to pin 4, pin 3 should be grounded. Lose R4, and make R3 4k7. CP1 should be around 100n.

author: ColinB
author_rank: Contributor
timestamp: November 14, 2012, 05:40:22 pm
content: Quote from: Hero999 on November 12, 2012, 11:37:24 amThat's interesting, so you don't need optoisolation for safety in this case because you have capacitive isolation from mains?Can you explain why it is more prone to EMI issues? Are there ways to mitigate the EMI?

author: Zero999
author_rank: Super Contributor
timestamp: November 14, 2012, 09:02:11 pm
content: Quote from: ColinB on November 14, 2012, 05:40:22 pmYes, the capacitors are such a low value that the leakage current is too low to shock or injure someone but the capacitors need to be Y1 rated which means they're especially deigned to be connected to the mains and exposed metallic parts.QuoteWhen the mains is disconnected, EMI generated by another source can be picked up and pass through the capacitors. This could be minimised by connecting a 100nF capacitor across the mains input but it won't eliminate the problem completely.

author: ciccio
author_rank: Frequent Contributor
timestamp: November 15, 2012, 06:41:42 pm
content: The symbol of the bridge rectifier is wrong. The positive output pin (your number 2) should be the junction of two cathodes, the negative output pin (your number 3) should be the junction of two anodes.The numbering is correct if referred to a single-in-line packaged bridge.Best regards

author: ptricks
author_rank: Frequent Contributor
timestamp: November 16, 2012, 12:57:42 am
content: The schematic shown has the resistor after the MOV, the problem with this is the MOV can short and should the fuse not blow or be the wrong rating the current is infinite. Move the resistor to be directly connected to the mains before other components except for a fuse.One of the safest practices for circuit design that isn't emphasized much anymore is to limit the current being supplied to a circuit to only the amount the circuit needs. You see a lot of circuits now being powered from 5A supplies when the circuit only needs 100ma and relying on hope that nothing shorts and that a 5A fuse on the main supply will stop all the damage.

author: Zero999
author_rank: Super Contributor
timestamp: November 16, 2012, 12:07:26 pm
content: I'd also recommend putting the resistor on the phase (the same side as the fuse), assuming the mains connector is polarised of course.