Success! Reading smart battery data

Joined
Oct 15, 2015
Messages
1,746
Reaction score
941
Location
Lake Oswego, OR
So I finally had a bit of a breakthrough using an arduino and reading the battery data straight off the battery using the SMBus using the arduino's i2c port. I haven't decoded all parameters yet, but the main things I wanted was the battery manufacture date, the battery serial number (so I can track individual batteries easier) and the number of cycles the battery has been charged.

Here is the data off of 2 of my batteries:

Manufacturer Name: BMTPOW
Device Name: MA03
Chemistry LIon
Design Capacity: 5200
Design Voltage: 14800
Manufacture Date (Y-M-D): 2015-7-8
Serial Number: 6456
Specification Info: 49
Cycle Count: 16
Voltage: 16.51
Full Charge Capacity: 5200
Remaining Capacity: 4514
Relative Charge(%): 87
Absolute Charge(%): 87
Minutes remaining for full charge: -1
Cell 1 Voltage: 4127
Cell 2 Voltage: 4132
Cell 3 Voltage: 4132
Cell 4 Voltage: 4121
State of Health: 18
Battery Mode (BIN): 0b0
Battery Status (BIN): 0b11000000
Charging Current: 4000
Charging Voltage: 16800
Temp: 23.25
Current (mA): 0

Manufacturer Name: BMTPOW
Device Name: MA03
Chemistry LIon
Design Capacity: 5200
Design Voltage: 14800
Manufacture Date (Y-M-D): 2015-7-8
Serial Number: 6113
Specification Info: 49
Cycle Count: 21
Voltage: 16.06
Full Charge Capacity: 5153
Remaining Capacity: 3873
Relative Charge(%): 75
Absolute Charge(%): 74
Minutes remaining for full charge: -1
Cell 1 Voltage: 4013
Cell 2 Voltage: 4015
Cell 3 Voltage: 4015
Cell 4 Voltage: 4014
State of Health: 18
Battery Mode (BIN): 0b0
Battery Status (BIN): 0b11000000
Charging Current: 4000
Charging Voltage: 16800
Temp: 25.65
Current (mA): 0


Anyway, eventually, I want to build a multi-battery charging station that will also automatically track the battery SN as well as the number of charging cycles the battery has gone through to help predict longevity. I have about 10 of the male molex battery connectors on the way, but those are still a few weeks out. Those connectors are custom and not easy to get a hold of in quantities under 1,000 (Molex requires 1,000 minimum order). I wish 3dr went with something more standard - I bet we'd be seeing a lot more after market chargers (any?) if that were the case. If you were building a 4 port battery charger, that means you'd have to be able to sell 250 units in order to use up the 1,000 connectors. I'm not sure if the market is big enough for a 4 battery charger to sell that many to make it feasible.
 
Very nice Steve! That looks like some really useful info is stored in there. Would be great to be able to read that through the app or MP. Would be very useful in determining batt health and use.
 
  • Like
Reactions: Coastwise
Those connectors are custom and not easy to get a hold of in quantities under 1,000 (Molex requires 1,000 minimum order).
It would be nice if 3DR's MFS program offered these in smaller quantities...another blunder in forward motion of the platform.

As an example just here on this forum, you and @SurfnSkate81 have had ideas over the last week that would benefit having access to these connectors on the cheap or smaller quantities.

Nice work on getting the data out of the battery. Your idea has value in application. FWIW, I'd have a need for multiport charger...or just a two port that will access the battery data and log the info.
 
One goal for the charger/arduino to also have a sd card slot, where a profile would be stored for each battery according to it's serial number in a simple text file, or CSV or something. Then that could be easily read by a pc/mac using a text file viewer or excel, etc. That's trivial as I've done that many times with other projects, as well as output the data to a LCD screen or better yet a larger TFT display built into the charger. Can easily have knobs or buttons to scroll through the battery parameters. In the output data above, it doesn't show current discharge rates or the charging state of the battery because it's not hooked up to a charger, but theres a lot more data that can be retrieved than I've shown. I just haven't decoded all of the SMBus specs yet, and they are not all implemented in this battery anyway. Although, it's rare and good that it shows the charge levels of all 4 lipo's in the battery pack. Not all manufacturers implement all specs.
 
