Electrical – 220 VAC detection using Optocoupler

acheatopto-isolatorsensing

I tried to detect 220V AC in my microcontroller using SFH620A-3 with series resistance of 440K (2 x 220K, 1/4 watts SMD type), a 1uF at the output to smoothen the pulse and every works as expected. However the resistors produces good amount of heat specifically when placed in a closed enclosure. The heat is not high to start a fire (I can still touch), however the heat slowly propagates across the PCB and other components too get hot. I did the power calculations and the voltage across the opto is less that 1mA and the power dissipation is 130mW on each resistor. I may have multiple AC detection circuit on a single board and hence the heat would multiply.

  1. Is it a good practice to increase the resistance further? I tried some 800K and the output wasn't reliable.
  2. Are there other ways to reduce the heat ?
  3. Should I try another AC optocouplers ? If yes, can someone suggest some AC optocouplers (DIP-4 casing).

Schematics

schematic

simulate this circuit – Schematic created using CircuitLab

Note : Transformers wont be feasible due to the size.

Update

I tried increasing the resistance by 100K, 50K etc and found that the opto fails to work at around 900K. The output seems to be stable at 770K, hence can I safely use 660K for my project (i.e 330K x 2) ?

Best Answer

You could add a capacitor in series with the resistors (a capacitor on each side, for safety reasons). If its capacity is adequate, it's impedance will drop a significant voltage without dissipating power (except a tiny amount due to its ESR).

Be sure to use mains-rated AC capacitors "X-type capacitors". Those have a "self-healing" structure that will prevent nasty failures in the case a line spike exceeds the capacitor voltage rating.

If most of the voltage is dropped on the caps you can lower the resistors by several order of magnitude (better to keep them anyway for safety, in case one of those spikes occur).

More details can be found in this other EE.SE thread.