I would like to have a decent circuit for sensing line voltage.
My first need was to monitor a water well pump. I used a 120v / 240v universal volt power supply to give 12 volts DC when the pump was on. This 12 volts went into a optocoupler, and then into the MCU. It seems safe enough.
Now I would like to monitor a water heater that has two 240 volt elements.
I would like to use reactive coupling for a few milliamps for the optocoupler and have a circuit that I can use for other line voltage sensing. This is my very first attempt at using reactance with line voltage.
I chose 20 milliamps as a relatively high, but not too high feed for the opto forward current. As you see, this 20mA may be shared between the LED (15mA) and R2 (5mA). I will be using the "C" version of the PC817, and the datasheet says I get 10mA to 20mA Ic with 5mA If.
The input goes into a 100mA fuse and a 510 ohm resistor to limit inrush. But if the reactance is limited to 20mA, do I need R1? Is it a good idea? If C1 fails closed, maybe R1 will give the fuse time to blow before it gets exciting.
I chose 0.22 for C1 to get 20mA at 240V and 60Hz. Is 400 volts enough, or should I go for 600 volts for C1?
A bridge rectifier feeds C2 and R2. I just picked 20 uF just on the 1000 uF per amp rule of thumb. Is R2 a good idea? If the opto LED failed open, I was thinking R2 could give fuse F1 some time to blow before overvoltage kills C2.
Thanks for all comments! I am sure I made some mistake somewhere!