diy solar

diy solar

Anyone working with the Overkill Solar Arduino lib?

jbatx

I make stuff with things
Joined
Jun 8, 2021
Messages
184
Location
Austin, TX
I'm really interested in getting my system online for remote monitoring, at least. However, I have zero experience with Arduino and embedded but tons of experience as a developer at higher levels. Has anyone here successfully set up remote monitoring for their Overkill BMS(s) using the Arduino lib or otherwise?

Thanks,
JB
 
I emailed chatted with overkill today. Seems pretty simple to create a read-only setup going through some aws tools like sqs, s3, rds and quicksite.

Is anyone interested in something like this?
 
I am intrested as I have the same controller as the overkill and want to do monitoring locally. I do have the bluetooth dongle as well as the RS-485 adapter.
, but I have no experience programming arduinos or other single board computers of that type of design. I do local monotoring of my other equipment using single board real time computers.
 
I picked up a couple esp32 modules yesterday instead of the avr based arduinos. These are supported by the Arduino ide and ought to work with the lib. They're more advanced than arduino and come with wifi and bt onboard, among other things. Someone has already used the overkill arduino lib with esp32 boards, which is great. The basic read-only architecture for this poc will look like this...

Bms---serial_com-->esp32-->tmobile_4&5g_hotspot--->mqtt--->postgres--->aws_quicksight_reporting.

Of course, it'd be simple to set up monitoring and alerting on top of the mqtt or postgres server. I'm just not going to make that part of the poc.

Note that there are several other projects out there doing similar things with raspberry pi. Some are discussed on this forum. I felt like sticking with the Arduino lib was the best approach because its already a complete read only lib. The pi solutions all look incomplete / wip on that front. Additionally, the Arduino lib supports the SW fets on/off. Those are controlled by the charge and discharge switches in the app. Also, there is no need for a full os single board computer like a pi ...as far as I can tell. Also, the low power consumption and tiny size of the feature rich esp32 makes it a better platform for this, imo.
They're also less expensive. I spent $16.99 for two esp32 modules and those were not the cheapest. With jumpers and breadboards, my cost was < $30.

It might be possible for the esp32 bt module to pass comm port data between it's bt and the bms. I can see how that would be programmed but I don't know the limitations of the hardware. If it's possible, then the app would connect to the esp32 for programming the bms. If this isn't possible, then programming the bms would require unplugging the esp32, plugging in the bt module and connecting the app. I don't like this because it takes monitoring offline... And its a pain.
 
I'm really interested in getting my system online for remote monitoring, at least. However, I have zero experience with Arduino and embedded but tons of experience as a developer at higher levels. Has anyone here successfully set up remote monitoring for their Overkill BMS(s) using the Arduino lib or otherwise?

Thanks,
JB
Have not set up yet. Mostly focused on local database for local battery health history functionality.

Seen some multiple libraries/projects around here that facilitate UART communication with JBD BMS. Awesome stuff.

Agree with you about Raspberry Pi being overkill if it's just communication with BMS needed. Both too much power usage and more prone to failure than microcontroller in my humble estimation.

Adafruit and sparkfun have some breakout boards that allow LTE data to microcontroller relatively easily. That could remove WiFi as a failure point potentially.

Just randomly sharing, I like your decision to consider MQTT. Have been considering influxdb and grafana to handle LAN based monitoring. But that's not quite remote like topic here.

Good luck and this topic is super cool!

I will be using SAMD21 microcontroller probably, this one has worked well for me so far: https://www.adafruit.com/product/4600

VERY exciting times to be able to whip up a quick firmware, program it onto a microcontroller, and have something that's basically as good as a lot of shipping solutions!
 
Have not set up yet. Mostly focused on local database for local battery health history functionality.

Seen some multiple libraries/projects around here that facilitate UART communication with JBD BMS. Awesome stuff.

Agree with you about Raspberry Pi being overkill if it's just communication with BMS needed. Both too much power usage and more prone to failure than microcontroller in my humble estimation.

Adafruit and sparkfun have some breakout boards that allow LTE data to microcontroller relatively easily. That could remove WiFi as a failure point potentially.

