Hi there,
I don't know if this has been asked here before, but I have this "very basic" question and all the solutions I come up are either a bit expensive and include throwing away alot of energy. Here's the context:
I have a water boiler that is being controlled by a pressostat. I have a relay that I control with my arduino to feed power into the pressostat. Internally, it regulates the temperature of the water based on the pressure reading inside the boiler, meaning it will turn on and off the heater resistors. I wanted to have an approximate energy consumption value for this system and for that I need to know when the heater is on and not. If I take the integral of the time the relay control is ON, which is 99.9% of the time (it's just not on before having a minimum value of water inside the boiler, after that it's always on) the energy consumption value is much higher than it actually is because the heater is not always turned on.
My idea was to wire the output of the pressostat relay to the heater and take it all the way to the PCB and sense it. If it has 220VAC, then the heater is turned on and I need to count the ON time. If it doesn't, then the heater is not ON.
My first reaction was to use a simple voltage divider to bring down the voltage of the AC to like 3Vac and then feed it into an optocoupler. Even if I used like 10 0805 resistors of 100K in series and then in series with the LED of the optocoupler. I'm a little concerned with the safety of this approach (arcing across the resistors, something blowing up). Also, in software, I'd have to be looking for the transitions and determining when it's turned off. Other solutions include using a small transformer from 220VAC to something more manageable like 6VAC (BV EI 307 8009 for example), however this little guy is a bit expensive and not only that but it would be the same, on the other side of the optocoupler. I could add a diode bridge and a cap to make it into DC, but maybe I'm overthinking all of this. Is there any simpler approach to this that I'm not getting at ?
I have also seen some approaches where people use capacitors like resistors (
http://www.circuitdiagram.org/simple-220v-mains-indicator-led.html) to try and reduce the current flowing, but I don't know how valid this approach is either...