At the forefront of Artificial Intelligence
  Home Articles Reviews Interviews JDK Glossary Features Discussion Search
Home » Articles » Robotics » Tutorials

Cambot: Creating a Mobile Machine Vision Platform

This article will look at interfacing a CMUcam2 with Parallax's Board of Education (Revision B). Firstly, I decided to use the Rogue Blue chassis, since it allowed for a lot more room than the standard Boebot chassis. The larger batteries also help with the fairly substantial 200mA drain of the CMUcam2.


Setting up the CMUcam2 to work with the Stamp microprocessor is fairly simple. Firstly, the Stamp microprocessor communicates at a baudrate of 9600, compared to CMUcam2's default baudrate of 115,200. Thankfully, CMUcam2 is designed to work with slower processors, and has jumper settings for 1,200, 2,400, 4,800, 9,600, 19,200, 38,400, 57,600 and 115,200.

Adjacent to the power switch is an array of six jumpers. By setting the third-from-bottom jumper, the CMUcam2 communicates at our desired baudrate (see picture).

Cambot baudrate jumper diagram

Now that the baudrate is set, we need to set up the communications channel itself. When communicating with a PC, the CMUcam2 uses the serial port but it also has a TTL serial connection for talking to microcontrollers. Although the BOE also has a serial cable connector, we will use the TTL serial connection because it is both a tidier solution and leaves the BOE's serial cable free for easier programming and debugging.

Setting up the TTL serial cable is simple. The Logic Receive/Transmit connectors should be connected to two of the BOE's breadboard connectors (I used P10 and P9 respectively). Next, in order to make the communications work properly, the serial line needs to be grounded, so that connects to Vss. Finally, the serial jumper to the right of the TTL serial connectors must be removed to enabled TTL communications.

Cambot serial diagram

Finally, power is needed for the CMUcam2. Be very careful at this stage, reversing the polarity of the power source has a rather spectacular effect as I found out myself first-hand. Smoke, sparks and a dead CMUcam2. The positive (red) cable should connect to Vdd and the negative (black) cable connects to Vss.

Mounting the camera is mainly up to you and available resources. Currently I have the CMUcam2 wedged between the two levels of Rogue Blue chassis, although I hope to use a Rogue Robotics sensor mount to make the camera a little more stable. Nevertheless, the current incarnation of Cambot looks like this:



Programming the CMUcam2 is fairly straightforward, although I received a lot of help from the excellent tutorials by Seattle Robotics. An initial test to make sure everything is working properly:
  SEROUT 10, 84, ["L1 0",CR]
  DELAY 5000
  SEROUT 10, 84, ["L1 1",CR]
  GOTO Main
This article isn't meant to cover Stamp programming, so if you are unsure about these commands, either consult the Stamp manual or this Generation5 article. The L1 0 turns the green LED off, L1 1 turns it on (for reference, L1 2 puts the LED in automatic mode).

If the test program doesn't work, check your cabling, connections and power supply. If it works, then everything is fine and you have your own mobile vision platform! As a further test, I have slightly modified Seattle Robotics' example tracking program allowing the baudrate, input and servo pins to be changed without major code alteration.

Submitted: 25/09/2004

Article content copyright © James Matthews, 2004.
 Article Toolbar
BibTeX entry


Latest News
- The Latest (03/04/2012)
- Generation5 10-year Anniversary (03/09/2008)
- New Generation5 Design! (09/04/2007)
- Happy New Year 2007 (02/01/2007)
- Where has Generation5 Gone?! (04/11/2005)

What's New?
- Back-propagation using the Generation5 JDK (07/04/2008)
- Hough Transforms (02/01/2008)
- Kohonen-based Image Analysis using the Generation5 JDK (11/12/2007)
- Modelling Bacterium using the JDK (19/03/2007)
- Modelling Bacterium using the JDK (19/03/2007)

All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -