Project #2 WiiMote + Arduino + RC Car = Hours of fun

Project 2: Arduino, Wii controller and RC car.

Project 2: Arduino, Wii controller and RC car.

I made a quick little project that allows you to control a RC car using the Wii Mote as input device. It works thanks to the WiiMoteLib, C# and the arduino. The arduino is used to interface a computer to the RC car controller, it could be replace with just a parallel port or something else. Please take a look at the fun little project, It has some potential to grow in to a much bigger project. Enjoy.

I wanted to summarize a collection of interesting projects posted during the last few months on hackaday. These hackaday posts included projects with RC Toys, iPhones, accelerometers, arduino, bluetooth and the Wii motes.

I decided to build an interface between the Wii mote and a remote controller car utilizing the arduino to interpret the commands from a Wii mote accelerometer.

Project 2: Arduino, Wii controller and RC car.

Project 2: Arduino, Wii controller and RC car.

How does it work?

The project can be divided in to 3 sections:

    1. The Wii mote connects to the host computer through the Bluetooth usb receiver and it is shown on the devices list as HID interface.
    2. Using the wiimotelib and C# Express I wrote a program that reads the values from the Wii mote accelero-meter  and then it sends this data out to the arduino over USB-RS232.
    3. The arduino then reads this data. With the help of 4 transistors the arduino sends the commands to the RC controller which then moves the car.

What do you need?

You will need the following items:

Wii Mote controller $20 to $40 (Free if you have a wii).
Arduino ~$35 for official version.
You could build one for around $10.
RC Controlled car $10 and up.
Bluetooth USB transceiver $10 and up.
Some laptops come with build in BT.
4 switch transistors (BS170 works) ~$0.09 each.
Arduino Prototype Shield (Optional) $16.95 from sparkfun.
About an hour of free time Priceless.

Parts:

Project 2 Parts

Project 2 Parts

Software

There are 2 source codes for this project: The C# Express 2008 code and the Arduino Code.


C#:

I am not a C# expert, but I am in the process of teaching myself this language.

I know there is a lot of room for improvement on this code. Multi threading is definitely something I would add. I am releasing this code under the Creative Commons License, so you are welcome to modify it, but please let me know about the changes.

To download the C# Project click here.

C# Express 2008

cSharp code

cSharp code


Arduino Sketch:

The arduino sketch is very simple. It reads 2 bytes of data from the C# code over the USB serial port. These 2 bytes have the information from the Wiimote accelerometer.

The arduino then converts these 2 bytes in to digital I/O output. The transistors then function as an interface to the RC car controller.

I did some primitive checks to make sure the data sent and receive is correct. To download the arduino sketch click here.

Arduino IDE

Arduino sketch

Arduino sketch


Hardware

The hardware is very simple. My RC Controller works by connecting the 4 signals to ground (Forward, Backward, Left and Right) using the encoder chip PT-8A977BP.

When the contact is made the signal is sent to the car to move in the proper direction. I used BS170 MOSFET to drive the controller signals to ground when the arduino sends a 1 on the digital I/O port.

If you can’t find BS170’s I think 4 2n2222 would work with resistor in series between the I/O pins and the collector. I connected Pins 2,3,4,5 to the Gate of each MOSFET. I then connected the Source of the MOSFET to ground and the Drain to the controller. You will also need to connect the ground of the controller to the arduinos ground so the boards share a common ground.

Fritzing Breadboard View

Schematics

Schematics

Fritzing PCB View

PCB

PCB

Top View

Top view arduino

Top view arduino

If you wish to build the arduino shield of the project here is a printable PDF File with the proper layout to make your prototype.


Youtube video of the project

Prior to make the video, I did a quick search on youtube to see if anyone has done anything like this. I came across a similar project: http://hardcode.tv Take a look at Hardcode #1.

Their controller is digital, uses pulses and has a separate radio module. My controller is build around the chip PT-8A977BP by Pericom Technology it is an all in one solution with 5 different functions. So I took a different approach. Instead of reproducing a signal, my code connects the contacts on the controller imitating the 2 joysticks movements.

Youtube video


Update 11/17/09:

Eivind Rønneberg from the College of Ålesund, Norway and his friends approached me asking if they could use this project as interface to their RC car.

The main difference was that they wanted to use 2 arduinos one interfacing with the computer and the other interfacing via RF to the servos in the car.

The Digital IO was changed to Analog IO and they were pretty much ready to go, they adapted the code to support the RF interface and a few days later my new friend half way across the globe sent me this video:

Great job!!

Advertisements

Comments Off on Project #2 WiiMote + Arduino + RC Car = Hours of fun

Filed under Electronic Projects

Comments are closed.