Building robots instead of sleeping...

Home  Projects  Shop  Forums  Download  About JRO  Other


Version 1.1 Front

Version 1.1 Back

NEW version 1.1 of the hardware has been completed! 

Improvements in v1.1:

AVRcam Capabilities

The AVRcam is a small, real-time image processing engine capable of tracking colorful objects.  The system was specifically designed to provide the everyday-hobbyist with a vision system that can be easily added to their projects (robot, security, monitoring, etc).  Based on the Atmel AVR mega8 microcontroller and the Omnivision OV6620 CMOS image sensor, the AVRcam has the following capabilities:

In addition, the AVRcam is supported for demonstration and calibration by a PC application called AVRcamVIEW.  This software provides the following capabilities:

AVRcam Hardware

The AVRcam hardware has evolved several times since the project began in April of 2004.  As can be seen in Figure 1, the hardware is very straight forward.  An Atmel AVR mega8 provides the main processing needed by the system.  The Omnivision OV6620 CMOS image sensor is connected directly to the mega8 to access important camera signals (pixel clock, horizontal and vertical sync, and, of course, the data busses).  A new addition to the hardware is the AVR Tiny12, which is a small 8-pin microcontroller.  This micro was added to the system to configure the OV6620 to output its clock signal on one of its pins.  This clock signal is then used by the mega8 as its clock source.  Having a single clock source shared between the mega8 and the OV6620 provides the necessary synchronization to allow the system to process the real-time stream of pixel data.

Figure 1: AVRcam hardware block diagram

The AVRcam schematic diagram can be downloaded here.

AVRcam Embedded Software

The AVRcam embedded software is divided up into a set of classes that implement the functionality required.  The main crux of the software revolves around the Camera Interface class, which implements the core functionality of interfacing to the OV6620.  The Frame Manager utilizes the data gathered by the Camera Interface class to make frame-level calculations and decisions.  A User-Interface Manager sits as a peer to the Frame Manager, and is responsible for processing incoming commands and generating the needed outgoing serial packets.  Finally, a simple event-dispatching executive sits at the top of the system to facilitate the handling of the events that get generated in the system.  The AVRcam class diagram is shown in Figure 2.

Figure 2: AVRcam embedded software block diagram

The AVRcam software was written almost entirely in C, using the free AVR-GCC C compiler.  Several of the critical camera interfacing routines were written in Assembly in order to explicitly ensure the number of cycles that would be used for the routines.  These routines provide the core capability of the system, and what allow the system to keep up when running at 30 frames/sec.

The complete AVRcam embedded software can be downloaded here.

AVRcamVIEW PC Software

The AVRcamVIEW PC software provides a simple way to test and calibrate the AVRcam.  This application runs on a PC (either Windows or Linux), and communicates with the AVRcam through the standard 9-pin serial port of the PC.  The AVRcamVIEW software allows the user to take full resolution snapshots (176 x 144 pixels) and analyze them to determine the colors that are present in the camera's field of view.  The user can then build a color map, to indicate which colors the AVRcam should track, by selecting the colors in the image and adding them to the color map.  Once all the colors have been selected, this color map can then be sent down to the AVRcam to configure it.  The AVRcam is then ready to begin tracking, which can be enabled by the AVRcamVIEW control panel.

When tracking is enabled, the AVRcamVIEW application will display the currently tracked objects (both color and bounding box info).  The display is updated at the full frame rate (30 frames/second), so the user can get immediate feedback regarding how the system is operating.  The tracking session can even be recorded for playback in the future to analyze the system's performance.  Screenshots of the AVRcamVIEW application can be seen in Figure 3.

Figure 3: AVRcamVIEW PC application tracking three objects (yellow Lego plate, and red wire-stripper handles)

Finally, the AVRcamVIEW application is capable of keeping a complete, time-stamped log of the serial communications exchanged with the AVRcam.  This provides a way to perform additional analysis on the data provided by the AVRcam.  It also allows the user to better understand the communication protocol used to interface with the AVRcam.

The AVRcamVIEW application is written in Java, and comes with an easy-to-use installation program.  Currently, both Windows and Linux are supported, with the possibility to expand to other Java-supported OSs if the demand exists.  The Java Runtime Environment (JRE) to support the AVRcam is installed automatically, so there is no need to download anything else to get the system up and running on your PC.

The complete AVRcamVIEW Java software package can be downloaded here.

Custom Development with the AVRcam

The intention of the AVRcam is to provide a starting point for adding different image processing capabilities to systems being developed.  This point is made further by the open-source nature of both the AVRcam embedded software as well as the AVRcamVIEW PC application.  The AVRcam comes allows in-circuit reprogramming of the ATmega8 software, through the standard 10-pin AVR ISP (STK200/STK300 style).  The current AVRcam embedded software utilizes approximately 4K of the 8K flash program memory, 700 bytes of the 1K RAM, and 48 bytes of the 512 bytes EEPROM.  Thus, there is definitely space left on the system to add custom image processing functions.  The software was written and commented in the hopes of being as understandable as possible to make user additions easy.  In addition, the Forums section of JROBOT has an area to ask questions and share ideas about making additions to the system.

Interested?  Purchase the AVRcam system

Known Issues

By releasing the AVRcam under the GNU GPL, I hope that other developers will take the opportunity to read through the source code and improve upon how the system works.  This includes adding new features, as well as working on known issues in the system.

The current list of known issues  are as follows:

    -12/06/2004 -The only baud rate currently supported by the User-Interface is 115.2 kbps.  Other baud rates (down to 4800 bps) are being worked on, but turned out to be more difficult than expected.

    -12/06/2004 -When doing repeated dumps of images, the UART receive interrupt seems to stop responding at times.  This has no effect on tracking objects.

    Fixed in version 1.4 of AVRcam firmware

    -12/06/2004 - When doing a frame dump, there are times when a line of image data seems to be skipped, which causes the AVRcamVIEW app to sit and wait forever until the last line is sent (there is currently no timeout associated with the frame dump activity on the AVRcamVIEW software).

    Fixed in version 1.4 of AVRcam firmware

Wanna help?  Download the latest AVRcam source code here.

Contact JROBOT 

Copyright   2004 JROBOT  All Rights Reserved