Lithium Battery Communications

by Ben N on August 26, 2019

I just got my laptop to communicate with the Valence lithium batteries in the Ford Ranger EV pickup truck!

The truck’s instrumentation is pretty basic – just a “Miles to Go” and “Percent Charged” meter, which were designed to work with lead-acid batteries. I wanted to be able to communicate directly with the lithium batteries to make sure they were balanced and that I was getting the full state-of-charge and other information from them.

Data Connections of the Valence lithium batteries

These Valence U27-12XP batteries (specs here) contain an internal BMS and communications system. Each battery has a male and female 5-pin Tyco Amp connector on it. Those cables are daisy-chained together and connected to a BMS interface device. Normally, that device would communicate to the batteries and then connect to the vehicle to do things such as sending a CAN signal to the battery charger to turn it off when the batteries are charged.

Home-made RS-485 to USB adapter

By instead plugging in my laptop, I should be able to read data from the batteries. To do so, I got a generic RS-485 to USB adapter (https://amzn.to/2zn3S6s)
and ordered a kit of Amp SuperSeal connectors.
(https://amzn.to/2Hr3zM8)
I simply cut four short sections of 18 gauge wire and connected them between the plug and the UBS adapter. The 5V power is on the outside two pins (pin 2 & 5 on the Amp connector) and the communication signal is on the inside two pins. Pin 1 on the Amp connector is for shield and I left it unused.

The battery communication string had a terminator on the far end (from the original Smith truck battery pack.) I pulled it off and measured it. It read as a 120Ω resistor. However, I found out later that it didn’t seem to make a difference whether or not the resistor terminated the string. Here’s an article on why that it.

The software for the Valence batteries is Windows only. I have a Mac laptop, so I had to do a little work to get Windows running on it. I used Virtual Box to run a trial version of Windows 10. There are other ways to run Windows on a Mac as well, but this was free and pretty straight-forward to use. Of course, if you have a PC laptop, you can just skip this.

The main challenge was just to make sure the correct drivers were installed and permissions were granted. I had an issue at first with the USB adapter. A friend gave it to me (thanks, Eric!) but I didn’t have any documentation and Windows 7 didn’t recognize it. It ran fine on Windows 10 and identified using an FTDI chip driver. To prevent errors when the Valence software is running, permissions must be manually changed on the root folder of the software to full Administrator permissions.

At this point, I was finally able to use the software! My adapter was plugged in to the computer with RS-485 cable going to the most positive end of the battery pack, with the rest of the batteries daisy-chained together. In the Valence software, one last quirk was that there were NO COM PORTS listed in the drop-down box for which communications port to connect to. In my settings and drivers, it looked like the USB adapter associated with COM3. I had to manually type “COM3” into the drop-down and hit enter. NOW it connected! After closing and reopening the software, COM3 would stay as the selected port.

The Valence software lets the user view information about each individual battery, such as cell block voltages, state of charge, current in or out of the battery, and temperature. Users can also rename the IDs of each battery.

When I first connected, the software only connected to 24 instead of the full 26 batteries. The reason why is that two of the batteries had repeated ID numbers. I located a battery, renamed it from ID3 to ID25, and then got 25 of the 26 batteries to show up. I did the same thing for the last battery, (#4 to #26) but then the original #4 wouldn’t show up. Why? I have no idea. I did the exact same thing as the first battery with an ID change. Oh well, I’m sure I’ll figure it out…

While it’s very interesting to be able to get the data from the batteries, it’s NOT terribly useful while they are just sitting there. What WOULD be useful is seeing the detailed battery data while CHARGING and DISCHARGING. In other words, WHILE DRIVING! I have an extension cable that should reach from the back of the truck up to the passenger seat. I can put the laptop in the cab and connect to the batteries while driving. I’ll have to keep my eyes on the road, so I really won’t be able to watch the battery data as I do it. Fortunately, the software also includes a logging feature. I should be able to log the data as I go. I’ll just want to shoot some video so I can sync the data to what’s going on in the real world – accelerating, braking, going up or down that really big hill.

That’s it for now. I’ll need to play with the software a little more and get set up for doing a test drive while logging data.

Until next time, stay charged up!
-Ben

{ 25 comments… read them below or add one }

1 Richard Bruner August 28, 2019 at 4:13 pm

Have you done anything with the battery communication with batteries in parallel? I looked at the page in the manual as you suggested. If I’m reading it correctly you parallel the negative RS485 and read on just one positive RS485? I would have to fabricate jumpers between the four negative cables. Do you think I would also have to parallel the positive data cables, the diagram doesn’t look like it.

2 Chris.m September 1, 2019 at 9:49 pm

Your ranger is really awesome and your new lithium battery pack is the perfect compliment for it. Since the batteries communicate with each other over a can bus you really should use the termination resistors which are are needed to suppress signal reflections as well as return the bus to its recessive or idle state.

3 Greg September 11, 2019 at 8:34 pm

Richard – Nothing special has to happen, you just hook all communication cables up together. We have 4Sx4P so effectively 4 banks of 48V (~53v). We have all 16 battery communications hooked up together and are able to read all of them in the same way Ben explains it above. We are monitoring a bank for solar backup/charging from our MPPT controller. We have even automated the capture every 10 minutes and graph it in grafana/mysql.

4 DL September 12, 2019 at 9:51 am

this is awesome. i hope to pick up some second hand Valence batts soon. and this will be a way to “demystify” what’s happening inside the black box. Er…..uh….Green boxes.!

Thx

5 Ethan Turner September 13, 2019 at 3:04 am

Hey Ben, thanks for the very informative blog post and video. I’m about to purchase 8 Valence U27-12XP batteries for a 24V setup (2x series in 4 parallel strings) on my expedition truck. I will definitely follow in your footsteps to ensure good battery health. I’m also wondering if I can daisy chain the data cables on all 8 batteries in my series parallel configuration or if I can only data link the series pairs?

Thank you!

6 admin September 13, 2019 at 8:42 am

Another YouTube viewer said that he had Valence batteries in a series/parallel configuration and that the data link did just fine seeing ALL the batteries.

7 brassmonkey001 September 18, 2019 at 5:21 pm

Thanks Ben, I’ve just managed to get mine communicating after a few hours of head scratching! I couldn’t have done it without you!

8 Richard Bruner September 20, 2019 at 9:03 am

Thanks for the awesome video. I got everything working. For reading in parallel, I had to read each battery individually to see which module it is. Then I was able to chain them all together to read each one. I then changed Ids to match my setup ie: 1-4.
When using the log, how do you separate the comma delineated CSV file so that the headings match the data?

9 Donnie Brewer November 3, 2019 at 11:39 am

Thanks for this post!! I am still attempting to connect my laptop, can you tell me what baud rate COM3 is running on your Windows 10 setup?

Mine is setup to the default of 9600 in Device Manager.

Thanks!!

10 Donnie Brewer November 3, 2019 at 12:05 pm

Nevermind, found the issue. I would get an error when I would click “Start Read” – the error said to check the COM port or Module number. I immediately thought of a baud rate error, but all I had to do was click on “Locate Battery”. This option will tell you the module ID of the single battery you’re connected to, and the application would automagically set the Module ID for you and then you can click the “Start Read”. My module IDs showed as 10 and 16 for my two batteries. After clicking “Stop Read”, I selected a new Module ID under “Change Module ID” and clicked on the “Change ID” button. It asked if I wanted to change Module ID 16 to Module ID 1, which I clicked the affirmative. Bam! Module ID 1. I did the same for the second battery but chose Module ID 2.

Pretty slick!!

A quick question for you, I was thinking of making the software available on my personal website. Do you think Valence would have any issues with that?

Again, thank you for sharing this!

11 Rick Lambert November 15, 2019 at 2:00 pm

So none of this covers using a BMS to communicate and maintain balancing or protection. Is there a related article on doing any of this?

Thanks in advance folks.

12 Thomas January 14, 2020 at 10:45 pm

Thank you so much. Your a life saver!!
In playing around with the logging, is there a way to log data from all of the batteries simultaneously? The log looks like it only logs one battery at a time. Any thoughts?

13 admin January 15, 2020 at 10:06 am

That’s what it looks like to me, too. I didn’t see any obvious way to log all batteries at once.

14 Travis Sanders January 20, 2020 at 3:42 pm

Glad I found you guys. Where do I get the software and what is it called? I ordered the connector using the link here and already have the rs-485 adapter for my old inverter I can use. I bought 240kwh that’s 150 u27-xp like the ones in his videos and anxiously waiting to find their condition when they arrive.

15 admin January 20, 2020 at 4:14 pm

Hi Travis, I sent you a link to the software.
What are you doing with 150 batteries?!! Sounds like a massive project, whatever you are doing! We always love to learn more about the projects people are up to. Let us know more about it when you can!
-Ben Nelson

16 Travis Sanders January 20, 2020 at 5:01 pm

What kind of project am I doing? The get in over your head kind. I invested a lot of money for unknown quality. I really won’t know their condition until they arrive from their thousand plus mile journey across the ocean. Basically my family of 4 lives in off grid cabin in the jungle in Hawaii. 7kw solar. I’m so tired of lead acid batteries. Flooded, AGM’s nano this, carbon that what a bunch of garbage.

17 Travis Sanders January 20, 2020 at 5:09 pm

One thing I noticed is that when you’re hooking a lot in series which I might do Valence says they’re additional BMS that balances one 12 volt battery to the other is required. I see there’s 7kw all-in-one off grid capable grid tie inverter charge controllers that utilize 450 volt batteries for dirt cheap. I’m wondering if anyone here knows how these bms’s actually work? I’d rather not fully charge the batteries because the higher percentage charge deteriorates lithium batteries faster. And the internal cell balancers apparently don’t activate until full charge because it’s a top balancing design. But I’m not absolutely positive there seems to be a lot of mystery going on in this green battery. So how would the additional BMS function? Would it communicate with the battery and somehow turn on the resistors on the u27 that was higher voltage? Or does it actually pass power through itself back and forth from high batteries to low batteries?

18 admin January 20, 2020 at 5:25 pm

On that Valence system, the BMS is inside the battery itself and takes care of balancing between the 4 series sets of cells inside. There’s also temperature sensors and some other components as part of it.
The external BMS box communicates between multiple batteries and pulls data from all of them. It allows current to either bypass or burn-off (resistors) one or more batteries in series. That external box also does things like turn off a charger if one of the batteries it too high, or disconnect the motor if one is too low.
With a big series string of batteries, you want some sort of controls for those batteries.
Here’s a new BMS that’s especially for the Valence cells, and supports a pretty good range of voltages. You might need two of them if you go high voltage.
High voltage is great in that it matches up with solar systems, so there are starting to be some good inverters out there for it, and high voltage means LOW current, also a good thing.

Check out this BMS: https://www.mullerindustriesusa.com/product/miusa-bmslv-battery-management-system/

19 Travis Sanders January 20, 2020 at 5:56 pm

So the external BMS can command the u27’s to bypass power through it? I’ve seen there’s mosfets inside so I guess it could be capable of that which is pretty cool. I read the link about the third party version. I guess it’s sort of the same thing but they go into a better description about its capabilities than Valence does and I think I’m assembling a picture in my mind of how this stuff actually works. but what about the internal cell balancing? Am I really going to have to fully charge my batteries in order to balance the cells? It’s going to take me six months to charge this battery Bank because I’m already using most of the power I get from the panels.
High voltage is awesome but for the DIY I’m afraid there will be some charcoaled people out there.

20 John E Gibson February 10, 2020 at 5:47 pm

Hello, silly question but where did you find your short battery connection cables with the overmold. I have been trying to locate just such a jumper for some time to avoid hand making all I need. Many Thanks.

21 admin February 12, 2020 at 12:15 pm

The power cables that I used with these Valence batteries were the ones from inside the Smith Electric Truck battery packs.
I did NOT make them, nor mail-order them. I simply reused what was already with these salvaged batteries.

22 ben March 1, 2020 at 1:12 pm

Has anyone had success with the muller industries bms? I really like this video but it would be great if there was a manner to set charging profiles for a solar system. I am using 8 valence u27s in 4s2p configuration with an all in one charge controllor and inverter from MPP solar.

23 Ben N. March 1, 2020 at 2:25 pm

I’ve contacted Muller Industries, and I’m hoping to get one of their BMS for setting up a 48V solar battery system. When I do, I’ll shoot some videos on it.

24 Ian Keegan March 13, 2020 at 1:36 am

Thanks for all the info! Btw where can i get those tyco amp extension cables? I’ve looked everywhere!

25 admin March 14, 2020 at 1:42 pm

I got those cables by taking apart an entire Smith truck battery pack.
You might just want to make your own. All you need are the end connectors. Put a male on one end and a female on the other.
https://amzn.to/39Qq2i5

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Previous post:

Next post: