Raspberry Pi robotics specialists PiBorg have turned their attention to the Pi Zero and the possibilities of using it to make very small robots. The result is the ZeroBorg, a diminutive motor controller board that’s only marginally wider than the Zero itself. When mounted to the rear of the Pi Zero, the whole setup (including optional 9V battery) weighs a mere 65g. It’s so lightweight and nifty that PiBorg are using it to control the YetiBorg racing robots in their upcoming Formula Pi series: see this issue’s news section for more details.
The inclusion of four H-bridges means that the ZeroBorg can control four standard DC motors independently. Add some special Mecanum wheels and you can get your robot to scuttle sideways like a crab! Even when using standard wheels, the ZeroBorg offers extra control since the bidirectional PWM (pulse-width modulation) signal sent to each of the four wheels can be varied precisely. Each H-bridge can deliver 2A peak or 1.5A RMS current, so it should work with most small motors. Alternatively, the board can be used to run two four-, five-, or six‑wire stepper motors.
Stacks of fun
One curious aspect of the ZeroBorg is that it’s designed to be connected to a Pi Zero that has an unpopulated GPIO header. Instead, it’s supplied with a small female header to fit to the rear of the Zero, at the 3V3 end of the GPIO header; into this you slot the ZeroBorg’s six pins, two of which connect to SDA and SCL for I2C communication. Now, while it’s possible to do this without soldering the small header to the Pi Zero, and instead simply holding the two units together firmly using the supplied standoff screws, we were unable to get this method to provide a reliable enough connection. Once we’d soldered the header to the Pi Zero, however, everything worked absolutely fine, so we’d strongly advise doing this. Alternatively, if your Zero already has a full GPIO male header attached, you could always use two 3-pin female-to-female connectors to connect it; this method would also enable you to use the ZeroBorg with any other Raspberry Pi model.
It’s important to note that the ZeroBorg comes in three main versions. While the basic KS1 model comes pre-assembled, the KS2 adds a DC/DC regulator and battery clip (supplied loose or pre-soldered) so that the ZeroBorg, motors, and Pi Zero can all be powered by a standard 9V PP3 battery. Alternatively, an external power source such as a battery pack can be attached to two of the ZeroBorg’s terminals, enabling you to mount it flat. The KS2 model also includes an infrared sensor (more on that later) and a second six-pin male I2C header for daisy-chaining with other add-on boards, including the UltraBorg, PicoBorg Reverse, or another ZeroBorg. Indeed, the KS3 option comprises a stack of three ZeroBorgs, the middle of which features two female I2C headers to allow communication between the three boards. While overkill for your average robot, this version could prove particularly useful for animatronics projects or running multiple servos in a CNC machine, for instance. All ZeroBorg models also include two analogue inputs (plus power and ground) for attaching sensors.
Motoring on
We tested a pre-soldered KS2 ZeroBorg for this review, so all we needed to do was solder the female header to the Pi Zero, screw in the standoffs, insert the battery, and we were ready to roll. Well, almost. First, you need to ensure I2C is enabled on the Pi, then install the ZeroBorg software using a single terminal command. It’s then just a matter of wiring up your motors as usual; the terminals are all located on one edge of the ZeroBorg, which isn’t quite as intuitive as on the rival MotoZero, but they’re nice and chunky so they should prove durable. In addition, the ZeroBorg features short circuit prevention to prevent any damage from incorrect connections, along with overheat protection, under-voltage lockout, and a fast-blow 5A fuse.
The ZeroBorg software includes a special Python library, along with numerous examples to get you started. It’s all fairly straightforward: for example, the ZB.SetMotor1(1) command is used to supply maximum speed to motor 1. Use a lower number for less power, zero to stop it, and a negative value to reverse. The examples include joystick control, stepper motor sequence, analogue inputs, and control using an infrared TV remote; if yours isn’t supported by default, it’s easy to record and save the raw IR codes and add them to the main script. We were soon using a TV remote to control our swiftly assembled ‘Tubbybot’, made from a small plastic storage tub to which we strapped four micro metal-gear motors and wheels. While not the fastest off the blocks, Tubbybot was able to do some nifty spin-turns by powering one pair of wheels forwards while reversing the others.
Last word
5/5
While its connection method is a little unorthodox, the ZeroBorg is a mini marvel for motor control. The ability to power both the motors and Pi Zero using a single 9V battery should prove particularly useful when designing small robots, while the daisy-chaining options offer extra flexibility for other possible uses.