Battery level not dropping #46
Replies: 2 comments 10 replies
-
Well, if you unplug your battery, but still are using the microcontroller, I'm guessing you've connected it externally, right? Then your battery charger is probably outputting a charging voltage which your ADC is picking up despite there not being a battery. |
Beta Was this translation helpful? Give feedback.
-
First of all, is the 10k resistor the upper or lower of the two? It should be the lower one. If you unplug the battery and use a multimeter you will see the Vin pin is not at 0, but at How to fix: use some electrical tape to isolate the power pin of the USB connector, so that the USB is not providing power to the Uno, I would also add a diode between the battery and Vin (this should also help with inverted polarity). In any case, you should use a multimeter to see the voltage at the resistors' junction: that's what the library is using to determine the voltage and, as a consequence, the battery charge level. |
Beta Was this translation helpful? Give feedback.
-
hey, I'm very new to all this so this mistake might be very obvious. I have a 12v NiMH battery hooked up to a 10k resistor and 20k resistor. But according to the code the battery level is not dropping and its still reading 100% even when i unplug the battery is there a reason why?
code:
Beta Was this translation helpful? Give feedback.
All reactions