A step by step instructable on how to take any R/C car and control it with your computer

Step 1: Overview

my friend leslie got me a radio controlled rat, so I decided to make a computer interface for it (because I'm a huge dork)
This instructable shows how to hack up an R/C car and connect it to your computer. I made a web interface for mine so that my mom could drive a little car around my room from north carolina (I'm in boston), using a webcam to watch it.
This is pretty fun project, takes about an hour to solder up, and if you can make toys computer controlled, you'll uh.....have lots of friends
Also, I'm writing an instructable on using an R/C car to make a digital radio link. Stay tuned, amigos.

Step 2: Get the Parts Together

so, this is what you need:
an old R/C car and its transmitter--this current version might work for transmitters with digital proportional control, but it's designed for transmitters that just have on/off buttons
a proto board--I really like the radio shack PCB boards that are basically breadboards, except pcbs.
an atmega48--smaller processors will work, too, but I have tons of these around, they cost $1.65, and the code I wrote is guaranteed to work for them
a max232 chip (or a max233, if you're rich, lazy, and classy)
a female DB9 connector (with soldertails)
4 1uF capacitors(for the max232 chip)
a 7805 voltage regulator
as many 2N2222 transistors as you have buttons on your transmitter (I had 6)
a 1K resistor for each transistor

Step 3: Get Some Tunes

everything is better with music. Take some time and rock out. I'm listening to Vitalic's OK Cowboy album right now, and it's really good. If you're into variety, grab one of my mixes at http://www.artiswrong.com/alex/mix

Step 4: Start Actually Doing Things

OK, let's get down to brass tacks (how much for the ape?) (anybody get that reference? somebody? please????)

open up the transmitter. It probably looks like the picture below. Be careful with the battery wires--they can pull out really easily on some transmitters, and then it's hard to figure out where they went. You might as well just mark where they are now, and then you can fuggetaboutit. Same goes for the antenna wire, if the antenna's not soldered directly to the board.
Now, find the buttons on the remote that make the car do stuff. Give the transmitter power, and using a multimeter, find out which end of the button is at a high voltage and which end is at ground. Remember this.

oh yeah--a note on the buttons. They tend to be DPST buttons, since those are sturdy if you solder them, but they're used like SPST buttons, meaning that when you press the button, all it does is connect one wire to one other wire. Since each button has 4 wires, you'll need to figure out which ones are actually used. Use the multimeter, luke

Step 5: Solder on the Transistors

OK, remember how you just figured out which of the button's leads had a high voltage on them and which were at ground? Cool.
Now we're going to solder transistors to the buttons so that we can control the current flow from another circuit. And by 'we', I mean you. I already did it. That's where all these pretty pictures came from
OK, so you'll want to solder the collector lead of your transistor to the high voltage pin of the button, and the emitter lead to the ground pin of the button. Bend the base lead out of the way, so that you can get to it later. Do this for each button.

Step 6: Build Some More Stuff

So, now you want to build the circuit from the schematic below. The transistors at the bottom are the ones you just soldered onto the transmitter. And oh yeah--THIS IS IMPORTANT! Don't forget to put your microcontroller in an IC socket. Otherwise you'll be very sad when you want to program it. For now, don't worry about where the VCC for your 7805 is coming from (this will be the 9V we use to power the transmitter).
Feel free to put on a power LED, too. Doing that always gives me a warm feeling inside

Step 7: Connect Your Board to the Transmitter

OK, so now, solder the 1K resistors onto the base leads of each transistor on you transmitter. Now, solder wires from each of the resistors to the PB0-PB5 lines of your microcontroller. (Remember that my transmitter had 6 buttons, so if yours doesn't have that many, don't feel bad.)
Connect the positive battery(probably red) wire from the transmitter to the 7805's VCC pin on your board. Connect the ground wire to ground on your board.
And now's probably a good time to wire up the serial DB-9 connector to your board. Connect the PC_TX line to pin 2 of the DB9 connector, the PC_RX line to pin3, and the GND line to pin 5. There are tiny little numbers on the solder side of the DB-9 connector that should give you an idea of what I'm talking about. If you don't see them, look up DB-9 pinout in google, and that oughta help

Step 8: Program the Microcontroller

OK, now you want to flash the micro with some code to let it talk to your computer. If you have an AVR burner, burn cujo.hex onto the micro. The code is in cujo.c, if you're interested. If you want to use the makefile, just get rid of the .ale extension--instructables doesn't let up upload extensionless files

If you really want to make this, but you don't have an AVR burner, email me at enjrolas@mit.edu and I'll send you a burned micro if you send me like $5. I might also make a kit for this, with a printed circuit board and all the parts you need (including a cheap R/C car), if enough people are interested

Step 9: Hook It Up to Your Computer

Plug your computer's serial cable into the board you just made. Give the board 9V and ground, and run the program radio that's listed below (remove the .run extension--again, instructables with that no-extensionless-uploads thing)
It's compiled for a linux machine. This code will only work on linux machines, I think. The source is in radio.c, also listed below.
The code I wrote uses the numpad to control the car. Be sure that num lock is on. Also, ESC closes the program.

If you want to write your own code, either because you have a PC/mac or just feel sexy, the details are:
the chip talks 4800 baud 8N1 serial.
the program is very simple--it will just spit out whatever number you send it on portB. If you send it '1', it will turn on button 1. '2' will turn on button 2. '4' will turn on button 3, etc.
email me at enjrolas@mit.edu if you have questions

Step 10: Done! (at Last)

cool. You're done. With any luck, you should be able to drive your car around with your computer. If you think this instructable is cool, but it seems like to much hacking, or you don't have all the parts, I could put together a kit. Email enjrolas@mit.edu if you're interested.

I hope you enjoy it.
By the way, you should be able to drive my car around(in my room) and watch it on a webcam soon. Check out http://www.artiswrong.com

see you later,
<p>how do i hook it in to my computer</p>
this is the coolest ible.
man you are a genius
hi make this circuit but one problem occurred car is going automatically without pressing any key although i code it which is fine ...now any idea??????????????
where do i find these chips<br>
is there any easy way to control rc car by pc<br>
why dont you just get one of those big track cars and make the control pannle wierless sory about my bad spelling
As I'm searching I'm finding that most of you are extremely smat and very good at what you do. I have a dilemma involving R/C as well. I'm trying to build a 48 channel fireworks ignitor. As it stands it's almost complete but it's not wireless. Right now I have to plug a cord into an RCA jck on the board and the other end is connected to an electric match. I got all that. What I need help with is making this an optional &quot;wireless&quot; unit so I can stand back withmy guests at my party and ignite my fireworks from a few feet away. The problem is that the biggest R/F transmitter / receiver I found was only 15 cannels, and it was expensive enough that it wouldn't be cost effective to buy 3 of them plus and additional 3 or 4 channel to build it. I'm extremely limited on experience with eectronics and have no experience with IC's but I'm willing to learn if someone can pont me in the right direction. Thanks.
Hey guys the best and easiest way to control something with your pc is by using a phidget.....just connect two wires to each button as written in this instructable but no need for checking power or ground .....connect the wires to the relays in the phidget and connect the phidget to your pc via the usb cable that is usually supplied with the phidget....i would have already made one but i couldnt find phidget....they are not available in my city....you can buy one at computer stores....the programming is easy although i dont know how to do it.... a friend of mine who is a computer genius(i wouldnt call him a geek....which most people will) told me it is easy and told me when you are done with the hadware work inform me and i will help you with the programming......really people once you use a phidget you will forget that something named serial port ever existed......you can find phidgets with minimum 4 and maximum (i think more than)10 relays.....
It is really good and i have been trying to do this but i cant find all the stuff, i dont understand the schematic pics and i am not very good at computer especially programming so i cant make it right.I will keep trying.And once again FANTASTIC
ooops!its hard to get those resources in where i live. can i get the requirements in old electronics????? pliz help <br> <br>
excuse me please give me instructions on this whole project
would a max222 chip work?
i have the same idea as this, so can write a software program to control the car wirelessly please reply
Nice Work! have you tried it with this type of controller. i am very well looking forward to controlling a rc car with my pc Great work again.
&nbsp;hello my name rob can you tell me how much it will be to do this&nbsp;
can this project be done with a arduino<br />
cool.. i like it dude....
Fear and loathing in las vegas!!! I win
cool insructable!
I'm a beginner when it comes to things like this. I could use some more detailed help and making a kit for this would be great!
hhaha WO too much tech for my brain. but i can see how someone who really wanted to do this could..i was just skimming it. but nice
>(how much for the ape?) (anybody get that reference? somebody? please????) Are you referencing the cartoon with the ape that lived in a pet shop?
no! nyet! non! bu!
is it a brass monkey
its a brass monkey. right?
will this by any chance damage my motherboard or paraller port?
This is very cool! It would be even better if you applied this to a full-sized car!!!
You could always use this software from here<a rel="nofollow" href="http://www.kemo-electronic.de/en/bausaetze/b210/index.htm">here</a>.If using windows download ksi8 winall.exe for windows.It is designed for a relay board which they sell but I use it for my LED grid.It uses the parallel port on a computer or laptop.<br/>
Nice work...Can we control this using my joystick...How...?
sir i have already read your tutorial and i very interested so i change your cujo program so it become like this<br/>===================================<br/>#include &lt;avr/io.h&gt;<br/>#include &lt;inttypes.h&gt;<br/>#include &lt;avr/interrupt.h&gt;<br/>#include &lt;avr/signal.h&gt;<br/><br/>uint8_t buffer[256];<br/>uint8_t head=0;<br/>uint8_t tail=0;<br/><br/>unsigned char noids[16];<br/>unsigned char noids_index;<br/>unsigned char flop;<br/><br/>char a;<br/>char sel;<br/>char o1;<br/><br/>void usart_putc(unsigned char c) {<br/> // wait until UDR ready<br/> //while(!(UCSR0A &amp; (1 &lt;&lt; UDRE0)));<br/> UDR = c; // send character<br/>}<br/><br/>void delay(int del)<br/>{<br/> int del1, del2, count;<br/> for(count=0;count&lt;del;count++)<br/> for(del1=0;del1&lt;20;del1++)<br/> for(del2=0;del2&lt;1000;del2++)<br/> ;<br/>}<br/><br/>void uart_init()<br/>{<br/> UCSRA = (1&lt;&lt;RXC);<br/> UCSRB = (1&lt;&lt;RXEN) | (1&lt;&lt;TXEN) | (1&lt;&lt;RXCIE);<br/> UCSRC = (3&lt;&lt;UCSZ0);<br/> UBRRH = 0;<br/> UBRRL = 12; //4800 8n1<br/>}<br/><br/>SIGNAL(SIG_USART_RECV){<br/> a=UDR;<br/> PORTB=a;<br/> usart_putc(a+1);<br/>}<br/><br/>int<br/>main (void)<br/>{<br/> uart_init();<br/> sei();<br/> DDRB=255;<br/> DDRC=255;<br/> DDRD=255; <br/> while(1)<br/> {<br/><br/> }<br/><br/> return (0);<br/>}<br/>==============================================<br/>i just want to ask your opinion about this code will it run in atmega32 because in my country i only can find this and i cant buy from digikey because i dont have any credit card<br/>thanks<br/>please reply me as soon as possible<br/><br/>
You have to watch yourself out here. This is bat country.
Can't believe nobody got that...
Does anyone know how to access the address and data bus from vb6? i used to be a computer genius in the days of quickbasic and vb3, it was inp and outp but now vb6 and vb.net make it difficult. (fear and loathing btw). all i want is to read from and write to adresses from vb6 or vb.net without going back for my masters and re-inventing the wheel. Irecently move out of my mothers basement and I even kissed a girl once so don't think i'm a dork or anything.
What address and data bus? IF you mean the parallel port, then go to <a rel="nofollow" href="http://logix4u.net/,">http://logix4u.net/,</a> and download their &quot;inpout&quot; dll.<br/>
Any chance you could do this with an Xmod?
xmods rock! i got the new evolution line and they are soo much better. ive spent like 400 bucks total on all of my 3 xmods!
what's an xmod?
radio shack's own little r/c car line
Your photos are too dark to see much of anything. You need more light when taking those pictures.
What is an AVR burner anyways?
AVRs are a computer-on-a-chip made by Atmel. AVR burners are devices you use to transfer a program from your computer to the chip.
So, how do u do this without one (or with parallel instead of serial)
well, in this case, I'm just using the micro as a serial-to-parallel converter. You could just wire the circuit to your parallel port and use the parallel port pins instead of the micro pins to drive the transistors. I'd encourage you to play with micros, though. It's not too expensive to get into ($20 for an avr burner and $1.50 for a micro), it's not too difficult to learn, and knowing microcontrollers makes playing with electronics wonderful. If you want an easy way to get into avrs, ask for an STK500 ($80 from digikey.com) for christmanukkwanza, and you'll have a great development board to try out new ideas on
excuse me i want to ask at my country i cannot find <strong>atmega48</strong> can i replace it with <strong>atmega32</strong><br/>if it can does i need to modfy your program??<br/>please pm me or send me some message at gusman_adi@yahoo.com<br/>
Well, first off, you can get mega48s from digikey.com, and they should ship internationally. But yes, you can replace it with a mega32 (although it's about 4 times more expensive). You'll need to change the micro code around a bit. To be honest, if you're gonna make changes, the simplest thing to do is just to use the parallel port on your computer--all the micro is doing is converting serial to parallel, and if the micro is holding you back, just ditch it and use the parallel port directly, maybe with a buffer chip in between the port and the transistors to make sure you don't fry your computer's parallel port.

About This Instructable




Bio: here: http://www.artiswrong.com But really, I'm just this guy. For up-to-the-minute, action-packed updates on my life (and occasional drawings of tapeworms getting ... More »
More by prank:How to Draw Sweet 3D Graphics for LED cubes Make rad solar panels in minutes with a sweet desktop laminator Pixie, the world's most intense desk lamp 
Add instructable to: