How to Build A Webcam Car:


I admit I got a headstart by reading this webpage here. Props to the original guy who put that together, although I'm sorry he doesn't have a full-on-working-demonstration. Oh yea, now that's what I'm talking about!


How To Build IT!


Outline:


Parts List

  1. (4) AA Bateries (6V total). Get rechargable!
  2. 4 AA Battery holder. Radio Shack part number 270-391A.
  3. "Size N" DC Power to AA battery connector. 5.5mm outer diameter and 2.5mm inner diameter. Radio Shack part number 274-1573.
  4. Wire pack to connect AA battery holder to "Size N" connector. These are also at Radio Shack.
  5. (8) 6" wires to connect RC remote control to the phidget board. I got some thermostat repair wires from Lowe's for $0.17 / foot.
  6. A wireless webcam. I use (and recommend) the Airlink 101-AIC-250W.
  7. An RC Car. I used (and recommend) one built by the manufacturer New Bright. They are sold at any Toys R Us store.
  8. Phidget Board (0/0/4 Interface Kit)

Where to Pickup Parts

Step By Step How-To!

Assemble the power source:

The first thing I needed was power! The webcam I chose takes an input of 5 volts. By assembling 4 AA batteries in series I got close enough (6 volts). The camera seems to power up and operate just fine at this voltage level. PLEASE pickup some rechargables. You will save TONS OF cashola ($$$) in the long run.

First, soder the n-connector to the n-connector battery wire (as shown):

Next, connect the 4-AA battery holder to battery wire setup you just soddered together. Plug the n-connector into the power on the Webcam camera. Voila! Your webcam should power on just as it were plugged into the wall. If you have trouble, make sure you have charged your batteries.

Connect the Phidget Board to the RC car controller:

This step involves a little bit of skill. Each RC car controller is a little bit different, but the principles are the same.

Basically, we need two wires for each direction we want the car to move in. That makes a total of eight (8) wires for four (4) directions. Soder one wire to the forward control contact, and one wire to the forward control neutral connection on the RC controller.


After wiring up the RC Car Transmitter connect the wires to the phidget board.

Repeat this process for each direction to control.


Phidget Board Connected to RC Car Controller


At this point, you have all of the hardware setup completed. Now for the tricky part: software!

Now, install the drivers for the phidget board onto your linux machine:
I hope to figure Windows out sometime soon. IF you have a port for the drivers, please let me know: support@mycamcar.com

Download the lastest Phidget linux drivers from http://www.phidgets.com
The version I used in making this page is Phidgetlinux_2.1.2.tar.gz, click here to get that version.
However!! I highly recommend sticking with the latest and greatest stuff as you will find the most support for it.

Uncompress and install them:

scowby@blacktop: cd download
scowby@blacktop: tar zxvf Phidgetlinux_2.1.2.tar.gz
scowby@blacktop: cd working/Phidgetlinux/phidget21/
scowby@blacktop: make
scowby@blacktop: make install

Bam! You're done with that step. At this point you should be able to control your Phidget Interface kit from your linux box. Sweet potatoes! Feeling good so far?

Connect the phidget board Interface Kit:

I had success with the Phidget Interface Kit 0/0/4. I also tried out the Phidget Interface Kit 8/8/8 but noticed that it handles things differently than the 0/0/4, so I recommend that you stick with the 0/0/4 for your first Car.

Use the USB cable that comes with the Phidget IF Kit to connect the Phidget Interface Kit to the computer.

Now, download, install, and run the car control software:

This part is a little tricky, and you need to know a little bit about programming if you want to fully understand the details. Fortunately, I've done the majority of the grunt work for you, and you should be able to run my software right out of the box (linux only!). If not, there are makefiles included to recompile on your machine.

Get the car control software here. NOTE: As of April, 2009, I am in the process of organizing the source code and binaries. Please bear with me while I get this together. This source currently includes two programs: 1) basicOnOff and 2) karKontrolKeyboard.
I am putting the actual server software ('dualKarKontrol') together into a meaningful package and will have that available soon!

'basicOnOff' is a simple example of how to toggle the relays on the phidgetboard 0/0/4.
'karKontrolKeyboard' is used to control the RC car from the keyboard.
'dualKarKontrol' is used to control an RC car from the network.

You must be 'root' to run the software. I setup sudo on my machine to do this. To learn more about sudo, check here."

Once you get the software, run 'make' to create the application binaries and run the test programs. These programs allows you to control the phidget interface kit using just the keyboard.

scowby@blacktop: cd {directory you downloaded sourcecode to}
scowby@blacktop: cd karKontrolKeyboard
scowby@blacktop: make
scowby@blacktop: sudo ./basicOnOff

If everything is successful you should be able to press the arrow keys and hear the relays on the Phidget Interface Kit clicking back and forth.

Create your webcam webpage:

This is where you'll need to know how to embed a webcam into a web page. Check out the specifics here.

You just want to be able to see your webcam displayed within a webpage on your site. If your website is remote you will probably need to open a port on your router so the webcam can stream images to the internet.

Create an AJAX webpage:

Even more complex is a webpage that can communicate with the car control software that you downloaded and installed.

Webpage source: click here.(@todo)
Javascript source: click here.(@todo)
PHP source: click here.(@todo)

NOTE: This setup runs through Zend Framework so you may need to modify it depending on your exact setup.

Enjoy!

Best of luck to you. I hope you have as much fun putting this together as I have. If you have any questions you can drop a post on my forums, or send me e-mail: support@mycamcar.com.