Solar battery testing with Electrodacus, part 1

Spread the love

While this is indeed my first post about the work we have been doing with solar, there have been a number of experiments with all sorts of learning. I do hope to get to posting about the past learning, but I knew if I never started somewhere it just wouldn’t happen. Please note that this particular post is more on the technical side (boring for some, fun for nerds like me).

The focus of this post will be the solar battery management system (BMS) testing that I have done with building a custom 24V battery using 8 x 3.2V Lithium Iron Phosphate (Lifepo4) cells. The cells were purchased from https://www.electriccarpartscompany.com/ and the BMS from http://www.electrodacus.com/ (loving the BMS by the way). The purpose of this testing was to prove in small scale what we plan to do in large scale with our entire home (that will be a different post). The plan was to build a battery bank capable of doing the following:

  • Charge from solar, but be protected from over charging
  • Consume battery power in the form of AC 120V, but be protected from over discharging

You can read more about the Solar BMS (SBMS) from the builders site, but it’s enough to know that this BMS was part of a kickstarter and from what I can tell is not as well known, but that’s not for lack of features. I have also purchases the DSSR20 modules from the same site as an alternative to using a traditional charge controller (MPPT).

Let’s get into the brief design, then I’ll conclude with how I am monitoring things. Here is how I have things wired:

Please note that I do NOT have the inverter connected to the SBMS0 for shutdown during low voltage, this was due to a mistake that I made in the purchase of an inverter that doesn’t have that capability, but that didn’t stop my other testing. Things to note:

  • Solar panels are in series due to their smaller size and lower voltage (small scale testing remember)
  • Two shunts are for measuring both current flow to/from the battery as well as the power coming from PV
  • 1KOhm resistor needed as part of the SBMS0 managing the DSSR0 per documentation: https://electrodacus.com/DSSR20/DSSR20.pdf, page 7

So, the fun part of this project was using the manual for the SBMS0 to extract the rich data provided via the USB serial connection described in detail in the manual: https://electrodacus.com/SBMS0/SBMS0.pdf. The SBMS0 has local logging capability and a very simple web interface that can be accessed with the WiFI module, but only if the device hosting the web page connects locally to the broadcast Wifi connection on the SBMS0. If that sounds complicated, it sort of is. My goal was to gain access to all of the available information from my home network. So, the project began 🙂

I won’t bore you with the details of the different iterations of what I did, but let’s get right to where I ended up (and am very happy with). Components used for the final solution:

  • Raspberry Pi 3 B+, this has wifi
    • Installed with Raspbian Lite
  • Custom Python script, used the code base from a fellow SBMS0 automation guru David A. Mellis / Tom Igoe found on the community site…I heavily modified the python code to use the serial connection and NOT parse HTML. I also added all of the logic to put the data into an InfluxDB to provide the data source for all my graphs. Here is the link to that code I wrote.
  • InfluxDB, used a simple guide here to install and configure on my Pi
    • Influx python library also needed: sudo apt-get install python-influxdb
  • Grafana, awesome graphing tool installed on the Pi using guide found here

Here are the steps I took to get things going:

  • Installed software above
  • Created a database in InfluxDB
    • > influx
    • # CREATE DATABASE SBMS
  • Made up a measurement name and instance name for better graphing in Grafana
    • These fields are used in the python script
  • Ran the python script interactively (through a simple putty session)
    • This allowed me to troubleshoot things and see if a messed up the script, but once things were smooth, I created a service to run the python script using the following commands:
      1. sudo nano /etc/systemd/system/SBMS-Logger.service
        • Simple service configuration file, mine is located here
      2. sudo systemctl enable SBMS-Logger.service
      3. sudo systemctl start SBMS-Logger.service
  • Open Grafana at https://<Your-Pi-IP>:3000
    • Add your InfluxDB as a datasource, this was very simple since the DB was local and for me it was already in the list
    • Start making graphs with your data. This wasn’t fast for me as it took my a bit of learning the interface, but within 5 min I had my first dashboard with two graphs.

I played around with things for a week or so and made a number of code updates with Grafana alerts and all sorts of fun things, but they were all personal preferences. I even went ahead and added my Samsung SmartThings data to Grafana and have all sorts of cool stuff now. Anyway, I hope this helps someone out who might be looking at a solution for graphing data on the cheap, especially with an AWESOME BMS from http://www.electrodacus.com/. I’ll close with my current SBMS0 dashboard:

Leave a Reply

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