Arduino Uno R3 and Linksprite LS-Y201 Serial Transmission Problem

I've been trying to get the camera to work for awhile now, and it just isn't having it. I'll post my code and the responses I've been getting, and we'll see if anyone has any input.

I'm using the JPEGCamera library, which I've slightly modified to work with Software Serial, and added a few functions to set the baud rate and change the camera picture size. The code for the library will be posted below as well.

Currently, the camera is correctly set to take pictures that are 160x120, and the baudrate is set for 38400.

All attempts to change the baud rate have ended in miserable failure, even after multiple power cycling on the camera, and changing the code to work with a new baud rate.

My Code

JPEGCamera Library, Modified

The Datasheet

My Data

I would have posted using the normal code format, but the post was too long.

The problem I've been having is the transmission speed, and the fact that I'm getting an incorrect response from the camera when I send the read data command. The camera takes probably 10 minutes to transmit a 3.8k file to the arduino, which I believe is an indication that something is wrong.

I have read about Serial latency issues on Arduino, and I downloaded the changed rxtxSerial.dll, but that has changed nothing so far.

I'll post the responses I've been getting and debugging data shortly.

So, the responses for the reset, take picture, and getsize command all come in alright. Then, as soon as I start requesting data, the 5 bytes before the colon should be 76 00 32 00 00, every single time, if I'm not mistaken.

I’ve been struggling with this camera myself recently!

Have you tried the sketch on the linksprite website? Using that (under windows) I can get a picture that makes sense. I can see from the data that you posted that the camera isn’t giving a valid jpeg (it should start ff d8…).



Hi, I tried out your code but can't get any response from the camera. All I get is: BEGUN Camera finished initializing. Resetting Camera

The program stops after: count = camera.reset(response);

Any suggestions?

You can try this library, and one the of examples there: one for HW serial the other for software serial:

I get perfect results with it and pretty fast (even for the higher res pictures of 640x480). HTH

I tried your code but no chance, the program stops at
cam.takePicture();. There is no response from the camera.
May be I have the wrong camera: I should have the TTL-camera, the backside looks like the attached picture.


It definitely does not look the same as mine! So I am not sure if it will work. I know someone else is working with the code on the google code site and it works. Sorry.

I can get the picture as below, but there is always distoration on the picture. Any idea why?


I used to have this "banding" effect when there were transmission errors: too high baudrate with software serial, or also when I was not transferring correctly the picture; in order to do it correctly you must read and store in RAM a chunk (size is not critical, but IIRC it must be a multiple of 8 bytes). Then you transfer the whole chunk. In brief do not read on serial one byte and write it directly, it seems to confuse the hardware. You can have a loook at how it is done in my library. HTH

Thanks for the responses. I am using 32 bytes for one "chunk" in reading from LS-Y201 TTL camera, and writing into an SD card, and yet still receiving the "banding" bars on every photo. I am also trying to use your code, but failed in compiling process. Could you please forward your libraries, and advise where shall I place these libraries? Thanks.

Regards, Terry.

Dear HTH,

Problem resolved by changing transmission rate to 19200. :smiley:

However, may I ask how long it takes to complete a 640x480 picture transmission in your code? My program will take about 60 seconds to complete the whole transmission and the size is around 100K bytes.

Thanks again.

Hmm, I think a 640x480 is more or less 40kB for me; so it takes around 9-10s to upload it to the arduino using a baudrate of 38400. But then you also need to tranfer it (either to sd or via a serial interface to a PC or ...).

Hey, sry for a late bump but seems this camera is a bit outdated..?

Im struggeling with this camera (LSY201 from Linksprite) and have a really hard time finding a single library with example sketches that will compile properly. They fail both in the v.1.0 of Arduino as well as the new one. Did anyone actually got this working properly in the end? If so, it would be of great help if you could share your library for it and perhaps an example sketch of how to save a picture to SD card. Im useing SD card shield from seeedstudio on Arduino Uno rev.3. I'm hoping to make a time lapse in the end.

Im also rather unsure as if the LSY201 uses 3.3v or 5.0v? These two pages state different volts for VCC: When I try to hook up 5V my board is powering down though. Why is this? Feels like a bad sign!

Super greatful for any help!!