diy solar

diy solar

Finally found a LiFePO4 BMS with Low-temp Charging Protection

Yup, I found you basically have to use a 32U4/Pro Micro. I could not and still cannot get any other microprocessor to work with it. I have never come across anyone else who was able to, even though it should work by the looks of things. But, looks can be deceiving... :p

Once I get my 2x 150A BMS I'll check the UART voltages again and confirm if they're 3.3V or 5V.

Anyways, the Arduino-powered control panel is coming along nicely!

View attachment 51012
nice
 

I've been messing around with an Arduinos and the UART serial from the BMS. After a lot of trial and error, I found that the BMS simply cannot be used with Arduinos which do not support hardware Serial1. Software.serial does not work. However, if you use an Arduino with an ATMega32U4 - I chose a Pro-Mini/Leonardo clone like this you will be able to connect no problem!

It's very simple; TX or T as marked on the BMS, connects to RX on the Arduino. RX or R on the BMS, connects to TX on the Arduino. Ground from the BMS connects to Ground on the Arduino. Supply the Arduino with 5V (note that the UART VCC from the BMS is 12V!!!) then wire up your 128x64 OLED, and you're good to go!

This is the first coding project I've ever shared with anyone; I only got into coding a few months ago and am learning... :)

View attachment 44643
I'm struggling again! I managed to get the Arduino Pro Micro reading from the BMS and printing to the serial monitor.
Now I've written my code to log to SD card and show a very basic display to and OLED I've run out of Flash (program) memory.
My Arduino experiments have used nodeMCU recently and I've just realised I've been spoilt with 4MB flash memory instead of the 32kB the Arduino have.
Also - i managed to wrench the USB socket off the Arduino accidentally (quite easily )so waiting for another one now....
I would really like to get this working with the nodeMCU. The approach in the article below doesn't work?

 
I'm struggling again! I managed to get the Arduino Pro Micro reading from the BMS and printing to the serial monitor.
Now I've written my code to log to SD card and show a very basic display to and OLED I've run out of Flash (program) memory.
My Arduino experiments have used nodeMCU recently and I've just realised I've been spoilt with 4MB flash memory instead of the 32kB the Arduino have.
Check out the Teensy microcontrollers. Ardunio-compatible but with more storage and data pins.
The Teensy LC has 27 data pins and 64KB storage. The 3.2 has 34 pins and 256KB.

I've been using them and been happy.
 
Check out the Teensy microcontrollers. Ardunio-compatible but with more storage and data pins.
The Teensy LC has 27 data pins and 64KB storage. The 3.2 has 34 pins and 256KB.

I've been using them and been happy.
do they work in the above application? using 2 serial interfaces? I'd rather use a $4 nodemcu with 4MB memory than these for $20
 
do they work in the above application? using 2 serial interfaces? I'd rather use a $4 nodemcu with 4MB memory than these for $20
I think that's pretty uncharted territory. For whatever reason, the JBD BMS only communicates via serial with the Pro Micro despite the Nano also being capable of that on paper. It's worth a shot though. The pro Micro isn't my favourite Arduino for a number of reasons so it'd be nice to have a proven alternative.

To get around your memory issue, could you have it only log the essentials? A certain fault state or FET state, the time, and leave it at that? I'm not sure how much that'd help reduce program memory, but every bit helps - I'm often running at 95% used... :p I don't suppose you're using any non-standard fonts? I did with my display because I had the space to do so, but if you're using my code I'd remove that. The chunky standard text looks OK too :)
 
I think that's pretty uncharted territory. For whatever reason, the JBD BMS only communicates via serial with the Pro Micro despite the Nano also being capable of that on paper. It's worth a shot though. The pro Micro isn't my favourite Arduino for a number of reasons so it'd be nice to have a proven alternative.

To get around your memory issue, could you have it only log the essentials? A certain fault state or FET state, the time, and leave it at that? I'm not sure how much that'd help reduce program memory, but every bit helps - I'm often running at 95% used... :p I don't suppose you're using any non-standard fonts? I did with my display because I had the space to do so, but if you're using my code I'd remove that. The chunky standard text looks OK too :)
i've had a go at stripping it back, especially the display part. I'm at 104% but then I worry about the SRAM for the local variables.
 
