This is my first project with the computer controlled RC car, I made. Instead of purchasing ultrasonic obstacle detectors, I used my laser based obstacle detector with the RC car to turn it into an autonomous vehicle. The computer determines the position of the laser dot in the webcam's field of view. Based on its position on the y-axis, it determines how close the obstacle is, in front of the car. When an obstacle gets really close, the computer stops the car and turns it until it finds a place with no obstacles in close range. Check out the video above to see it in action! I apologize for the camera shakes in the video. I was finding it really difficult to do several things at the same time. Anyway, I admit that it would be much more fun and exciting if I had a wireless webcam. I can't stop thinking of the possibilities!
Friday, February 16, 2007
Wednesday, February 07, 2007
Computer Controlled RC Car on Vimeo
After working on this project all night, I've finally managed to control the RC car with my computer! I bought this cheap car from a local toy store a few days ago. I didn't go for high-end cars because, apart from being expensive, they use analogue signals to give precise speed and direction control. Cheap cars have a digital controller that uses switches for controlling left/right/forward/backward movements, and not potentiometers.
The first step was to modify the car's controller so that it could be interfaced with my computer. The buttons on my car's controller simply push down upon some micro-switches on the board, closing the circuit for controlling forward/backward/left/right movements. After identifying the 0 V ground and the active (control) points on the controller, I soldered wires to each of those points.
The next step was to build a circuit for connecting the car's controller to my computer's parallel port. My circuit is really simple as I didn't use relays. I only used four BC547 transistors as switches. These transistors, in effect, ground the controller's active points when they get a signal from the computer's parallel port.
I connected my computer's parallel port to the car's controller using this circuit and it worked right from my first attempt! The software for controlling this car is fairly simple and it allows me to control the car with the arrow keys on my keyboard. I want to share a little tricky problem which I had encountered while testing the program. When my computer tried sending two commands at the same time, like turn right and move forward, the car behaved unpredictably. Sometimes it obeyed the computer's command, and sometimes it just moved forward without turning at all. My first guess was, that something was wrong with my circuit. I tested the circuit a couple of times but it seemed to be working perfectly. I almost gave up on it until it occurred to me that my computer's parallel port was sending two signals (one for forward/backward and the other for left/right) at the same, exact time. The car's controller was unable to handle two commands together. When humans control the car with its controller, they normally don't press two buttons exactly at the same time. So, I modified my program and put some delay between all possible combination signals (like left + forward or right + backward etc) and it worked! So, now the sequence of commands for making the car move forward and left is something like: [left] -> [delay] -> [forward].
I really enjoyed working on this project. I'm really looking forward to using this car in my future projects! I plan to attach a wireless camera on the car for some extra fun. However, I don't have a wireless camera at this moment. I really hope I get a nice and cheap wireless camera soon or make a wireless link for my good old webcam. Anyway, I hope you found this project interesting. I'd love to hear your comments and ideas. Feel free to contact me if you're planning to build your own computer controlled RC car and have questions about it.
Posted by Ashish Derhgawen at 3:49 PM
Monday, February 05, 2007
Right now, I'm trying to control an RC Car from my computer. Yesterday, I bought a cheap RC car from a local toy store. As you can see in the picture above, I've already done some work on its controller. This will be a fun project as I could put a camera on the car and do all sorts of cool stuff!
Well..I hope I'm successful in controlling it. Keep visiting.
Posted by Ashish Derhgawen at 9:50 AM