Wednesday, May 12, 2010

I created this site to showcase my Arduino RC Car which I call the Creeper Bot.

High Concept:
Xbox360 Controller is used to control a RC Car and mounted camera.
Details:
I ripped out the car's original circuit board and hooked up the Arduino to the car's drive and steering motors. A motor controller is used to control the motors.

I wrote a C++ program which runs on a laptop. The program uses an input library called Object Oriented Input System.

The program reads input from the Xbox360 controller and sends data serially over an Xbee radio to another Xbee radio on to the Arduino. The serial library is called CSerial.

Below is the supply list. After writing this I now realize what a costly venture this was.
Supplies:
Arduino Duemilanove.........................$30
2 x Xbee Pro 60mW ............................$25 each
2 x Xbee Adapter Kit ...........................$10 each
2 x 2.4GHz Duck Antenna ...................$10 each
2 x Interface Cable .......................$5 each
USB FTDI Cable ...................................$20
Motor Controller.................................$5
Wireless Video Camera........................$45
Pan and Tilt Kit.................................$35
Easy Cap USB Device.........................$7
Battery connector set
Laptop
Xbox 360 Wired Controller

Finished

Product:

Source Code:
Download here. I have included the Visual Studio Solution for the C++ code as well as the .pde file for the Arduino sketch.

I apologize in advance, the C++ project is a mess. The serial library required MFC classes, which frustrated me to no end. After spending hours just trying to get the most rudimentary example to compile I got fed up and thus did not take the time to pretty things up. The important code is in ArduinoCar.cpp. That file itself is dirty because I had to hack in the OIS code to read the controller input. There is a lot of code in there that assuredly doesn't need to be in there.

Car.pde is much cleaner and is no doubt the most important part of the source code.

If you are looking for any code related to the video signal, please note that the video camera and the receiver were stand alone components and thus have no source code. I looked into transmitting video through the Arduino and several sources recommended just going with a standalone set. I would agree with this recommendation.

Abandoned Bluetooth
In the video, I use a bluetooth modem for communication from the laptop to the Arduino. I chose bluetooth because my laptop already had bluetooth capability which means that all I needed was a single unit for the Arduino on the car. Not only that but I had read that the bluetooth modem was a snap to setup, while the Xbee radios seemed to have some confusing configuration process. It turned out that the bluetooth modem was very easy to get up and running. However, the maximum distance for communication only seemed to extend about 100ft. Because of this, I decided to abandon the bluetooth and try the Xbee Pro radios with a duck antenna attached. Now the range is much farther (tested excellent at 300ft.).

Better Steering
In the video, the steering is not very good. This is because I did not understand the steering mechanism at the time. The wires for controlling steering literally were coming from a black box. I had to experiment with the 6 wires that were coming out of the box to find out which ones controlled the steering motor. For a long time afterward, I had 4 unused wires just sitting there. It wasn't until much later that I investigated what those wires did. I completely disassembled the steering box, but it was worth it. I found that the remaining wires were attached to a potentiometer. After finding this out, I was able to read the voltage coming off the pot to determine the position of the car's wheels. With that information I was able to make the wheel rotation pretty much go one to one with the Xbox controller's left joystick. This was a vast improvement over the first steering implementation.

Pictures:


















Side view of the Creeper Bot. You can see the camera up front and the duck antenna hanging off the back. You can also see the two battery hookup cables. The bottom battery drives the car's motors while the top battery drives the camera, camera servos, the arduino, and the Xbee radio.



















This is a close up of the camera and camera servos.



















This shot shows the bread board on top of the Arduino, which is on top of the battery pack. Everything is held down by a velcro strap that loops around the car.



















This is a shot of the Xbee that connects to the laptop. The Xbee Pro module fits into the Xbee Adapter which hooks up to the computer via the USB FTDI cable. The huge duck antenna attaches to the Xbee with the interface cable.
























This is a shot of the Xbee that is attached to the car. It is attached to the Xbee Adapter that is attached to the bread board.



















This is a top down shot of the bread board. The left side of the pic is the back of the car. That chip on the far left of the bread board is the motor controller. One side of the motor controller controls the drive motor, while the other side controls the steering motor. The arduino sends signals to the the motor controller to control the motors.

Earlier Videos:
Here is an early video of the Creeper Bot. At this stage of the project the Creeper Bot is hooked to the computer with a USB cable. Also, everything ran off of the USB power.

RC Car Controlled by Arduino and Xbox360 Controller from Dan Howery on Vimeo.

Power:

The motors run off a 9.6V RC Car battery. The arduino, pan/tilt servos, and camera run off a seperate RC car battery. I like using the rc car batteries because I can plug them into the charging wire without removing them from the car. It makes charging this thing a snap.



In this video I revised the controls a bit. Rather than have the left stick control forward/backward and the right stick control left/right, I made it so that the left and right triggers control forward/backward and the left stick controls left/right. This allowed me to tie the camera controls to the right stick later on.

Revised Controls for Arduino Xbox 360 RC Car from Dan Howery on Vimeo.


47 comments:

  1. Your first 2 links are broken.

    ReplyDelete
  2. Hi - great project. I would like to see the source code and how you got the XBox remote to work with it. Can you post the details. I tried clicking on the links but nil! Thumps up

    ReplyDelete
  3. very cool, it would be great to see the source code

    ReplyDelete
  4. please post the source code, doing a similar project

    ReplyDelete
  5. I just posted the source code (C++ and Arduino). I also fixed the first two links that take you to the code libraries.

    ReplyDelete
  6. Can you put any wiring schematics out for us also?
    I am mainly interested in the motor controller you are using. I have looked over the info sheet on it but i am always looking for more info and other ways to look at things. Thanks

    ReplyDelete
  7. Where are you located? I saw a similar project at a Science Fair in the Philadelphia area.

    ReplyDelete
  8. Excelent project!

    The next project would be to use the long range xbee modules (see sparkfun.com if you don't know about them yet) and then to design a controller w/display that takes the laptop out of the loop.

    ReplyDelete
  9. Thanks man, it's a really cool idea. I'd like to see the source but for some reason I can't download it. I can see the 7.9MB up there, but can't get to the zip file.

    ReplyDelete
  10. Hey Dan, what does your serial protocol look like, did you use binary or a human readable stream?
    Jim

    ReplyDelete
  11. Hello,

    Source code link on Google seems broken, is it still available?

    Thanks.

    ReplyDelete
  12. Can you please send me a pm with the code?

    moraes.andre@gmail.com

    I'm trying to do similar project with xbee and slash

    ReplyDelete
  13. The link is broken. someone upload it in Google docs or a file-sharing site.

    ReplyDelete
  14. hello,

    i'm stuck in getting turn and forward/backward working at the same time.

    any tips?

    thank you

    ReplyDelete
  15. I just posted the source code again. This time, I believe that the link will not break. Sorry for people who tried getting it before.

    Also, I swapped out the Bluetooth in favor of Xbee modules as the range is much farther.

    Thanks for all the comments everyone.

    ReplyDelete
  16. Hey,

    This is totally cool.... but i know for sure its advanced stuff... and that wont stop me...

    thanx for inspiring me


    ~Photons

    ReplyDelete
  17. completely awesome! i've had ideas for a project like this for awhile, but you DID it! A couple questions about the camera/video quality since i'm considering a similar wireless camera. What is the source of the glitches in the video, RF interface, power noise, or ??? Using a cheap wireless camera fits the budget, but can the video quality be improved? THX

    ReplyDelete
  18. Hey,do you reckon you could place a copy of how you connected them together please?
    Thanks In advance

    ReplyDelete
  19. Hi,
    I'm working on a similar project but I am having problem wiring my Xbox controller to the chip. How did you do that?

    ReplyDelete
  20. This is an excellent project, but for some reason I cannot get the visual c++ program to work. I've tried both 2010 and 2008 versions of the software and I get a fatal error that tells me that "the application has failed to start because application configuration is incorrect" when ever I try to build the project or run the app file in the debug folder. Any help with this would be much appreciated.

    Thank You

    ReplyDelete
  21. How did you turn two wires from the battery pack into a barrel jack? Is there an adapter that does this, or did you just make it yourself?

    It's a great project, BTW. Thanks for the inspiration!

    ReplyDelete
  22. Hey, AWESOME project. I am trying to do the same thing. I would love to look at the source code to get a better understanding of how to made it all work as I am no programmer :S. sadly the link is broken once again. If someone with the code could send it to me I would be VERY grateful.
    roweboat87@gmail.com

    ReplyDelete
  23. great job ,please could you sent me the code i m working on a similar project , i ll be gratefull
    houssem_bahri@yahoo.fr

    ReplyDelete
  24. Hi.
    I'm very interested in this proyect.
    Could you upload the source code again? The link doesn't work.
    Thank you very much.

    ReplyDelete
  25. Hi, im not sure if anyone still uses this site, hopefully they do, but can anyone send me or link me the source code for this? cheers

    ReplyDelete
  26. Hey bro, I am working on a similar project but need some help with the source code. Was wondering if you can send me the source code? If you can my email is zeus.02@hotmail.com , thanks again and awesome project man!

    ReplyDelete
  27. does anyone know if there is a how to video out there for this project i would really love to try making this. great job!

    ishcrop@gmail.com

    ReplyDelete
  28. Hey would you be able to help me out with the source code? thanks! Also I downloaded to OIS files and such but I have no idea what to use (OIS, OIS_vc9, OIS_vc8 etc..) please help! this would make my project so much helpful

    Matt
    swimfree2010@yahoo.com

    ReplyDelete
  29. can someone send me the source code please tux@ntlworld.com thank you

    ReplyDelete
  30. can someone send the source code to me at ixlr84life@yahoo.com please and thank you!

    ReplyDelete
  31. Hi! Nice project but the link is broken can someone send me the code. Thanks! nonogarcia@msn.com

    ReplyDelete
  32. very cool can you please send me the source code harry@cartechF1.x90x.net thank you.

    ReplyDelete
  33. hi!, i have made a project like the creeper bot, using the arduino uno and a web browser to control the car.

    http://arduinonetcaren.blogspot.it

    ReplyDelete
  34. hi can u send the source code to hallskyler9@gmail.com

    ReplyDelete
  35. Hello, is it possible to repost the source code or email it to me? (302468@student.saxion.nl) Im having issues with the way you read in data from the controller.

    thanks

    ReplyDelete
  36. hey there, im pretty new to this stuff, but why do you need the motor controller ? is it just to make the different functionalities of the motor(forwards/revers) easier without using many different wires ? and if so did you have to program that micro-controller ? Couldnt you have done all of the programing directly off the arduino to the motors ? please someone reply asap , thanks

    ReplyDelete
  37. hey Dann,

    I am Merlin from Holland, and I am working on your project you have made. But my c++ code doesn't work. Can you send me your c++ code, so I can figure out what I am doing wrong?

    Thanks,

    Merlin From Holland.

    BTW, My E-email is: merlin073@hotmail.com

    ReplyDelete
  38. For Xmas this year, my son an I talked about doing this very thing, however we were going to add a Nerf gun to the camera turret. However, I am an EE first with a, ME, SC, and math background, so I was planning to turn this into a full project. I would be happy to share my designs with you if you are interested. I would likely just ask for some help with your code once I get to that point. But first, if I sent you schematics, would you be able to tell me if they interface with your code, or if I might need to fork the code significantly. I will spin PCB to make this as P&P as possible for anyone interested. You can contact me direct at richard.howlett@xcellsior.com If you write back, I will send a much more detailed idea for this project.

    Thanks,
    Richard

    ReplyDelete
  39. can you re upload the broken links

    ReplyDelete
  40. can you email me the code at baby2fly90@gmail.com

    ReplyDelete
  41. could you email me the code at darrensaunders9@gmail.com.

    ReplyDelete
  42. I know this is three years old...
    but I am hoping to do a project with a 360 controller, but as of now have no clue how to read the inputs from the controller. Could you possibly reupload the code or send it to me? Thanks

    ReplyDelete
  43. Hi, could you please send me the stuff i need to my email? -Bassking02@gmail.com

    ReplyDelete
  44. Hey man,

    Fantastic work! Really admirable! Hoping to do something similar. Could you send me the source code to my email?

    epower187@gmail.com

    Thanks
    Ell

    ReplyDelete
  45. hi, is a very nice proyect but unfortunately your links are broken... so... could you repair it?

    ReplyDelete