Last time around, we proved that the Raspberry Pi could indeed be integrated into a Heng Long Tiger I RC tank, and so control its functions. That’s a significant achievement, but there’s plenty more to do.
Firstly and most importantly, we can’t yet drive the tank around because the Raspberry Pi is still dependent on a power source, keyboard input and video output – each of which is a cable connecting the tank to a computer. On day nine of the build diary, we cut one of those dependencies, resulting in a Raspberry Pi that is powered from the tank’s internal battery. Compared to previous days, this was a relatively simple matter.
The tank’s power supply comes from a 7.2V NiCd battery. The Pi’s power input is a very strict 5V ±5%, so we sourced a component that could convert one to the other. The Pi’s maximum current draw of around 1A was also a consideration. A cheap voltage regulator such as the ubiquitous LM7805 could do the job, but it would need protective capacitors in parallel with it, and would also give us a heat dissipation problem – the regulator would get rather hot stepping 7.2V down to 5V at 1A, and the plastic body of the tank gives us no convenient heat sinks.
Instead of a regulator, a switching DC/DC converter was chosen, specifically a Recom R-785.0-1.0. This provides exactly the voltage and current output we need, with a higher efficiency so less heat dissipation. The tank’s 7.2V battery is well within its input range, even accounting for possible voltage drops when the battery charge is low.
This component was bought and soldered to a small piece of veroboard, with flying leads to connect to the tank’s power supply (via our choc block) and a hacked-up microUSB cable to connect to the Raspberry Pi. (The USB cable I chose to cut up had the normal red, black, green and white cores as expected, but the black core was just a strain member – full of fluff – whilst the ground line was actually connected to the screen. I’m not sure how common this is, so watch out for it if you are recreating this build.)
Raychem hides many sins.
Once built, this board was tested with a power supply providing the 7.2V and a multimeter checking the 5V output. Once I was happy that the output was clean and at the right voltage, the Raspberry Pi itself was connected and booted up. During the boot process, the current draw on the 7.2A side peaked at 550mA, coming to stabilise at around 250mA once the Pi was idle.
(Warning to anyone recreating this build: Please use a bench power supply at this stage, don’t go straight for the tank’s battery as a power source. Dodgy wiring or soldering could short the battery, leaving you with an exploded mess where your tank once was.)
Once I was sure that the power supply to the Raspberry Pi was working correctly, we then switched out the bench power supply for the tank’s battery. And voila – we now have the tank powering the Pi as well as itself.
With the upper chassis removed, the tank now looks like this:
In case you’ve lost track over the last few days of the build diary, the electrical schematic now looks like this (including the upper chassis):
You can download that as an SVG file here: Raspberry Tank Schematic (Day 9)
Next time on the Raspberry Tank build diary, we will be integrating a WiFi dongle into the tank and enabling SSH on the Raspberry Pi in order to remove the last two cables keeping the tank from roaming freely.