I am currently in the process of having an arduino switch a well pump on and off.
I already built a standalone ATMega168 board for this, and wrote the code.
Here is a description of the situation:
I have a water well, a pump, and a pressure vat. The pressure vat has a gauge that sends 220V signals.
There is one signal wire (L) for low pressure, and one signal wire (H) for high pressure.
What I need to do is when wire L has 220V on it, I need to turn on the pump. When wire H has 220V, I need to turn off the pump.
Now this turning on and off is easily achieved with a relay.
The troubling part is the 220V AC signal.
What I want to do, is halfwave rectify the 220V AC signal and use a capacitor to ‘smooth’ out the signal and put that into an optocoupler. (I have a few LTV817’s around).
That way I can use the optocoupler to send a 5V signal to the ATMega when wire L or H is having 220V on it.
I have been looking around on the web and there is lots of different info around and some solutions look even more half assed than the other, and I have a healthy respect for 220V and would prefer not to have Einstein’s hairstyle. Also the load of (mis)information out there quite confused me.
So what I need to know is, how do I make that LTV817 optocoupler ‘detect’ 220V AC in a safe way?
From what I figure, I can halfwave rectify the AC with a diode and use a 0.25W resistor of, pff, 100K in the circuit.
I realize that this will lead to a ‘flashing’ output on the other side of the optocoupler, but I can smooth that with a capacitor.
I drew a little thing with Fritzing and I wonder if this is the way to go? Anyone got any tips before I go get another hairdo tomorrow?