Tuesday, April 23, 2013

Transmission errors fixed

Made a nifty change in my code allowing me to shorten delay times and eliminate transmission errors from propagating into the image. Now when a non-full frame is received, the code requests a repeat of that frame. Results seem good, while 10 ms delay does not work (probably not enough time for the signal to be sent and processed), 100 ms seems fine, and probably down to 80 or 70 ms could also work!

Fig. 1. Image taken at 100 ms delay time, which previously would have contained transmission errors (see previous blog posts).
Code is uploaded to the repository. This is much better than posting a new file each time!

Monday, April 22, 2013

Software Repository Up

The software repository is now up and available from Google code here and uses Mercurial. I'll be putting my files in here from now on, and try to do a better job to keep some naming consistency and documentation. That is all for today.

Sunday, April 21, 2013

Wireless photo transmission

Today is a pretty big milestone in my project. Actually over the last few days I've made a lot of good progress, so today's blog post will be a big one.

First the achievement:
I transmitted wirelessly from outdoors to inside. Still a lot of tweaking and streamlining to go, but the rough idea is there. Here is the photo:
Fig. 1. The camera took a photo outside, and transmitted it about 6 m to the Arduino indoors. The errors are probably due to missing bits or frames during transmission.

To get there, a bunch of work was necessary. To summarize:

  1. Modified my SD card photo storage program to communicate with the Lynxcamera over the UART instead of software serial. 
  2. Programmed my XBee transmitters to work at 38400 baud.
  3. Connected the Lynxcamera to the XBee and battery module, to capture photos remotely.
After the break I discuss the challenges with each of these separately, include some photos of the setup, and post my code.

Sunday, April 14, 2013

SD card adventures

This morning I went to NCIX and bought myself a microSD card. It was the ADATA 16 GB microsdhc class 10, and worked great with the Sparkfun microSD shield. The card came pre-formatted in FAT32. I found a copy of FAT libraries for the Arduino by William Greiman . After changing the CS pin in the software to be 8 (the software default was 4), the ReadWriteSdFat example code executed perfectly. I was also able to read the test file on my computer.


The next step was to collect a camera image, and store it on the microSD card. To do this, I adapted my previous LynxCamera code to make LynxCamera_SD. In this version of the software, the camera and SD card are both initialized. The user presses a keyboard button to tell the camera to take the photo. This time, instead of streaming the photo to the console, it is logged to the SD card. I can eject the SD card, insert it in my computer and use my conversion script to make it into the beautiful image of my apartment below.





While this works, I have observed a couple disappointments already. Getting the data from the camera onto the SD card is slow. I may be able to update the baud rate slightly, but at 38400 I was seeing transmission errors, so there is not a ton of speed to be gained here. The camera itself is a bit disappointing (though I was sort of expecting this). The photos have poor contrast, and are a bit dark. Seems the exposure time is automatically set, so I don't have a ton of flexibility here. Finally, I'm already at 15508 bytes out of a potential 30720... not leaving me a ton of room for doing LCD screen, radio and push button integration. 

But I think there is still lots of potential for this project! I'm charging my battery at the moment, so that, as the next step, I can start integrating the radios into this system. I think I will try to get all the aspects of this project integrated before starting to optimize the speed and space utilization.

Wednesday, April 10, 2013

Shift register working

Its a minor victory, but its been almost a month since I've had time to work on this project so I'll record it anyway :). Fixed a short to ground on one input pin of the shift register. The I used the Arduino shiftIn() function to read from each pin of the 74HC165. A simple sketch is available here. Hopefully soon I get the DIP switch soldered on, and can start using this as some input into the Arduino for testing and debugging.