Skip to content

Overall Battery Voltage, Current & Power Monitor

simat edited this page May 17, 2017 · 2 revisions

Firstly you will need to get all the bits you need.

  1. Beaglebone computer, can be purchased from here Adafruit Beaglebone
  2. Texas Instruments ADS1115 16 bit A/D converters, can be either purchased already soldered on a PCB Adafruit ADS1115 PCB or if you want to test your soldering skills and eyesight you can buy the chips from Element14, Digikey, Mouser or other TI distributor. Each converter has four channels so will measure four battery cell voltages or up to three current measurements.
  3. Two 1% resistors to divide the battery voltage down to less than 1.8 volts and a further 1MOhm resistor and 0.1uF capacitor to filter the voltage.
  4. 50mV or 75mV current shunts and two 100k resistors and one 0.1uF capacitor to filter the current.
  5. Prototyping Board or Breadboard to mount the components and hookup wire available from Adafruit, your local electronics shop, ebay etc
  6. Connectors, wire and hardware to connect your battery terminals to the Prototyping board. For the wire connecting the battery terminals to the board i would use some fine wire like 24-26AWG hookup wire so if you do have a short the wire will vapourise without causing a disaster. The exception is the battery minus lead which should be larger than 18AWG.
  7. 0.1uF ceramic filter capacitors and 1% can be obtained from local electronics shop etc.
  8. Power supply to run Beaglebone, I used something like this Switch mode supply

Secondly you will need to make up the circuit

If you are only reading the overall battery voltage use this circuit diagram. The ADS1115 A/D and other components can be placed on a Beaglebone Protocape or equivalent, or you could use a breadboard.

Next we connect it all together

Set the power supply voltage output to 5 volts. Connect to the Beaglebone via the 'Cape Expansion Headers' connector P9 pins 5 and 6. The Beaglebone negative (DGND P9 pins 1 and 2) and the power supply negative should be connected directly to the resistor divider board to avoid ground loops. There should only be one negative wire back to the battery negative terminal.

When all the other connections are done the power supply can be connected up to the battery positive supply via a fused circuit. It might be worth putting a switch on the positive supply so you can turn the Beaglebone off.

Software

Connect the Beaglebone up to your computer and SSH to it, if you are not sure how to do this do a google search "SSH Beaglebone". Adafruit has some good tutorials on getting started with the Beaglebone.

If your Beaglebone has access to the internet you can download the software with the command "git clone https://github.com/simat/BatteryMonitor.git"

Change directory to where the code has been downloaded to "cd BatteryMonitor"

Copy the appropriate config file and name it "battery.cfg". Copy the appropriate starting summary file and name it 'summary'

Start Python "python"

Load the Battery Monitoring software "import batteries"

Start the Battery Monitoring deamon "batteries.deamon()

You should see output from the deamon showing you the battery voltages.

The deamon can be stopped by typing ctrl-C

Then you can exit python by typing ctrl-D