Some time ago I found an Instructable by quasiben about creating an image capturing bird feeder. I thought that would be a good way to start learning about Arduino because it implements so many different aspects... the basics from LEDs to Serial communication, to more complicated stuff like Xbees and writing external data. Believe it or not, a week or two of tinkering has been more eye-opening than almost a year of military avionics training. I'm pretty pleased with how much I've learned in 2 weeks. My electronics knowledge was limited to Ohms Law, and I'd never touched C/C++ before, much less custom circuitry, breadboards or microcontrollers.
I'm looking more for a push in the right direction so that I can learn this on my own, rather than for a "Here's the code" or a "It can't be done, n00b, leave the programming to the real geeks like me!" My searches of the boards and google have gotten me pretty far, but I'm at a point now where all of my searching keeps leading me to the same couple of pages that don't really help anymore.
I'll be totally honest, I learn by trial, error and experience (of which I have about 2 weeks), so if you're going to come at me with lots of stuff about bits, bytes, megaflops and ultramatrixpentahackolograms, odds are I won't have a clue what you're talking about. I just recently figured out why I can't just write 1's and 0's to a text file and save it as ".jpeg" and BAM have an image, if that gives you an idea of where I'm at as far as "theory" goes. However I've come a decent ways on this project and would like to see it through to completion. So if you have any ideas and can give me some pointers, I'd appreciate it.
So here is what I'd ultimately like to have. Not necessarily what I NEED to have, just what I'd like.
Lilypad Arduino, LinkSprite JPEG TTL Camera, Xbee installed in bird feeder outside, triggered by an IR sensor, powered by 3.7v Li-Ion battery (hopefully charged by solar)
When IR beam is broken, take a picture with the camera, and stream it to the Arduino in blocks of 8 bytes (I think 8 bytes?)
Arduino takes incoming blocks of JPEG data (starting with 0xFF 0xD8, ending with 0xFF 0xD9) and outputs them via Xbee to another Xbee inside the house
Indoor Xbee either directly (or through another Arduino) writes received data to a .jpeg file on a SD card, which is somehow hooked in to a digital picture frame for automatic/instant display.
I've gotten all of the above done except for the part of making sense out of the data that the Xbee receives. I monitor the Serial port of the Xbee connected to my PC and see the HEX data streamed in from the camera outside. I can send the data in HEX or BIN format, but neither of which am I able to just copy over to a text file and rename to .jpeg, obviously. So far I haven't even been able to tell if the pictures I'm receiving are corrupt or not. For this I assume I need some sort of Java, Python, C++ or some other super hacker script to take the BIN or HEX data and write it to a binary file? Or is it possible to write these streaming bytes straight from an Xbee or Arduino onto an SD card without needing a Java or third party program running on a PC to do the manual labor? Remember I'm not attempting to store the JPEG on the Arduino, I just want to use the Arduino as a means of transferring the streaming JPEG data from the camera outside onto an SD card inside.
Also of note is that I'm not expecting multiple pictures in, say, less than 15 seconds. In other words, if a bird comes along, I'll try to take a picture, take about 15 seconds or so to process it and send it inside and save it to disk, and then reset. So I'm not worried about overloading the Arduino or exceeding its memory capacity in that regard... my progress so far shows that this will be a non-issue with my implementation.
I'm kind of tinkering with the idea of giving this (when completed) to someone as a gift, and generally speaking I don't want to be like: "Here is your bird feeder camera, mom, now let me just teach you how to install and run Eclipse, JRE and SDK and how to monitor your serial port for incoming HEX data so you can manually, or by batch, convert it all into binary jpegs, save it to your SD card and then, every day, take that SD card to the digital frame in your living room to see the pictures!! HAPPY BIRTHDAY!!"
Know what I mean?
So anyways, I'm able to receive jpeg data on my indoor XBee from the outdoor camera. Right now the indoor XBee is hooked up to my PC, but I'd like it to be stand-alone with the digital frame and/or hooked up to another Lilypad Arduino, if need be. I'll tackle the hurdle of the Digital Picture Frame when the time comes for that, but for now, all I'm worried about is streaming JPEG straight from the Arduino outside to the XBee inside, to the SD.
The SD libraries I've found have shown ability to write text files and the like, but I haven't find a resource describing how to save a JPEG straight off of the Arduino or XBee. I guess the first thing I need to do is get a SD breakout or SD Shield, but am not totally sure where to start and/or if I even need a second Arduino, or if I can stream bytes straight from the XBee to an SD card as a JPEG in the first place.
Thanks for reading this far. Hopefully I've been clear enough. I'm not having any problems with code at the moment, so I've refrained from posting any (in large part it's similar to quasiben's, with a few additions to calculate a baseline IR reading to compensate for changes in ambience, some timing changes, and a potentiometer to control object detection sensitivity, which will be accessible from the outside of the bird feeder as a control knob).
In summary, I'm looking for ideas on the INTERIOR part of this project. I want to write Streamed data from a receiver XBee to a JPEG file on an SD card, which, if possible, I'd like to have connected to a digital picture frame, without the use of a third party interface/PC (but can use another Lilypad Arduino, provided it can inconspicuously attach to the back of the picture frame).
Thanks guys, this is a great resource.