Open source battery monitoring system (BMS) with a difference

karrak
karrak Solar Expert Posts: 326 ✭✭✭✭
I have made available the design information and software I have used to make a low cost ($100-150) flexible battery monitoring system using the Beaglebone Linux single board computer. The project can be found here https://github.com/simat/BatteryMonitor.git

Rather than design a purpose built board I have gone for the very capable Beaglebone and added a simple battery interface comprising a resistor divider network and a few multichannel 16 bit A/D chips to convert the battery cell voltages to a digital signal, this gives a resolution of around 1mV for a 24 volt battery bank. Battery current can also be monitored with the addition of a shunt and two small resistors.

The project does not require special soldering skills and could be bread-boarded except for soldering a connector on to a A/D PCB that is available if you don't want to solder the A/D chip with its 0.5mm pin spacing.

The only word of WARNING I have is that anyone who is not aware of the dangers of connecting up wiring to high power battery banks should not do it!

Currently the program just logs to files, but it would be easy to extend this to generating web-pages for display over the internet. It is also a fairly trivial exercise to have the Beagleboard produce alarms to drive safety relays or maybe even send texts to your mobile phone.

My primary use of this device is to monitor my LiFePO4 battery bank and provide me with information via the internet on the battery state when I am away from home, and also log the battery data over a long period of time so I can see how good or bad these batteries really are over time. It is more than likely that this project will develop into a full power management system.

I have had this up and running for a little while and found it to be very useful, hopefully it will be useful to others.

Here is the running summary file Attachment not found. and daily summary file Attachment not found. produced from the program, the circuit diagram of what I built Attachment not found. and some photos

Attachment not found.Attachment not found.
Off-Grid with LFP (LiFePO4) battery, battery Installed April 2013
32x90Ah Winston cells 2p16s (48V), MPP Solar PIP5048MS 5kW Inverter/80A MPPT controller/60A charger, 1900W of Solar Panels
modified BMS based on TI bq769x0 cell monitors.
Homemade overall system monitoring and power management  https://github.com/simat/BatteryMonitor
 

