Charging Station Design, Part IX

Posted 20 February 2017

As part of the project to implement autonomous charging capability for Wall-E2, I needed a way to monitor main battery voltage in normal ‘run’ mode, in order to tell when to start searching for a charging station.  The main battery is a 2-cell LiPo stack, and so has a nominal stack voltage of around 7.5-8V when fully charged.  Since this is well above the Arduino Mega’s internal +5V operating voltage, I can’t measure this directly via the analog input ports.  So, I installed a 1/3-2/3 resistive voltage divider between the main battery voltage input, analog input A0, and ground, as shown in the following schematic detail.

System schematic detail showing resistive voltage divider for battery voltage monitoring

The nominal reading at A0 is 1/3VBatt.  Using the Arduino’s internal +5V regulator as the reference, the nominal battery voltage is 5*[A0/1023]*3.

To test this arrangement, I modified the operating software to print out the raw and calculated battery voltage values, and got the following printout.

BattMonVol: Raw 568 pin 2.78V TTL Batt 8.33V
BattMonVol: Raw 569 pin 2.78V TTL Batt 8.34V
BattMonVol: Raw 539 pin 2.63V TTL Batt 7.90V
BattMonVol: Raw 559 pin 2.73V TTL Batt 8.20V
BattMonVol: Raw 567 pin 2.77V TTL Batt 8.31V
BattMonVol: Raw 570 pin 2.79V TTL Batt 8.36V
BattMonVol: Raw 568 pin 2.78V TTL Batt 8.33V
BattMonVol: Raw 554 pin 2.71V TTL Batt 8.12V
BattMonVol: Raw 553 pin 2.70V TTL Batt 8.11V
BattMonVol: Raw 566 pin 2.77V TTL Batt 8.30V

In addition, I measured the battery voltage directly using my trusty multimeter, and got 8.03V, so a pretty reasonable monitor setup.

 

Next up; I had previously added the 4-detector IR module to the robot, and now I needed to integrate the IR detector measurements into the telemetry stream.  The battery monitor is on A0, and the 4 detectors are on A1-A5.  After adding the telemetry code, I got the following printout.

Now I will add back in the left/right/forward distances, the forward variance, and the left/right wheel speeds.  After adding everything back, I get the following telemetry stream:

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *