I am working with some small Arduino-like microcontrollers on my boat, which is mostly 12V DC. I want to detect when a bilge pump is on, by detecting the voltage on the wire to the pump. I want to do it with a resistor, a Zener diode, and a capacitor, as shown below. The wire on the right will go to an input pin on the Arduino, and the pin will read "HIGH" if the voltage is 3 to 5V. I have read all kinds of explanations of how this works, but none of them are in simple enough terms for this electronics newbie. So I would like to describe what I *think* happens in this circuit, and maybe someone here can either confirm it, or correct it. The current draw of the input pin of the Arduino clone I'm using is about 20mA, and should be very consistent.
BTW, I know there are lots of ways to regulate voltage, but that's not my question.
Here goes:
- Approx 12V comes in from the pump's wire, but it can be lower than 12V if the battery is low (should never be lower than 11V), or higher than 12V when the pump starts and stops (and probably some other reasons).
- The resistor drops the current to a safe level for the Zener. (I think 1k may be bigger than I need, though. Maybe a 330 would be enough?)
- The voltage reaches the Zener, and if it were only 4V, for example, it would just keep on going, because the Zener would block it from going to ground. But because it's higher than the 5.1 Zener voltage, any voltage in excess of 5.1 "forces its way" through the Zener to ground, because electricity always wants to go to ground, and the Zener allows some of it to do that. Only 5.1 keeps going towards the right (to my Arduino's input pin). This is the part that I'm really asking about with this question - is my layman's explanation correct, or at least close?
- The capacitor smoothes out the voltage that reaches it, before it continues on to the right. (That's about all I know about the capacitor in this circuit - I was advised to have it, but it wasn't explained very well why. I will research that some more.)
- The pull-down resistor doesn't do anything when there is voltage coming in from the pump. It makes the input pin read negative only when there is no voltage from the pump.
Thanks for any clarification, edification, etc. you may have to offer.
BTW, I know there are lots of ways to regulate voltage, but that's not my question.
Here goes:
- Approx 12V comes in from the pump's wire, but it can be lower than 12V if the battery is low (should never be lower than 11V), or higher than 12V when the pump starts and stops (and probably some other reasons).
- The resistor drops the current to a safe level for the Zener. (I think 1k may be bigger than I need, though. Maybe a 330 would be enough?)
- The voltage reaches the Zener, and if it were only 4V, for example, it would just keep on going, because the Zener would block it from going to ground. But because it's higher than the 5.1 Zener voltage, any voltage in excess of 5.1 "forces its way" through the Zener to ground, because electricity always wants to go to ground, and the Zener allows some of it to do that. Only 5.1 keeps going towards the right (to my Arduino's input pin). This is the part that I'm really asking about with this question - is my layman's explanation correct, or at least close?
- The capacitor smoothes out the voltage that reaches it, before it continues on to the right. (That's about all I know about the capacitor in this circuit - I was advised to have it, but it wasn't explained very well why. I will research that some more.)
- The pull-down resistor doesn't do anything when there is voltage coming in from the pump. It makes the input pin read negative only when there is no voltage from the pump.
Thanks for any clarification, edification, etc. you may have to offer.