Go Down

Topic: You can connect to the LinkSprite UART Camera (Read 2970 times) previous topic - next topic


Aug 20, 2010, 07:09 am Last Edit: Aug 20, 2010, 02:23 pm by rob0 Reason: 1
The Linksprite camera will work with the arduino.  You will need an SD card to save the images (unless you're just testing in which case you can dump the data over the serial line.)

This camera seems like a good fit for replacing the retired C328 uart camera that lots of folks have created projects around.  I picked up one from cutedigi.com

It's very late and I don't have time to post all the info now, but this should be enough to help others out.  The manual is a bit confusing but here are the main things you need to do:

- change from RS232 to TTL levels (I found it easiest to remove the MAX3232 chip, and add solder to connect the pairs of pads underneath the chip).

- I'm not using a mega, so for testing I used the NewSoftSerial library to read/write to the camera

- send commands to the camara like this:
  where Reset is defined like so:
static const uint8_t Reset[5] = {0x56, 0x00, 0x26, 0x00};

- you don't need to know the size of the image, since the JPG image will end with the pair of bytes:  FF D9   So you can keep reading data until you see that pair, then stop.

- to read data use the command given in the manual - MULTIPLE times (they're not really clear about that part).

- for example the read command given in the manual is:

56 00 32 0C 00 0A 00 00 MH ML 00 00 KH KL 00 0A

the first time you send the command set MH and ML to 00 00 and KH and KL to 00 and 20 (this will read a chunk of 32 bytes) so it's:

56 00 32 0C 00 0A 00 00 00 00 00 00 00 20 00 0A

Then after you've read the returned data (42 bytes with the 5 header and 5 footer bytes) you then increment MH and ML (the starting portion of memory to read from) and leave KH and KL alone since you're keeping the chunk size the same.  So the next command is:

56 00 32 0C 00 0A 00 00 00 20 00 00 00 20 00 0A

and so on.

I used a small chunk size because if it's too large you overflow the buffer on NewSoftSerial.

I'll post more info if folks are interested when I get a chance.

For now I have a working (but ugly) sketch that grabs the image and sends it out as hex over the serial line - I then wrote a small python script to take the hex data and save it to a binary JPG file.

So summary - yes it works, more to come later.




It took more work than I care to admit - good manuals (or online tutorials) save so much time.

Unfortunately I didn't realize the lack of info available on how to use the camera until I had one and was trying to use it.

I figure I'll do what I can to keep others from wasting a week scratching their heads.



LinkSprite posted Arduino sample code:


There is also a new TTL UART model if you want to connect to Arduino.


Go Up