Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Balboa & Raspberry Pi


I’ve built the Balboa. Easy build with the great instructions and it works perfectly. I fitted a RPi Zero-W and that works great. Wireless is working. Now to get the two to talk.

I looked over the RPiSlave library mentioned in the Balboa manual and of course it doesn’t work. Won’t even compile with the Balance example. But I didn’t expect it to work. It’s written for a different platform.

In order to balance the Balboa needs to use the IMU, obviously, so it’s programmed as a TWI master. But the RPiSlave library is expecting the Balboa to act as a slave. Balboa can’t be both. I’m thinking about it but not sure where to go next. I can reverse the roles, make the RPi the slave and keep the Balboa as master. But then the RPi isn’t the higher authority, it’s a peripheral. Or make the Balboa a slave and have the RPi interface with the IMU and send readings down to the Balboa.

The latter seems to be the better approach. But what about latency, with the Pi being a general purpose computer? I would appreciate anyone’s thoughts on the issue.


Brand new to Pololu by the way!




We’ve been trying to take the second approach you mentioned (“make the Balboa a slave and have the RPi interface with the IMU and send readings down to the Balboa”).

I have an early implementation of some software that does this, but I never got it tuned to actually balance well. In any case, the tuning is going to depend on your choice of Raspberry Pi (with the Zero being a lot lighter than a full-size 3B, for example) and what kind of arms or bumpers you attach to the Balboa (which are especially recommended to protect the Raspberry Pi).

Although it’s not ready for an official release, I just made this version of the software available on GitHub in the “balboa” branch of the pololu-rpi-slave-arduino-library repository, so you could give it a try.

It works similarly to the existing demos for the A-Star and Romi, except you need to run server_balboa.py instead of server.py, and the web interface presents you with a “Calibrate” button that you need to click to calibrate the IMU before the driving controls appear for you to use (including a “Stand up” button). As I mentioned before, you’ll definitely have to adjust the balancing constants; you can do that by editing balance.py.

Please let us know if you have any trouble with the software. If you are successful getting it to work, we’d be interested to see your results!



Thank you! I’ll certainly try it out and let you know.