I'm trying to monitor a bilge pump on my boat, so I can get an alarm whenever it comes on. It's a 12V pump with a float switch that turns it on. I want to "tap into" the wire between the float switch and the pump, and when the float switch closes, and the pump comes on, I want to "see" that on a microcontroller. The microcontroller has 3.3v GPIO pins. I also want to power the microcontroller from the boat's 12V system so I don't have to worry about replacing little batteries periodically, and the microcontroller is powered by 5V.
I have used a simple LM7805 voltage regulator to provide power to the microcontroller. I have used a voltage divider and then a Zener diode on the "tap wire" to step the voltage from 12V (approx) down to 3.3V. All of these subsystems work fine by themselves. But when I actually connect the "tap wire" from the pump wire to the voltage divider / Zener diode / GPIO, the voltage just before the voltage divider is only about .75 volts. Is the problem that almost all of the 12V is taking the easy way to ground through the pump, and only a small fraction of it is going to the microcontroller through my "step down" circuit? I thought I'd have the full 12V at my voltage divider / Zener diode, but I surely don't.
If this is indeed what's happening, then I guess I'm starting from scratch with this question: How can I "tap into" a 12V wire and monitor it with a 3.3V microcontroller?
I have used a simple LM7805 voltage regulator to provide power to the microcontroller. I have used a voltage divider and then a Zener diode on the "tap wire" to step the voltage from 12V (approx) down to 3.3V. All of these subsystems work fine by themselves. But when I actually connect the "tap wire" from the pump wire to the voltage divider / Zener diode / GPIO, the voltage just before the voltage divider is only about .75 volts. Is the problem that almost all of the 12V is taking the easy way to ground through the pump, and only a small fraction of it is going to the microcontroller through my "step down" circuit? I thought I'd have the full 12V at my voltage divider / Zener diode, but I surely don't.
If this is indeed what's happening, then I guess I'm starting from scratch with this question: How can I "tap into" a 12V wire and monitor it with a 3.3V microcontroller?