This would also work for any upcoming battery packs from 3DR or 3rd party that uses the 3DR battery interface/molex connector.

It could also *potentially* be used to build your own battery packs out of existing battery packs to reuse the chip in the 3dr battery. I haven't messed with it yet, but you can also SET the parameters of the SMBus battery interface on the battery, like if you went to a 6S lipo. From what I can tell, the PX4 firmware (where I got some of the code to decode this stuff) is reading the data from the battery to know what it can do as well as it's current input/output levels (which is coming from the SMBus logic module IN the battery) which means you would need to alter the battery data when changing to a different configuration.

Here is where the PX4 firmware is getting the data from the battery: PX4Firmware/batt_smbus.cpp at master · diydrones/PX4Firmware · GitHub
 
Last edited:
This is great info, it should be in the 3DR logs and visible via a user interface
 
  • Like
Reactions: Coastwise
Great news @PdxSteve I was googling my face off with SMBus.... I took C++ in college but haven't used it since, and im pretty rusty....Im after this as well, alas I dont have an Arduino board...Any where you could point a noobie where to get info on getting setup with I2C? If not dont worry about it.
 
A little update...
I ordered a 2.8" TFT capacitive touch display and hooked it up. Here's what it looks like (preliminary):

full

full


I've ordered an 8 channel i2c multiplexor which arrives later this week. Once I have that, I'll be able to read the data off of 8 batteries simultaneously. The multiplexor is necessary because the batteries all have the same i2c address.

This screen is a touch screen. I haven't messed with that part yet, but I'll use that to change between batteries. Possibly use it to show more extended battery data as well that won't all fit on a single screen. I haven't had much of a chance to play with this yet but it holds a lot of potential. It's also capable of doing graphics, so I can do some graphs and stuff. Yay color!
 
Steve - do you think the Solo will work with any SMBUS compliant battery? If so it may be possible to develop a solution with something like this: Smart Battery Systems (SBS) with SmBus V1.1 support for 7.4V / 11.1V / 14.8V Li-Ion battery packs

We could then plug in any 14.8V high capacity LiPo via this board...

Have you tried connecting your Arduino to the Solo and spoofing a SMBUS battery to see what it does?
Funny, I've actually looked at that page you linked to trying to find info on the bare components to build a charger lol.

It might be (probably) possible to reprogram the current chip as well. No, I haven't tried spoofing the battery, but I'm guessing as long as the SMBus battery implemented the following parameters, which are pretty standard but only a small subset of the spec, then it should work fine:
0x08 ///< temperature register
0x09 ///< voltage register
0x0f ///< predicted remaining battery capacity as a percentage
0x10 ///< capacity when fully charged
0x18 ///< design capacity register
0x19 ///< design voltage register
0x1c ///< serial number register
0x20 ///< manufacturer name
0x23 ///< manufacturer data
0x25 ///< cell voltage register
0x2a ///< current register

I'm saying it's probably possible because those are the only parameters that the pixhawk is querying from the smbus here: PX4Firmware/batt_smbus.cpp at master · diydrones/PX4Firmware · GitHub
 
  • Like
Reactions: Coastwise
0x1c ///< serial number register
0x20 ///< manufacturer name
0x23 ///< manufacturer data

So probably these 3 may be the only ones that matter...

I was looking at a DFRobot current & voltage sensor to code my own SMBUS battery controller, but I may buy one of these to have a play as it is not much dearer.

I am off soon for a 3 week trip flying the Solo and some fixed wing drones so it will have to wait til I get back to experiment. But surely worth while. In Australia we didn't get the luxury of the 2 for 1 battery offer and batteries are $AU250. I have a few 14.8V LiPos that I would love to be able to use with the Solo.
 
A nice UPS man in a cute brown uniform just dropped these off :) 10 Battery molex connectors with the SMBus port ;)
full


full

MAKE US PROUD! One of these days I will play with an Arduino and get this going as well! Please keep us updated on how it goes!
 
I've done some work with i2c on arduino previously on non solo related projects. Do you have your code available to share?
 

New Posts

Members online

No members online now.

Forum statistics

Threads
13,094
Messages
147,748
Members
16,058
Latest member
Gabriela