Stacking BrickPi


Did I understand correctly that it is possible to stack BrickPies so one could use 6 Motors and 8 Sensors?

And if this is possible, how can the case be extended to cover the 3 floor stack of pies?


It is indeed possible to do this. A caveat: we haven’t done this.

The RPi and the BrickPi communicate over the Serial line. On the BrickPi, there are two Atmega328’s. Each one has an address in EEPROM (0 and 1). This is used in the serial communication between the BrickPi and the RPi.

If you look at the firmware and the drivers, you’ll see that those addresses are used in the python library and C library to address each Pi.

It’s a heavy technical problem that requires some hacking on the firmware.


I looked at the C interface and I think I see the problems. At several places the firmware assumes 4 motors and 4 sensors and cycles through 2 addresses to send to. It might be an idea for firmware $nextversion to insert something like

#define NumberOfBrickPies n

at the beginning and parameterize everything so that one could stack n BrickPies together and code for it.




The firmware already supports assigning a different address (stored in the EEPROM of each AtMega328P).

The electrical hardware should support it, but might require the removal of R3 from one of the BrickPi boards (otherwise the two resistors in parallel might be too strong). The LEDs and sensor port 5 would be in parallel.

The drivers would indeed need to be modified to take advantage of the extra BrickPi(s). I should be able to do so without too much trouble.

BTW, each BrickPi has 4 motor and 4 sensor ports (plus a 5th sensor port that is connected directly to a RPi I2C bus). Using two BrickPis would allow 8 motors and 8 sensors.


Did anyone make any progress on this since 2013? It would be really cool!