Asked — Edited
Resolved Resolved by Rich!

Battery Voltage Monitor

I just added a voltage divider to my rover5 robot to monitor battery voltage. It is input to the EZ-b on an analog pin. The ADC gauge works neat as a fuel gauge. Wish it could be set to change color as the voltage goes below certain selectible points. The end goal is to get the the robot to say "Battery low" when the ADC pin becomes less than a certain voltage. I was looking for a script command like watch ADC port but there doesn't seem to be one. I suppose I could make up a script to check every 3 to 5 minutes with the alarm function but since the ez-b interface is periodically reading the adc port anyway to display the data it seems odd to have to use the alarm for that. An Interval timer would seem to be a better choice than using the alarm which I have to keep reseting to a new time every time it goes off.

Any thoughts from someone who has tackled this problem?


ARC Pro

Upgrade to ARC Pro

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

United Kingdom
#1  

A slight modification to my LiPo monitor should do the trick.

Melvin runs this circuit and script, I have another script running to output the details to the LCD screen which displays a bar chart for battery level. On low level it warns me and on critical level it will eventually shut everything down and disconnect the EZ-B (working on that circuit still)

#2  

I tried a modification of your LiPo Monitor script and that seems to do the trick. I was wondering if the ADC_Wait might be a way to do something similar without the loop. I haven't had a chance to dabble more.