ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A

SBS (Smart Battery System) SMBus over USB?

Hi all, this isn’t yet ROS-related, but I’m trying to integrate a SBS laptop battery into a ROS-based robot I’m building, and it’s been a difficult road. Wondering if anybody here has had any experience with this and could share their perspective.

I’ve had minor amounts of luck with a few approaches

  • Arduino using Peter Fleury’s i2cmaster library, which let me speak SMBus (Wire library doesn’t format communication correctly for smbus) - but the library seems to not handle the multi-master situation well and freezes up the communications quickly
  • I’ve also tried this little project which also seems to freeze up on me

I’m hoping to discover a fairly “out of the box” solution to reliably retrieve data from the SMBus. The built-in state of charge measurement, and other metrics, is really attractive from these smart batteries. However, I don’t have a lot of experience implementing these protocols on microcontrollers, so it’s fairly daunting to try and get it working reliably.

Once the communication is working, I’m looking forward to making a node to talk to the SMBus communication layer and publish BatteryState messages

For the curious I am currently using the following battery and charger from RRC - they’re a bit pricey but seem really nice

1 Like

Well, in case anybody stumbles across this, I’ve come up with a (Linux-only) solution.

It’s working now to publish sensor_msgs/BatteryState from a Linux i2c device.

I am personally using a CP2112 USB-to-SMBus evaluation board to connect the battery/charger to my main compute, but theoretically most i2c interfaces should do (plus or minus, smbus timing requirements are slightly different so maybe not all).

The plan is to Bloom it to ROS 2 Foxy when that is released. Cheers.