I've tried again with the nodeMCU. Many compile errors but managed to edit the bms.cpp file to get rid of these. (edited file attached). No idea why they would compile for Atmega processors but not ESP8266.
The program size is now 328k !! Makes me realise how little I know about these things. I can only assume the BMS library is large.
Don't have the hardware with me to hook up and test so will do that when I get home later.

Lines in bms.cpp edited are 313, 357, 478, 504 and 765, 775, 783
 

Attachments

  • bms.cpp - edited - rename before use.txt
    29.4 KB · Views: 2
For the BMS's 3 C- and B- 10awg cables, is it OK practice to shove these into one bigger terminal so it's one terminal touching battery pack or must it be single lug per cable and therefore 3 terminals, 1 BMS balance lead?
 
For the BMS's 3 C- and B- 10awg cables, is it OK practice to shove these into one bigger terminal so it's one terminal touching battery pack or must it be single lug per cable and therefore 3 terminals, 1 BMS balance lead?
You can put them into a single terminal. That is what I did and what has been shown in the past. The blue wires are in a single lug terminal. The black wires are in a joint terminal as I needed to extend my cable a little, for my build.

0608201438a.jpg
 
For the BMS's 3 C- and B- 10awg cables, is it OK practice to shove these into one bigger terminal so it's one terminal touching battery pack or must it be single lug per cable and therefore 3 terminals, 1 BMS balance lead?
I have all 3 10AWG cables in a 4AWG lug or butt connector. Before you crimp them, make sure it flexes the direction you need it to. The position/order of the cables in the connector can make a difference. Put a wire tie around the 3 cables and bend them in the direction you need to run them. You may need to shorten the cable on the inside of the bend/turn. It depends on how sharp of a bend you need.
 
Last edited:
For the BMS's 3 C- and B- 10awg cables, is it OK practice to shove these into one bigger terminal so it's one terminal touching battery pack or must it be single lug per cable and therefore 3 terminals, 1 BMS balance lead?
That's actually an option from overkill. So yeah. Not an issue as long as you can crimp it properly.
 
I have all 3 10AWG cables in a 4AWG lug or butt connector. Before you crimp them, make sure it flexes the direction you need it to. The position/order of the cables in the connector can make a difference.
Can you expand on the "position/order...make a difference"? Is it just that the cables and lug make it really hard to bend or actually cause the BMS to work differently?
 
The position will allow the wires to "curve/bend" in the direction of the connector. I had to get mine positioned right, so it would reach where I needed to without any additional stress on the wires.

Performance of BMS, wire position has no effect, only that it is a tight, good crimp.
 
Can you expand on the "position/order...make a difference"? Is it just that the cables and lug make it really hard to bend or actually cause the BMS to work differently?
Try bundling them together then move the cables around while trying to hold the ends together. You'll figure it out pretty quickly.
 
Can you expand on the "position/order...make a difference"? Is it just that the cables and lug make it really hard to bend or actually cause the BMS to work differently?
^^^^^^ What they said. The length and position around the circle in the lug can change, depending on your layout. It doesn't change the operation of the BMS. The sharper the turn, the more effect it has.
 
You can put them into a single terminal. That is what I did and what has been shown in the past. The blue wires are in a single lug terminal. The black wires are in a joint terminal as I needed to extend my cable a little, for my build.

View attachment 57028
If you look at this picture and pretend you need to make a "hard" right or left turn. Because of the spacing on the BMS, you might need to shorten the inside cable by an inch or so.

The other way would be running the inside cable over the top of the other two, so it has to travel further to the connector. It is the same thing as "equal length" headers on a car engine.
 
Twist the wires together; depending on how much twists per unit of length and the bend radius it can partially to completely alleviate the issue.

That's why wires are often twisted in a harness and why ropes don't have this problem. That's also why strands are twisted inside wires and why wires are twisted inside cables.
 
Back
Top