Just randomly sharing, I like your decision to consider MQTT. Have been considering influxdb and grafana to handle LAN based monitoring. But that's not quite remote like topic here.

Good luck and this topic is super cool!

I will be using SAMD21 microcontroller probably, this one has worked well for me so far: https://www.adafruit.com/product/4600

VERY exciting times to be able to whip up a quick firmware, program it onto a microcontroller, and have something that's basically as good as a lot of shipping solutions!
Thanks for all that! For this site, we have several other systems that need monitoring. Water tank level, vermicompost toilet temp and moisture, cameras, facility temp and moisture, and we need to turn on/off a uv sterilizer when water flow starts and stops. Having an lte connection on each device would be really expensive and quite a hassle to manage.
 
Having an lte connection on each device would be really expensive and quite a hassle to manage.
Thank you for helping me understand the trade offs better ? did not realize that other devices were amortizing hotspot, nice.
 
[UPDATE]

I have a basic ino sketch written that
  1. connects to the specified wifi.
  2. attempts to use the lib to pull various data from the bms
  3. builds a json with all the data
  4. posts it to postb.in
However....

There are issues with the lib compiling with the params set in the esp32 board libs. The nature of the issue is that many Arduino boards use the 'fpermissive' parameter to let some older and incorrectly written libs to compile - even if there would otherwise be errors. Espressif's (the esp32 manufacturer) libs don't do this. It appears that Furtrader's lib suffers from from issues that were hidden with fpermissive. ....This is just a hypothesis at this point. The lib will not compile for esp32 a variety of reason - that I am working through.

But, there is hope...

In debugging the lib I eventually found where one of the functions defined in the lib is being call, by the lib, with some parameters reversed. I believe this issue was masked by the fpermissive setting from the author and never noticed. I fixed my local version by passing the parameters in the correct order and the related errors went away. I posted and issue about it here: https://github.com/FurTrader/Overkill-Solar-BMS-Arduino-Library/issues/4

I'm onto the other compilation errors now.
 
The second set of errors was caused by incorrectly calling another function. Those are resolved and the lib compiles.

Unfortunately, I cannot seem to get the serial connection to the bms to work. I'm sure I'm doing something wrong.

I confirmed that I have the port connected on the esp32 correctly by connecting the other end of it to a second esp32 and sending / receiving data between the two of them. This worked.

The bt comm module works fine.

...still working on it. Any help would be appreciated
 
The second set of errors was caused by incorrectly calling another function. Those are resolved and the lib compiles.

Unfortunately, I cannot seem to get the serial connection to the bms to work. I'm sure I'm doing something wrong.

I confirmed that I have the port connected on the esp32 correctly by connecting the other end of it to a second esp32 and sending / receiving data between the two of them. This worked.

The bt comm module works fine.

...still working on it. Any help would be appreciated
May ask for some wiring diagram or picture of circuit?

Sounds like you're getting closer, I'm sure you will be able to sort out the UART soon.
 
BTW I have a few JBD BMS (4S/8S) and I'll try to check out your code in detail soon.

I too want to set up a microcontroller to read the data off BMS Serial and then input it into my own thing for insights/monitoring.

Thanks for posting updates about your project!
 
May ask for some wiring diagram or picture of circuit?

Sounds like you're getting closer, I'm sure you will be able to sort out the UART soon.
You bet. Attached is the fixed (I think) bms.cpp lib from the repo and my sketch inside overkill_sandbox.zip. The sketch is just dumping debug output right now. The photos and pinout are attached too.

I have not used the Vraw from the bms's port because it's 13v and also because I'm powering the board with the usb connection. You can see the gnd, rx and tx connected. I am using uart2. That is gpio17 for tx and gpio16 for rx. The blue wire is ground.
 