Comments

  • PNjunction
    PNjunction Solar Expert Posts: 762 ✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference

    Wow! Thanks for sharing. And writing it in Python!

    ... Linux 3.2.0-4-686-pae #1 SMP Debian 3.2.60-1+deb7u3 i686 GNU/Linux
  • karrak
    karrak Solar Expert Posts: 326 ✭✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference
    PNjunction wrote: »
    Wow! Thanks for sharing. And writing it in Python!

    Thanks for the thumbs up. Hopefully my first attempt at writing in Python is decipherable! Your feedback would be appreciated.

    My design days date from the time where every machine cycle and byte of memory was sacred. Getting used to the new regime of processors running at speeds in the GHz and having megabytes of memory takes a bit of getting used to. I am still amazed that a single board computer running a complex operating system can work well running a real time application. I must say that I am suffering from withdrawal writing in machine code and Forth.
    Off-Grid with LFP (LiFePO4) battery, battery Installed April 2013
    32x90Ah Winston cells 2p16s (48V), MPP Solar PIP5048MS 5kW Inverter/80A MPPT controller/60A charger, 1900W of Solar Panels
    modified BMS based on TI bq769x0 cell monitors.
    Homemade overall system monitoring and power management  https://github.com/simat/BatteryMonitor
     

  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference

    Youll no doubt know ive been working on something similar here:

    http://code.google.com/p/theblackboxproject/

    Ill take a look over yours when i get a moment and see if theres useful collaboration to be had.

    Thanks!
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar


  • PNjunction
    PNjunction Solar Expert Posts: 762 ✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference
    karrak wrote: »
    Thanks for the thumbs up. Hopefully my first attempt at writing in Python is decipherable! Your feedback would be appreciated.

    I won't be much help as my high-level language programming consisted mostly of shell script grep/sed/awk. I never did graduate to perl, or other high level languages. What is amazing is that what used to be run on a massive machine or really costly workstation I can now run on a thumbdrive. Knoppix typically. Still blows my mind.
  • karrak
    karrak Solar Expert Posts: 326 ✭✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference
    zoneblue wrote: »
    Youll no doubt know ive been working on something similar here:

    I was not aware that you were working on this. I have looked at your very good web page on your solar set-up but didn't look at any of the side links.

    Looks like you have been working on the web integration side of things which is one area that I am interested in. I suppose the main difference between our approaches is that I am getting the data directly from the battery where you are integrating it from the other equipment.

    Thanks for letting me know about your project, I will investigate further.
    Off-Grid with LFP (LiFePO4) battery, battery Installed April 2013
    32x90Ah Winston cells 2p16s (48V), MPP Solar PIP5048MS 5kW Inverter/80A MPPT controller/60A charger, 1900W of Solar Panels
    modified BMS based on TI bq769x0 cell monitors.
    Homemade overall system monitoring and power management  https://github.com/simat/BatteryMonitor
     

  • nsaspook
    nsaspook Solar Expert Posts: 396 ✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference

    Very cool! I've got a 'Roll Your Own' BMS but it uses embedded PIC controllers and C instead of a full blown Linux OS but can use data collected from Linux TCP/IP DAQ clients.
  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference
    karrak wrote: »
    I was not aware that you were working on this. I have looked at your very good web page on your solar set-up but didn't look at any of the side links.

    Theres a few people on the midnite forum who periodically throw some energy at blackbox, but its moving slowly.
    Looks like you have been working on the web integration side of things which is one area that I am interested in. I suppose the main difference between our approaches is that I am getting the data directly from the battery where you are integrating it from the other equipment.

    Thanks for letting me know about your project, I will investigate further.

    So far the focus has been on talking to RE gear, but the plan is to make something modular that could eventually talk to anything. The current thinking (for further prototype development) is to pair the ARM board with a atmel/arduino class device to manage sensors and radio links.

    Various of us have put together our own systems, out of necessity, but i was hoping that we might some of us anyway work together to try to advance this project. In total theres quite a bit to it. My own priority is focused on tuning the linux os to better manage its flash storage life/ long term system stability. Theres another guy who is currently doing some work on the UI. And a pair of guys with an interest in the ADC/wireless sensors. But we all of us have time constraints.

    I hope we can stay in touch and i also am studying your stuff. Looks nice with that precision ADC. A special interest of mine is to monitor insolation independently of controller throughout, so as to get a realtime measure of power available for oppurtunity loads.
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar


  • Nila
    Nila Solar Expert Posts: 173 ✭✭
    Re: Open source battery monitoring system (BMS) with a difference

    Hey Karrak

    Thanks for doing this,

    This is the same reason why I really started learning the whole bunch of Arduiono/RPI/ Beagle bone/Cubie truck. :)

    Happy to see your opensourced system, I will take a look and see how hard it is for me to try yours and further help.
  • jwrgorman
    jwrgorman Registered Users Posts: 22 ✭✭
    Re: Open source battery monitoring system (BMS) with a difference
    Nila wrote: »
    Hey Karrak

    Thanks for doing this,

    This is the same reason why I really started learning the whole bunch of Arduiono/RPI/ Beagle bone/Cubie truck. :)

    Happy to see your opensourced system, I will take a look and see how hard it is for me to try yours and further help.

    Yes this is very interesting, thanks! we have an open source energy management platform focused on renewable energy called SolarNetwork:

    https://github.com/SolarNetwork/solarnetwork/wiki/Developer-Guide

    and we capture data from a number of different solar charge controllers, grid-connect inverters, industrial switches and can run on a Raspberry Pi, and other ARM based computers that run Debian or BSD and Java. We look forward to using the BeagleBone Black!

    clearly there is a lot of potential in storing solar energy in LiFePO4 and releasing it judiciously.
    John Gorman / SolarNetwork Foundation
    e:john@solarnetwork.net
  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference

    Do you have a website or some higher level docs, quick start like? The docs appear extensive, but assume you know what the thing does.

    Edit : its here: http://solarnetwork.net/

    Ambitous!
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar


  • karrak
    karrak Solar Expert Posts: 326 ✭✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference
    zoneblue wrote: »
    I hope we can stay in touch and i also am studying your stuff. Looks nice with that precision ADC. A special interest of mine is to monitor insolation independently of controller throughout, so as to get a realtime measure of power available for oppurtunity loads.

    The ADC is working well, for the current monitoring I have two channels in differential mode hooked up to a 50mV, 200A shunt which if my calculations are correct gives a resolution of around 30mA, also works well for current in both directions.
    Off-Grid with LFP (LiFePO4) battery, battery Installed April 2013
    32x90Ah Winston cells 2p16s (48V), MPP Solar PIP5048MS 5kW Inverter/80A MPPT controller/60A charger, 1900W of Solar Panels
    modified BMS based on TI bq769x0 cell monitors.
    Homemade overall system monitoring and power management  https://github.com/simat/BatteryMonitor
     

  • karrak
    karrak Solar Expert Posts: 326 ✭✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference

    I have added some new features to the battery monitoring system
    1. Configurable alarm outputs
    2. Extra information on battery current throughput and SOC

    The following information is now logged
    1. Minimum and maximum cell voltages and overall battery voltage with and without load
    2. Minimum and maximum difference in cell voltages with and without load
    3. Maximum charge and discharge current
    4. Maximum, minimum and average battery SOC
    5. Total charge and discharge current

    Simon
    Off-Grid with LFP (LiFePO4) battery, battery Installed April 2013
    32x90Ah Winston cells 2p16s (48V), MPP Solar PIP5048MS 5kW Inverter/80A MPPT controller/60A charger, 1900W of Solar Panels
    modified BMS based on TI bq769x0 cell monitors.
    Homemade overall system monitoring and power management  https://github.com/simat/BatteryMonitor
     

  • jwrgorman
    jwrgorman Registered Users Posts: 22 ✭✭
    Re: Open source battery monitoring system (BMS) with a difference
    karrak wrote: »
    I have added some new features to the battery monitoring system

    Cool. Looks like progress! keep going, there's a lot of great stuff to do with that data I'd say.
    John Gorman / SolarNetwork Foundation
    e:john@solarnetwork.net
  • jwrgorman
    jwrgorman Registered Users Posts: 22 ✭✭
    Re: Open source battery monitoring system (BMS) with a difference

    We'll have some updates and additions to this site soon...For a user, it's really easy to add new components to a SolarNode. You just boot up with the standard SD media, and navigate to the GUI interface just like a DSL router or modem with a browser - point and click. You need to associate the node with our cloud server application (SolarNet) but then you add a plugin repository, and you can add components like inverters, switches, charge controllers, etc. Do you have a Midnite Classic by the way? we'd love to support those with Modbus connectivity.
    John Gorman / SolarNetwork Foundation
    e:john@solarnetwork.net
  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Open source battery monitoring system (BMS) with a difference

    I do modus over ethernet with our classic, but you can also do it over serial, using the internal rj11s . There were some early teething pains with the controller firmware but thats settled down and works ok. You can read as fast as 100ms intervals if you want.
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar