Hi all!
I'm trying to detect when a 24v pump comes on. It has an automatic float switch, and is driven from the same power source as my processor, which is an ATMega 328P. The processor is powered by a 5V onsemi LM2576 regulator, and the 5v and 24v circuits share the same GND through this.
I'd like to not have to run a separate wire out where the pump is, and then install a separate float switch. I'd like to just detect when the internal switch of the pump has come on. by detecting when current flows in the wire running out to the pump.
Can i just add a resistor to the 5v circuit in series with a diode and a fuse, above the pump, so that when the pump comes on, it sends my 5v to ground, but uses the current from the 24v circuit to power the pump? This seems totally wrong to me, as the 24v would be pushing back against the 5v in my poor tiny brain, which would then be stopped (hopefully!) by the diode from killing the processor.
I'm assuming it would be much more sensible to use an optocoupler, with the 24v driving the LED anode side, and my little 5v circuit just whizzing to ground and pulling the pin low when the 24v circuit is made. All optocouplers seem to be 5v LED side to me, so can i run an optocoupler through a voltage divider somehow, to reduce the current and voltage, in a way that it only comes on when the 24v pump switch comes on?
I feel as though i might be missing something really obvious, to get a safe, user proof way of getting this 24v circuit to trigger my 5v circuit within my enclosure. preferably with only one wire running from that enclosure to the pump positive or negative wire.
Many thanks in advance, you guys have all been amazing through this. This is my first post, so i hope I get it right! Gonna try to upload a kiCad thing now..... oh, i've managed to upload them, but can't figure out where to put a voltage divider in the optocoupler example! urfff... I'll try drawing it on paper again....
resistor and diode to GND.pdf (19.2 KB)
optoisolator sensor.pdf (19 KB)