Attachments

  • IMG_20210920_123905.jpg
    IMG_20210920_123905.jpg
    147.1 KB · Views: 48
  • IMG_20210920_123916.jpg
    IMG_20210920_123916.jpg
    115.6 KB · Views: 49
  • IMG_20210920_123930.jpg
    IMG_20210920_123930.jpg
    92.9 KB · Views: 53
  • IMG_20210920_123939.jpg
    IMG_20210920_123939.jpg
    143.7 KB · Views: 53
  • KeeYees-Nodemcu32s-pinout.jpg
    KeeYees-Nodemcu32s-pinout.jpg
    118.7 KB · Views: 53
  • overkill_sandbox.zip
    8.3 KB · Views: 29
Thank you for helping me understand the trade offs better ? did not realize that other devices were amortizing hotspot, nice.
well, I'm not sure what you mean by that. ....and Guess you could get one with an LTE chip and use it as a wifi hotspot. But, why not just get a hotspot and not spend the time screwing with that part of the system if you don't have to?
 
For some reason I was thinking it was a lone sensor in the wild, and was like “oh dedicated wired LTE interface” but did not realize there are other devices too in context so having them all connect to a shared WiFi LTE bridge more economical
 
For some reason I was thinking it was a lone sensor in the wild, and was like “oh dedicated wired LTE interface” but did not realize there are other devices too in context so having them all connect to a shared WiFi LTE bridge more economical
gotcha. yeah, this whole system will probably need a wifi range extender to get internet to all the sensors involved. I'm going to end up monitoring water tank level for two 2600g tanks, vermiculture toilet conditions and triggering water flow from air conditioner condensate line into the tank... at least that's the goal, and of course solar monitoring.
 
Hey you both seem to be making progress but since you are starting to talk about sensing and controlling other things as well,
you might find Home Assistant hosted on Raspberry PI with a Wifi Router easier to interface and is only about a 5 watt load.
I am using ESP8266 node MCUs and they program and are brought online with a simple markup language. I use them to control motorized windows and curtains to moderate passive solar. Open Source Home Assistant is really powerful...why reinvent when you can get it canned....just my thoughts. IF you would like consider going in that direction I would be happy to help.
 
Hey you both seem to be making progress but since you are starting to talk about sensing and controlling other things as well,
you might find Home Assistant hosted on Raspberry PI with a Wifi Router easier to interface and is only about a 5 watt load.
I am using ESP8266 node MCUs and they program and are brought online with a simple markup language. I use them to control motorized windows and curtains to moderate passive solar. Open Source Home Assistant is really powerful...why reinvent when you can get it canned....just my thoughts. IF you would like consider going in that direction I would be happy to help.
Yeah, I may go that way.
 
If anyone can answer these questions, it would be super helpful. ...I'm also doing my own research - as much as I can.

  1. Is the communication issue between the bms and the esp32 due to the uart voltage diff? That is, the esp32 uart is 3.3v and the bms is 5v. All that I read about that indicates that would be the issue and that I'd nee a line-level converter to make it work.
  2. If the answer to #1 is yes, is there a line-level converter in particular that I ought to use?

Also, to clarify why I'm choosing this route instead of jbdtool and a rasberrypi...

The primary reasons are cost, low power consumption and simplicity. I only need to monitor this one thing with these boards. Getting the program written to use this lib and wifi connected took about 2.5 hours, total. Excluding the lib debug time, of course. That's the first embedded work I've ever done. Getting this project working on the esp32 would create a very inexpensive and near turnkey solution for data transmission to any cloud solution for the overkill and Jbd units. I chose esp32 over the tested arduino boards because it's modern and made the basic - table stakes - stuff easy. ...'course this is all relative and assumes the user has some good experience with cloud and data. $10 and 30-60 minutes of setup time for each battery sounds pretty great to me. Connect your BI tool of choice to the database and you're done.
 
Last edited:
Yes I have found 3.3v to 5V on the same bidirectional data lines works only some of the time...and then sometimes not on the same line.
You can use two BS180 fets to to translate the 3.3v Esp MU data to BMS direction to convert up to +5V and the BMS 5V might not need to be converted down to 3.3V for BMS to ESP data direction. Something like this circuit might work. Good Luck
 

Attachments

  • Screenshot 2021-09-21 12.39.39.png
    Screenshot 2021-09-21 12.39.39.png
    429 KB · Views: 18
Back
Top