Making AVRcam (was CMUcam) clones

I've been looking for some video processing to go with my simple PICAXE robots and came across the CMUcam from the Seattle Robotics Society awile back. They have three versions but the one I'm interested in is the most primitive CMUcam v1. It's not its laundry list of amazing features I'm attracted to but its simplicity. It speaks standard serial to chips like the PICAXE, BS2, Ardu, etc. and can be programmed from a PC through a relatively cheap "SX Blitz" USB programmer. Not a lot of wizardry involved.

Per marketing vomit:


CMUcam v1.0

At 17 frames per second, CMUcam can do the following:

  • track the position and size of a colorful or bright object
  • measure the RGB or YUV statistics of an image region
  • automatically acquire and track the first object it sees
  • physically track using a directly connected servo
  • dump a complete image over the serial port
  • dump a bitmap showing the shape of the tracked object

 

At the bottom of the users manual it gives a components list (with Digi-key part numbers) and a schematic of the board. I took the time to look up the parts and their current prices as well as finding some replacements (most noteably, the 75MHz oscillator is only available in an SMD package). I also substituted in some lesser priced components (mostly the expensive gold plated connectors were replaced with cheap tin plated).

The CMUcam can be purchased fully assembled for $109 from Seattle Robotics themselves. What sport is that though? To build your own, it would cost ~$75 for a single component kit with everything listed on the spec sheet with my modifications. The price would drop to ~$65 per component kit if 10 of each part was bought. A Parallax SX Blitz programmer would have to be procurred to get the CMUcam HEX file on the chip but I'm willing to eat that cost and program the chips pro bono.

You would need to make the PCB but that isn't a terrible task with the schematic being provided and PCB services from places like Sparkfun making one-off custom boards for reasonable rates. Perhaps we could draw up a decent PCB of our own and use Seedstudio or something like that for all 10 PCBs.

Just seeing if anyone would want to buy a component kit like this. Sooner or later I think I'm going to do it, by myself or not. I might try to grab ten of everything if there's nine other people interested.

I am interested. But I am
I am interested. But I am not sure how we could deal with the logistics (payment, shipment). I may even buy two of them.

Another option would be to

Another option would be to create AVRcam clones.

Dammit

Terrible fumble. I discovered I’d sourced the OV6630/C3038 camera not the OV6620/C3088 camera, sorry guys. Apparently the C3088 is obsolete. I read about the AVR cam below as well but upon first glance it would take an OV6620 board too.

Somewhat good news: Found an eBay auction with said 6620 camera using a different board setup. It looks to be the correct board but with a printer connector instead of a female header socket.

From what I’ve gathered the 6620 used 5V and the 6630 uses 3.3V. CMUcam says their setup won’t work with anything besides the 6620 and I tend to believe them. However I’d like to find that they’re wrong. Looking more into the AVR cam as well, thanks Ro-bot-X.

Still working on this but have hit the hard wall of obsolescence.

Since the camera interface

Since the camera interface with the robot is serial (UART), why not use a 3.3v system on the camera? If needed, the serial line can be level shifted.

Switch to AVRcam and CMOS cam info

I believe the AVRcam is an easier design to copy. It doesn’t use ancient chips and has similar features:


 

The AVRcam provides an assortment of capabilities:

:diamonds:Track up to 8 different colorful objects at 30 frames/second

:diamonds:Configure the system to recognize up to 8 different user-defined colors

 In addition, a PC application called AVRcamVIEW was developed to support the AVRcam for purposes of evaluating and testing the system. The AVRcamVIEW provides the following capabilities:

:diamonds:Provide real-time tracked object statistics (number of objects, color of objects, bounding box) through a standard serial port

:diamonds:Tracked image resolution of 88 x 144 pixels at 30 frames/second

:diamonds:Perform full-resolution color image dumps

:diamonds:Dumped image resolution of 176 x 144 pixels

:diamonds:Low power consumption (the entire system only draws 57 mA)

:diamonds:Small size (the entire system is 2.4" x 1.9")

 

:diamonds:Take full-color snapshots (176 x 144 pixels) with the system and display the images (both raw Bayer data and interpolated color data)

:diamonds:Easily create a Color Map of colors to track based on a snapshot

(just click on the colors of interest and add them to the Color Map)

:diamonds:Adjust the precision of each tracked color (i.e. provide a range of acceptable R-G-B values for each color), allowing the user to

adjust the Color Map to the surrounding environment

:diamonds:Display the real-time tracking results of each tracked object (with color and bounding box information)

:diamonds:Record a tracking session for playback at a later time

:diamonds:Test the system out in multiple OS platforms that are supported by Java 1.5 (both Windows and Linux are currently supported)


 

The AVRcam also uses the OV6620 CMOS cam like the CMUcam1. After studying some datasheets and schematics it looks like the newer OV6630 only differs in its 3.3V power supply vs. 5V for the 6220. It wouldn’t be too hard to make it work with either design I believe.

However I found that the Ezonics EZ Cam II uses an OV6220 and the whole cam can be found for ~$20. I think I’m going to get one of those and hack it. Then I’d need an ATmega8, a Tiny12, and an AVR ISP programmer. That will cost ~$20 for that stuff. I have almost all the other components. I might need some connectors maybe. And the PCB. I think the whole thing can be done for around $60.

Going this way doesn’t offer benefits to buying in quantities but it sounds like an inexpensive process already. At least on paper it sounds reasonable.

Definitely Interested

I could commit (for sure) to a kit if it’s under $80 and has open source firmware.  I would not mind a 1206/805/SOIC-sized SMT kit either.  What’s your schedule like for putting this kit together?  If I had the holiday season to play with it I’d be happy to give you feedback on the kit.  The CMUCam and AVRCam were appealing to me except for the age and lack of recent development.

