Proxying Camera output to an SD card with Arduino

I'd like to have a devices that reads the JPEG output from a CMOS camera (http://www.sparkfun.com/commerce/product_info.php?products_id=8667) and immediately dumps it to an SD card (http://www.sparkfun.com/commerce/product_info.php?products_id=544). I have seen other posts on here which get the short answer of: "Arduino doesn't have the power or memory (RAM) for image processing". Is it possible to use Arduino to simply "proxy" the data to the SD card without processing it?

I've never worked with cameras before, but from what I've read many have an I2C line for the compressed data. So I would think I could have the main loop read the bytes coming from the I2C line and then sends them to the SD card through the serial output.

If this is not an option with Arduino, then what kind of microcontroller would be good for this sort of application? If this is possible, are there existing examles of anything like this?

Thanks.

I guess it all comes down to how many bytes of data you want to move and how fast.

If your requirements are not too high it is probably possible with Arduino

That's good to know. Is there any way to find out if Arduino is fast enough, or is it just by trial and error? I don't want to do video, just pictures. If you had the choice, what microcontroller would you use for this sort of application?

Thanks.

You have to do the math first :-)

Do you know the size of each picture in bytes (just roughly) ?

How fast (often) will you have to move a picture.

Writing to SD is pretty slow.

I really don't know much about other microprocessors than Arduino, so i can't recomend another one for your project.

I'd like to have a devices that reads the JPEG output from a CMOS camera

From what I can see of the data sheet this camera does not produce a Jpeg output but an RGB video output at 15 or 30 frams per second. This means it is coming out at the speed you are clocking the chip. The resolution is small at 640 by 320 but that gives you 204.8K of data per image. The Arduino has about 1K of data RAM. The I2C interface is for control only and does not read the image data. The other thing is that as it is coming out of the camera at normal VGA rates so that if you want only a still you have to catch that still at the rate of a video signal. As you see there is not enough memory to buffer this before writing it into your SD card and there is not enough time to take a byte directly from the video and transfer it to the SD card. You could make a device that takes pixels slowly but then it would take time (about 3 seconds) to get a whole image in and any movement during that time would show up as distortion in the image.

So what you need is a micro with at least 250K of RAM to allow you to buffer it properly. This will probably mean attaching some static RAM into a micro and memory mapping it in to allow decent access time. Look at some of the LPC family http://www.embeddedrelated.com/groups/lpc2000/1.php they will probably have enough power. If you do want to compress these images as JPEGs then there will be more processing power you will need so a top end LPC is probably closer to the mark. Then your bargain camera is the least part of the project.

So what you need is a micro with at least 250K of RAM to allow you to buffer it properly. This will probably mean attaching some static RAM into a micro and memory mapping it in to allow decent access time.

The comes a point where you're better off with an old notebook or something like an eeePC.

If this camera outputs an RGB signal, even on that more powerful micro, the program will have to be a fair bit more complex than just proxying data.

If this camera outputs an RGB signal, even on that more powerful micro, the program will have to be a fair bit more complex than just proxying data

Yes in fact on closer reading of the data sheet it outputs RGB video in digital form split over two bytes so double the estimated memory requirements for buffering. However, it only takes a few instructions to extract three bytes (one for each of the RGB) but if you store it after that then triple the memory I said last time. In fact there are 5 bits resolution in red and blue and 6 bits in green.

I think this sort of thing was made to be a web cam.

I think the best bet is to go with a a cheap digital camera that you can hack the shutter on. It does just what you want, automatically captures from the camera to a file on an SD card. And a screen resolution camera is much cheaper than this camera+arduino.

Woops, I actually put the wrong link. This is the one I'm looking at: http://www.sparkfun.com/commerce/product_info.php?products_id=8668

It does output JPEG. Thanks for all the information, it is very helpful.

I just found another project that is using an AVR Mega32 for a similar application. http://www.riccibitti.com/witnesscam/entry/witnesscam.htm

Is there any support for this chip in Arduino?