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?
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?
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 lpc2000 Discussion Group 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.