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 (
and ordered a kit of Amp SuperSeal connectors.
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!

{ 11 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.!


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.


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.

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: