diy solar

diy solar

JBD BMS Wi-Fi Module

melkier

Solar Enthusiast
Joined
Jul 24, 2020
Messages
129
OK So I bought a bunch of the JBD BMSs for my powerwall and needed a way of monitoring/managing them that did not require I walk to the solar room with my cell phone and connect to each one with bluetooth or worse yet somehow come up with a 14 serial connection system to my raspberry Pi. So I came up with a method to use the ESP8266 (ESP-01) chip to provide wifi access to my BMSs. I'm sharing my method here.

To duplicate, you'll need the following components:

PCB Boards:


Connectors for the UART


The BMS puts out 10-12v on the V pin of the uart, so we need a way to go to 3.3v for the esp-01:


If you don't have header pins, you'll need some to solder the voltage regulator to the PCB:


ESP-01s chips (prob dont need the 1M chips, but I have future plans for these yet):


A way to mount them:


A way to program them:


Also, you'll need to get esp-link to flash onto the ESP-01


I'll go through the steps, but the end result looks like the attached pic

note: I've been considering drawing up plans for JLPCB and maybe 3D printing a case, but haven't had the time yet. For now, they work and work well.
 

Attachments

  • jbd-esp.jpg
    jbd-esp.jpg
    52.4 KB · Views: 493
Last edited:
OK So first let me start by acknowledging my soldering skills are pretty rough ...

I start by getting all my materials together

Then solder the pins onto the voltage regulator, cut the ADJ trace and solder the 3.3v pad
 

Attachments

  • 20210121_213247.jpg
    20210121_213247.jpg
    44.1 KB · Views: 227
  • 20210121_213742.jpg
    20210121_213742.jpg
    59 KB · Views: 221
Next I solder the voltage regulator, the ESP base and the uart connector to the PCB.

Then, I cut the leads off a resistor for some jumpers.

Then solder a jumper from the TX pin of the ESP base to the RX pin of the connector.

Then solder a jumper from the GND pin of the ESP over 2 spaces to connect to ground on the voltage regulator.
 

Attachments

  • 20210121_213856.jpg
    20210121_213856.jpg
    96.6 KB · Views: 111
  • 20210121_214843.jpg
    20210121_214843.jpg
    95.7 KB · Views: 108
  • 20210121_214859.jpg
    20210121_214859.jpg
    69.8 KB · Views: 106
Next I solder the power wire from the UART to the VIN on the voltage regulator

And then solder the VOUT from the regulator to the 3.3v in on the ESP base
 

Attachments

  • 20210121_215626.jpg
    20210121_215626.jpg
    53.1 KB · Views: 50
  • 20210121_215637.jpg
    20210121_215637.jpg
    87.2 KB · Views: 50
I solder the ground wire from the UART to the GND pin on the voltage regulator (and lay the GND jumper down onto to the GND pin and solder them both).

Then solder the RX from the ESP base to the TX on the UART connector.

EDIT: At this point you should defintely power this up without the ESP chip to make sure everything works like it should. Check that 3.3v and GND work on the ESP base, and check continuity on the TX/RX pins from the ESP base to the UART connector.
 

Attachments

  • 20210121_220841.jpg
    20210121_220841.jpg
    63.6 KB · Views: 52
  • 20210121_220846.jpg
    20210121_220846.jpg
    67.7 KB · Views: 49
Last edited:
At this point you can program the ESP-01 with ESP link.

Put your ESP-01 onto the programmer and set the switch to programming mode.

Grab esptool to write the image (linux or windows)


Then I use this command to write the attached image of esp-link:

python esptool.py -b 115200 --port /dev/ttyUSB0 write_flash 0x000000 esp-link-3.0.14.bin

For windows, substitute /dev/ttyUSB0 with the COM port of the USB programmer
 

Attachments

  • esp-link-3.0.14.zip
    289.2 KB · Views: 109
Last edited:
pull the programmer out of the USB, set the switch and put it back in the USB port.

At this point the the ESP-01 should be broadcasting as a Wi-FI AP (the number changes per mac of the device)

1611290261593.png

Attach to the network then bring up a web page for 192.168.4.1. It should bring up the initial configuration page:

1611290393243.png

At this point, I usually set the name (click on the esp-link name), then set Conn LED to disabled, and Serial LED to gpio2/TX1.

Next, go to WiFiStation and switch to AP+STA mode. It will scan available WiFi networks and let you choose one. Enter a password and connect. If sucessfull, it will tell you what your new IP address (if you have DHCP enabled - if not look at the bottom of the screen for entering a static IP).

You'll need to connect to the new IP in your network to continue.

After that, go to ucConsole and change the baud rate to 9600

1611290713474.png

Lastly, select Debug log on the left and select "off"

You are now ready to connect your new wifi module to your bms.

Take one of the uart cables and plug it into the uart port of the JBD BMS:
 

Attachments

  • jbdwifi.jpg
    jbdwifi.jpg
    109.7 KB · Views: 191
It should start pinging at the IP address it had before (or the static ip you set).

If on Linux, you can now connect to it using my jbdtool:


OR if you're on windows, you can use HW Virtual Serial port from the hw-group


Use the IP address of the ESP and port 23.

1611291011763.png

Once connected, you can use the windows version of JBDTools to connect to it ... Simply select the same COM port you used in HW VSP and click start. All functions should work great - all using WiFI

1611291216836.png


Any questions just message me
 
If I ever get some free time, I'll draw up JLPCB plans and 3D printer drawings for a case.

Also, I plan on making a custom firmware module for these
 
Amazing! ? ? Much merits for sharing your build!

May I ask which bms model you bought exactly? Is your WiFi module compatible with every jbd bms? 4s 8s 16s...
 
My model is:

SP15S008C-P14S-100A

Yes, it should work with every JBD BMS

Also, while it may appear I spent a lot of $ on materials, I have 14 total packs (and 14 BMSs), so each module came out to just under $8 each (I made a few extra)

Also, I just uploaded to github a new project which takes the JBD cell data and sends a JSON message to a MQTT broker - basically turning the BMS into a IoT device. The program can run in the background and be set to update every X seconds. Keep in mind I just wrote it last night so, while it works, its still a work in progress ;)



My vision for the wifi module is to be able to do everything within the wifi module (monitor via a webpage, set params via webpage, etc) and it will send mqtt data to a broker. I started some preliminary work on it, but that part is going to take a while, as it's a new firmware image for the ESP01. Right now jbdtool/jbdmqtt fills that gap of setting params and monitoring
 
Last edited:
melkier, thank you for sharing this project.

planning a 3x JBD parallel setup and the information and code in this thread is invaluable. thank you for sharing your firmware.

this might sound weird, but realizing you wrote a wireless UART-to-JSON-to-MQTT setup seems very elegant and joyful to see

i have no input, other than to say thanks and wow what a cool project.
 
Carbon, thanks so much for the kind words. If you decide to do this, let me know and I'll help in any way I can. After using Wi-FI vs bluetooth, I would never go back to the bluetooth option. I have a program which collects info from my BMSs every 30 seconds and bluetooth was always a problem. Using WiFI the collection has been running uninterrupted for weeks.

By the way, using UART => JSON => MQTT => Node-RED => InfluxDB => Grafana
 
Having 4 of these BMS's I just purchased all the parts to try my skills, I am not an engineer but i will try my best to DIY it. Do you have a diagram of the soldering?
This is amazing dedication to the community, thank you
 
OK So here's a very simple diagram I did while eating lunch

1611598085391.png

Bottom view, UART connector on top, ESP connector in middle, voltage regulator on bottom. Note the EN pin is unconnected.
 
OK So here's a very simple diagram I did while eating lunch

View attachment 34553

Bottom view, UART connector on top, ESP connector in middle, voltage regulator on bottom. Note the EN pin is unconnected.
Thank you very much. As soon as I receive (should have it be this weekend) the parts I will start putting it together and report back.
 
cool ... just message me if you have any issues ... btw is your name from thorium in WoW?
 
LOL haha I knew it... I also spent many an hour mining on my warrior blacksmith!

Incidentally, my forum name is the name of my UD mage in classic
 
Last edited:
Back
Top