I’d love if the kit would use the newer non-obsolete 3.3V part.  For the conversion from 3.3V --> 5V, Sparkfun has a logic level shifter design that I’m playing around with – I’m trying to build my own with 2N7002 mosfets and a new reflow soldering hot plate.

Does the CMUCam HEX file have open source firmware? Answer: "The compiler for the cmucam1 is not available anymore, so it is very difficult to update that image anymore."

The AVR cam is open-source firmware, right?  so you could update it for new cameras?  Answer: http://www.jrobot.net/Download.html

-John

What about a 30 webcam?

Wow - Look at this !   

  • USB • USB 2.0, 
  • 1280 x 1024 
  • 30 frames per second
  • And a Built In Microphone !

Alright … I’ll be quiet now…

 

 

 

It looks like maybe with

It looks like maybe with some inline resistors/diodes and using a low-voltage ATMega8L the old 5V and newer 3.3V generations could get along.

For a few reasons I’m leaning towards the 5V 6620. Namely, there would be no need for voltage conversion and the 6620 camera parts can be found for less money than the 6630. I’m not entirely against putting something together to ease the collection of parts for an AVRcam though. Maybe a kit w/o camera would be something I could do. I was thinking that if the PCB had a circuit for an additional 3.3V regulator with the appropriate jumpers one could use either camera.

I’m probably going to get one of those Ezonic cameras and get the ATMega components to see if I can even make it work. No need to go off the deep end before I get one to even act right.

I have an original AVRcam. I

I have an original AVRcam. I suggest to drop the old MAX232 level shifter and the RS232 interface and supply only the TTL serial interface. If you’re up to, perhaps the I2C interface. The NXTcam made by Mindsensors is a AVRcam clone, but uses the I2C interface to communicate with the NXT. Perhaps they already use the 3.3V camera, have a look at their page here: http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=78

Also, it would be nice to have directly on the Mega8 some code to drive the pan/tilt sensors to center the blob in the image and forward the servo angles to the robot’s brain.

I will resume the work on the AVRcam library for Arduino. There already is a .h file, but I’m having problems with it. More work needs to be done and I’m not the perfect person for this job. Oh well…

Logic Shifter

I’m trying to build my own one of these: http://www.sparkfun.com/products/8745

The components are cheap: http://www.taydaelectronics.com/servlet/the-1388/mosfet-SMALL-SIGNAL-MOSFET/Detail

Unfortunately I’m working on my first reflow solder project and the logic level converter is only one part of my circut.  Things have gone wrong in other parts of the circuit.  Eventually I’d like to test with an oscilloscope to see how well the converter works in both directions.  According to the Sparkfun comments (Dale), these are bi-directional.

The logic part of my circuit looks kind of like the above figure.   The SOT-23 bits are the 2N7002 MOSFETs.  Testing still needed.

Just mentioning it in case it’s useful.  The resistors you mentioned should work fine for stepping down, but not stepping up.  I think the communication is bidirectional, right?  Otherwise the camera wouldn’t get input from the microcontroller.

-John

The cam talks to the Mega8

The cam talks to the Mega8 for all the video processing. The chip that’s normally used has a 4.5-5.5V range but there’s one that operates from 2.7-5.5V (the Mega8L). I should look before shooting my mouth off but usually low-voltage chips like that take signals >1V as logic high, eliminating the need to step-up from a 3.3V setup.

I love everything you just

I love everything you just said :slight_smile:

edit: for the record, I just checked the NX link and the first thing I saw was a datasheet for the 5V 6620. They have two versions of their cam. I’ll look to see if they both use the same cam later on tonight.

I can’t even count to 30 let

I can’t even count to 30 let alone use something that advanced. I’m just a video recognition n00b armed with a bag of PICAXEs.

First step done

I got the ancient Ezonics webcam (made in the year 2001!) the other day and took it apart. Sure enough it has an OV6620 inside. Its design won’t let me tap into it the way I want to but I got the important parts pried off for my plans. I’ll have to recreate the C3088 board but that should be no problem. I have the schematic of the C3038 board and it looks identical to the '88s except for OV6620s pin 5. It uses a 10uF bypass cap instead of a 0.1uF cap. Big difference.

 I got some pics and captions of the webcam disassembly posted on the botton of my Peltier Pal page if anyone is interested.

I also found a couple sources for the old C3088 if somebody is looking for a drop-in replacement for their CMUcam or AVRcam or whatever. Price is~ $30 no S&H.

I’m all for eliminating

I’m all for eliminating unneeded components but without the MAX232 I wouldn’t be able to use AVRcamView would I?

Almost ready to clone an AVRcam

Just wanted to say I’ve gotten over the hump of yet another learning curve and am receiving what I believe to be the final components I need for an AVRcam v1.4.

Essentially I stuck to the BOM as listed in the users manual. The Mega8 is the ATMega8A-PU and the Tiny12 (almost impossible to find) was replaced with the ATTiny13A-PU. I’m a rank noob with Atmel chips but it seems to have the same functionally as the Tiny12, just faster. If I’m wrong, please go ahead and wave the flag.

I also have downloaded the ASM files for the Tiny13, all the code for the Mega8,  the AVRcam software suite, and AVRstudio 4.18. I bought an AVRISP mkII clone off ebay for the programming and cleared a breadboard for the project.

Even with the additional cost of the programmer and needing to buy almost every bit listed on the BOM, the cam is still very cheap. Thanks to this project I got my butt in gear and I made a spreadsheet with EVERY COMPONENT listed on the shipping invoices I’ve kept (I believe I have every last one). I intend on documenting the cost of this project down to the peso. FWIW, off the top of my head I think it’s added up to around $40-50 so far. Right on track.