Measuring high DC supply voltage with an Arduino
We want to give , so
Now, just as a sanity check we should calculate the current of the resistor divider, to make sure we’re not converting too much electricity into heat. Ohm’s law gives us
which in this cases gives
No problems there. This works okay, but we lose a lot of precision, as only ~1/3 of the Arduino’s range is actually used: the Arduino’s ADC has 1024 different readings between 0-5V, so when reading the 0-30V range the precision is just about over the range. If only we could move the lower bound, so that 20V would map to 0V on the Arduino. A wild Zener Diode appears! One use of a Zener diode is as a voltage shifter. The closest Zener diode I could find was an 18V of the BZX79 series. This resulted in the following circuit: which I hacked into my Arduino box. Now, theoretically the formula for translating an voltage at the Arduino to the supply voltage should be:
I then did some quick measurements of various input voltages and the resulting voltage at the Arduino pin:
|Input voltage||Arduino pin|
You must be logged in to post a comment.