It’s well known that robots crave power. In this case, however, we’re talking about electricity rather than world domination (whether your robot craves world domination is between you and the robot, but in any case it’ll need electricity to get anywhere). This post is a quick overview of how I’ve powered my PiWars robots – there may be other options, but this is a set of parts and connections that will definitely work!
These are the parts I’ve used, I make no claims that these are the absolute best options but they have been tested and found to be effective in a couple of PiWars robots. You may be able to find better or cheaper options!
If you buy two batteries, and exclude shipping costs, this comes to around £85. It seems like a lot, and it’ll bump the cost of your robot build up considerably, but a lot of that cost is in parts you’ll re-use like the charger and the batteries themselves. You’ll also save yourself a lot of grief – many issues in previous competitions have turned out to be due to insufficient power to the Raspberry Pi, especially when suddenly having to operate in a very noisy environment in terms of RF (we think it pushes up the bluetooth and wifi transmit power to cope!).
Firstly you’ll need a battery. You have a few choices here, and your selection will have a significant effect on everything else so pick carefully!
You can power your robot from any of these options. The first two are the simplest, they use batteries you can buy in your local supermarket and the NiMH cells can be charged using any regular battery charger (typically you can buy the charger and a pack of four AA cells together). The maximum current from both these options, however, is quite low. If you’re running a chassis like the PiBorg one you’ve got four motors that can easily draw a couple of amps each; this will run down packs of AA batteries in short order. It’ll work, but you’ll spend a lot of time charging and the size and weight of the number of batteries needed might be a problem. That said, this is far and away the simplest option!
My robots use LiPo batteries. They’re able to provide a lot of current, have high voltages relative to packs of AA batteries for the same size, and are available in a wide range of physical sizes.
Having decided to use LiPo batteries, your first problem is selecting one. They’re available in a wide variety of capacities, voltages and physical sizes and some of the terminology around them is a little obscure. Here are three of the ones I’ve used:
They’re all LiPo packs, but they’re not equivalent! The properties you care about are written on the sides, and are:
The other important property is how big the battery is! You’re going to have to fit it in your robot, and PiWars robots are not very big. The top battery in the image was used for my PiWars 2 robot, but for the last event I ended up using the much smaller batteries below it – there simply wasn’t any way to fit the bigger pack into the chassis, and the smaller batteries have more than enough power.
When choosing a voltage it’s worth mentioning that motors can typically be supplied with about 20% higher than rated voltage with no issues. So, if you have 12v brushed motors on your robot (a reasonably common choice) you can quite happily run them from a 4S pack at 14.8v, it’s probably better to do that than run them slightly under their rated voltage from the 3S pack at 11.1v. Faster motors are happier motors!
In the list above I mentioned ‘special gear and handling’ required for these batteries. LiPo batteries are great because they have a very high energy density (the amount of energy in a physical volume) and because you can release that energy very quickly (the battery can supply a very high current). The flip side to these benefits is that, if treated badly, these batteries may damage either themselves, your robot, or you! A battery that can supply a 100A current is obviously more dangers to short-circuit than one that can only supply 2A. These batteries get unhappy if you…
This might all sound scary, but really LiPo batteries are easy enough to use and the advantages outweigh the potential downsides. Treat them with a degree of respect and they’re perfectly safe to use.
Safety issues aside, LiPo batteries are both more complex, and more expensive, than other options. Complex because you need a special charger to handle them and because you need to monitor each individual cell (batteries are formed from multiple cells) to prevent over-discharge, and expensive because not only are the batteries themselves relatively expensive, but because you need all this extra stuff! Specifically, you’ll need to get:
Now you’ve got a battery or two and all the bits required to support them, you need to integrate it into your design. There are two things you need to consider here:
To handle the electrical design you need something that can provide a clean, stable, 5v feed from your much higher battery voltage. Because this is powering a Raspberry Pi and any other electronics you’ll have (such as the low power side of motor drivers, all your flashing lights, bluetooth and other radios, HATs on the Pi) it’ll need to be able to deliver a reasonable current. What you need here is a UBEC, or Universal Battery Eliminator Circuit. These are switch-mode power supplies, typically built for drones or RC vehicles to power their electronics, and so are perfect for our purposes. They come in a range of voltages and current capacities – when choosing one you want to be well within the rated current of the UBEC, so while 3A sounds like it should be plenty to power the Pi, it’s really not worth messing around. Go for this one!
This claims to be rated for 20 Amps. I don’t really believe this, but it’s much much higher than we need which means we’ll be working well within its limits. The output voltage is switchable, so select the 5v (really 5.2v when measured, which is fine), connect the heavy wires to your battery with an appropriate connector and the light wires will provide a clean, stable, power supply for all your electronics.
To make your life easier, and diagnose common errors with voltage levels, I recommend picking up a bag of these tiny little voltmeters. They’re self-powered, reasonably accurate, and add more blinking lights to your robot, so it’s really a win all-round. It’s always reassuring to know that voltages are what you think they are!
Your LiPo doesn’t like being dented, and it really doesn’t like being punctured. Keep it happy, and your robot not on fire, by mounting it properly! You’ll also want to be able to swap it out easily during the event so you’re always running with a nicely charged battery, so it needs to be accessible. The one surface of your robot which won’t get hit by anything is the top, so it makes sense to access the battery from above if possible and to protect it from impact and other sources of aggravation from all other sides. This is going to depend on your robot’s chassis; my solutions are shown below:
Viridia’s battery drops into a rectangular hole formed in several laser-cut pieces of acrylic. It’s protected underneath by a solid acrylic plate, and held in place using a couple of hair bands. These put enough pressure on the battery to prevent it being bounced out but not so much they’re actually deforming it. The battery can be removed easily from above without having to undo anything, the discharge and balance connectors are accessible at the top of the pack (you can see the robot end, not connected, of the main battery cable just to the left of the battery in this image).
Triangula’s battery is supported by an acrylic plate below, and pulled into one of the aluminium main struts using a velcro cable tie. This isn’t perfect, as the battery can slide sideways into the backs of the motors, but in reality this never really happened. The cable tie has enough pressure to hold the battery securely, and it’s easy to remove for charging. In both cases the battery is held within the ‘crash structure’ of the robot and protected from external impacts.