I have an old RC (remote controlled) car lying around, that I got a few years ago. The battery, being Ni-Cd (and not too well treated), is dying so it hasn’t seen much use lately. Earlier in the year, while taking part in Sebastian Thrun’s brilliant Programming a Robotic Car class, I got inspired to build my robot-car. Well, at least a model version.


Where I’m currently at – that RC car controlled via an Arduino.

I saw David Singleton’s Neural-Networks Car, blog.davidsingleton.org/nnrccar, and that’s where I decided to start – converting that old RC car into an Arduino controlled one. The key from David Singleton being, controlling the remote via Arduino rather than directly controlling the car via Arduino (which would probably require some a lot of disassembly of the plastic mold).

After taking apart the plastic shell of the remote, I needed to find how to connect up the Ardiuno. The method I used was:

  1. Find ground (or just use the negative terminal of the battery) and connect one end of a wire there
  2. Look for the switches (forward / back, left / right) on the circuit board
  3. With the car & remote on, begin touching the other end of the wire to parts of the circuit and see what happens

Once you’ve found that connection (you’ll notice that the car begins to move…), that’s (between there and ground) where you’d add the transistor (a transistor is like a tap, with the base being the valve). Setting the Arduino pin (which you connect to the base) to LOW or HIGH then controls whether current can flow through the transistor, in essence, an electronic switch.

After playing around with that for some time, and buying 90cents worth of transistors (the 2N2222A NPN transistor) I was able to get it to work (connecting the Arduino’s ground with the remote’s ground, and having the transistor the right way round, were two things that I learnt in particular).


Image based on Howard Logsdon’s work at wiki.hplogsdon.com/Arduino/. GPL licensed.

Arduino Remote Circuit Diagram
Made with circuitlab.com

Writing the code for the Arduino isn’t too difficult since you only need to turn the pins on (HIGH) or off (LOW), since that’s all that’s needed to make the transistors conduct.

int left = 3;
int right = 5;
int back = 9;
int forward = 11;
void loop() { }
void setup()
{
//set up all the pins as outputs
pinMode(left,OUTPUT);
pinMode(right,OUTPUT);
pinMode(back,OUTPUT);
pinMode(forward,OUTPUT);
//begin driving straight ahead...
digitalWrite(forward, HIGH);
delay(1000); //wait 1.0 seconds
//turn a bit to the left...
digitalWrite(left, HIGH);
delay(500); //wait 0.5 seconds
//turn a bit to the right...
digitalWrite(left, LOW);
digitalWrite(right, HIGH);
delay(500); //wait 0.5 seconds
//drive ahead again...
digitalWrite(left, LOW);
delay(1000); //wait 1.0 seconds
//stop
digitalWrite(forward,LOW);
}


What’s next?

Currently, the Arduino / robocar is explicitly programmed, which is rather boring in comparison to giving it autonomy. So next up, I plan to experiment with using the Kinect’s depth image together with some code from Sebastian Thrun’s class…

My hallway as the Kinect sees it
My hallway (with a box in the way) as the Kinect sees it. Can you see the possibilities?

  • http://www.nitrotek.nl/ rc helicopter

    Malte Ahrens, you have done a great job here to make a robocar from Arduino+remote control. There has been also very cool information given by you. I think that everyone’s mind cannot think of such as you think.

  • http://redtone.com.au/ Matt

    Kinect connected to a tv and then drive the car via hand and body movements. Add a camera that connects to the  TV for useabilty or have the car drive autonomously around the house while you watch from the live feed. or both.

  • http://www.wastepartsuk.co.uk/ Waste Parts UK

    Electric RC cars can come as pre-assembled toys or can be bought in kits. Either way, electric RC cars can cost you so much less than Nitro models.

  • http://www.playmobil123.co.uk/ playmobil 123

    Watch out for toys that have sharp edges, small parts, or sharp points. Avoid toys that produce extremely loud noises that can damage hearing and propelled objects that can injure eyes.

  • http://www.23hq.com/joleen7596bwec/story/13765983 Hortense

    Nice post. I was checking continuously this blog and I’m
    inspired! Extremely useful information specially the ultimate phase :)
    I maintain such information a lot. I was looking for this particular info for a
    very lengthy time. Thanks and best of luck.

  • Al B

    We built a similar project. However, we installed an Android device onto a RC car and used an IOIO board instead to control it autonomously. Here is the preliminary result:

    http://youtu.be/vkvkfcqEUkk

  • HeatfanJohn

    Great example! This is what I need to control a Halloween decoration via an Arduino and a motion sensor. One question, you appear to have the collector of the transistor connected to ground instead of the emitter. Is that correct?

blog comments powered by Disqus