Introduction: RC Car to RC Tank Conversion With Arduino
I have always been fascinated by big machines, tanks in particular. The German Tiger Tank, as featured in the movie Fury!, is an awesome machine. I wanted one! I did some searching and found that RC Tiger Tank replicas cost over $150, and they do not do 360 degree turret rotation (at that price level). So, I built my own version. I had previously built a tank out of cardboard (video here: https://www.youtube.com/watch?v=6pNfTbsYIGQ, in my youtube channel - see my other videos while there) with wired remote control. That tank was inspired by a combination of ideas from Matthias Wandel's Wooden tank thread vehicle (https://www.youtube.com/watch?v=buuaxdUYNb8) and Eliseo Benavides' work with cardboard gears (https://www.youtube.com/watch?v=QB9xhZntN5Q). My main idea was to build a functional RC tank at a minimum cost. It took a lot of thought, design decision making, debugging hardware and software, trial and error, etc and having fun at the same time. In particular, transferring power to the rotating turret to make it free rotating was, ahem, challenging and inspirational, given my budget constraints. The final product is by all means still a prototype, but I am very proud of it. I learned a lot of lessons from this projects, including Tx/Rx signals, Arduino shield construction, H-bridges, and coding my first C program. Here are the steps.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Main Components.
- Tamiya Tracked Vehicle Chassis kit. This kit comes with one motor only, which I replaced with the twin motors below, to allow tank maneuverability.
- Generic RC toy car.
- Tamiya Twin motor gearbox
- Tamiya Universal gearbox, for the turret.
- Arduino Uno
- Prototype board for Arduino with associated pin headers
- 2 generic laser pointers
- 2 L293D Dual H-bridge ICs
- Miscellaneous electronic components: 5 V regulator, 10 K resistors, SPDT switch, a 1/8" stereo audio plug, wires, jumpers...
But most important: patience and perseverance !
Step 2: The RC Car
The toy car had a LP2P12 Rx chip. The Transmitter I did no even look into, since I (correctly) assumed no modification was necessary. I removed the Rx board and salvaged the rest of the toy car.
Step 3: Car- to Tank-logic Signal Conversion
I came up with the table above and concluded that I was going to need more control signals from the transmitter to be able to control not only tank maneuvering but also turret rotation and two lasers ( one for the machine gun and one for the canon). I realized there were no more available control signals from the Tx/Rx. So, I solved the problem with software, using the Tx control levers in a manner similar to the transport buttons on a music player, where a steady push FFWs the music, and a momentary push selects the next music track. I coded the output signals in the Arduino program as follows:
FWD/REV steady push - moves the tank FWD/REV
FWD momentary push - toggles the cannon laser on/off
REV momentary push - toggles the machine gun laser on/off
LEFT/RIGHT lever steady push - moves the tank FWD LEFT/RIGHT or REV LEFT/RIGHT in combination with a steady push of the FWD/REV lever. Pressing steady LEFT only makes the tank spin LEFT in place. Pressing steady RIGHT only makes the tank spin RIGHT in place.
LEFT momentary push - toggles turret CCW rotation
RIGHT momentary push - toggles turret CW rotation
The code is written so that no other input signal will take any effect after a toggle on signal has been received until the corresponding toggle off signal is received. So, if you momentarily push LEFT, the turret will rotate CCW until you again momentarily push LEFT. While the turret is rotating, sending any other control signal will be ignored. For simplicity.
The program debounces the lever push signals from the Tx by taking a reading, waiting a few milliseconds, and taking a second reading. If the second reading is the same as the first one, the signal is assumed stable and valid, If not, the lever signals are read again. It does introduce a time lag but it is almost not noticeable (to me, anyway).
Here is the Arduino sketch:
Step 4: Testing, Testing...
I first tested the electrical interface between the Rx board, a discreet NPN- and PNP- transistor-based H-bridge, and the twin Tamiya motors, just to see how the transmitter/receiver/motors would respond. They talk nicely to each other !
Then I tested again plugging the Arduino between the receiver and the H-bridge with a basic set of instructions, again, to see how they all work together. Everything looks fine so far.
Step 5: The Arduino Interface Shield
Realizing how cumbersome it is to use discreet transistors to make motor control H-bridges, I decided to use the (now I know) popular L293D Dual H-bridge IC chip. It takes 5 V input signals but outputs (in this case) 9 V signals. I decided to use a 9 battery (later 2 batteries, to provide additional battery power/time) for motor power, and a 5 V regulator for the input Rx signals. Based on the turret motor speed, I decided to power its motor with 5 V instead of 9 V to allow for slower rotation and more precise turret control to aim and fire the cannon. I to tried hard to make the RC tank easy to troubleshoot, modular, and easy to assemble and disassemble. So I made all connections easy to attach/detach using connectors/headers, jumpers, and electrical tape leaving actual soldering as a last option. So I built my first Arduino DIY shield and wired all of the tank's hardware. The Rx board needs a pull-down resistor for each of its control signals. One of the L293Ds (U1 in the schematic) controls the track motors. The other one (U2) controls the turret motor on its left side, and, taking advantage of its configuration capabilities, I used half of the right bridge to control the cannon laser and the other half to control the machine gun laser. I used up all of the Arduino's digital I/O's except Arduino's own Tx/Rx pins 0 and 1 (and the analog inputs). I later found out that the turret motor was still turning too fast, so I added two diodes in each direction to drop the motor voltage from 5 V to about 3.6, I felt that the speed I got at that voltage level was better.
Step 6: Power to the Turret !
To power the cannon laser riding in the rotating turret, I researched how earth moving machines and tanks transmit all that power to their rotating parts. It is of course hydraulic power. I looked at how electrical power is exchanged between rotating wind turbines and their ground based batteries. I also noted that electrical motors transmit power to their rotors with carbon brushes. After several attempts to provide consistent power to the rotating turret, I decided to use a 1/8" stereo male plug as the rotating part, and some metal contacts that I found in a discarded mouse board as the fixed components. I then used hot melt to attach a plastic connector between the turret motor output shaft and the audio plug. This provided me with two control signals from the fixed part of the tank to the turret, since the tip of the audio plug was used on the mechanical connection to the motor so it was not available as a third signal to the turret. Finding how to locate and adjust the pressure between the fixed contacts and the rotating audio plug provided hours of "fun" until I found a consistent configuration.
Step 7: Putting Things Together
The boards were mounted as follows:
- Arduino on top of twin motors
- Arduino shield mounted on Arduino Uno
- Rx board on top of Arduino shield
Step 8: Body Assembly
i built and mounted a cardboard body around the chassis. I tried to make it look like the Tiger tank body, but I could not mount the machine gun on the left side as the Tiger so it ended up on the right side, No biggie. The cardboard body just drops in place for easy removal.
Step 9: The Turret
For the turret, I first tried to mount a laser at the bottom of the cannon tube, but met a lot of alignment problems, so i decided to mount the laser at the end of the cannon tube instead. This created then the challenge that the turret tilted towards the front, due to the laser weight at the far end of the cannon. So i mounted some ballast weight (dead AA batteries) inside the little box in the back of the turret, to balance the cannon weight, It worked out pretty good. I did add some dead weight, though. I wonder if real tanks have something similar to balance the cannon weight.
Step 10: Battle Ready !
So, after many hours of work, frustration followed by success and then frustration again, and generally a lot of fun ans satisfaction to see it work, the RC Conversion Tank is ready, and best of all, it works as planned !. It takes some practice to find the right time needed to make the Arduino differentiate between momentarily pressing the levers and a steady-push. The tank is a bit heavy, but the two batteries provide enough fun time. Overall, the outcome is pretty awesome !!!. I hope you liked it !
Stay tuned for my next project, MIDI-fying a Hammond organ pedalier using an Arduino to generate MIDI signals and make the pedalier sound through an electronic synthesizer. My ultimate goal for this project is to play Bach organ music with home syntesizers.