Hello,
I want to make this kind of sculptural thing where the viewer would sit in a chair with an FSR on it, so the Arduino would know someone is there. When they sit down and look at the sculpture a servo would start spinning on the sculpture, spinning a mechanism to turn a wheel and then when the wheel is in the right place (probably the arduino would know with a light sensor or something), take a picture of the person sitting in the chair and save that picture to an SD card on the Ethernet shield and upload it to Twitter. So it'd be like the artwork would have a twitter account of all the people looking at it...and it would have a database accessible on an SD card inside the sculpture.
I've done most of this stuff before, just not together, and I've never used a camera with an arduino. Here are some questions:
What's the difference between a TTL interface camera (http://www.sparkfun.com/products/10061) and a CMOS one? (CMOS Camera Module - 640x480 - SEN-08739 - SparkFun Electronics) Is one easier than the other to put the picture on an SD card? I couldn't really find anywhere to get started with cameras and arduinos...how do I wire them, hook them up and everything? Most of the stuff I've found is for more specific projects and I didn't really understand it.
Could all of this be powered from a duemilanove or Mega? I really don't want to use a PC...I want everything to be contained within the sculpture and to turn on with the flip of a switch.
Look at how pixels the camera has. The TTL camera has 160 * 120, or 19200 pixels. With even one bit per pixel, it will take 1/2 second to get the picture from the camera to the Arduino. The Arduino can not store the whole picture in memory, so you need to read some data and write to the SD card in a loop, until all the data has been read.
It is more likely that there are several bits per pixel, so multiply that 1/2 second per picture by the number of bits per pixel. IE errors out when I try to follow links on the sparkfun site, so I can't tell how many bits per pixel. 24 would not be unreasonable, though.
Now, count how many bits/bytes of data you just stored on the SD card. Now, figure out how long it will take to paketize that data and send to twitter using the ethernet shield. Hopefully, not more than one person per hour will be seeing your sculpture.
OK, maybe it won't be that bad, but it will take several minutes per picture to collect/save/upload the data.
Foscam makes a web-enabled camera -- the FI8908W -- which has contacts on the back that allow you to trigger it to take a picture and email it. If you set you're arduino as the trigger you're basically done.
Note that the FI8908W has been superceded by the FI8918W which does not have this ability so you may have to look around to find one.
Definitely use the ttl camera, as it outputs the JPEG over serial. The other camera outputs analog rca (red/yellow/white plugs on your tv).
It should be fairly easy to save the file to an sd card. The sparkfun page for the TTL camera has a link ( http://www.sparkfun.com/datasheets/Sensors/Imaging/JPEG%20Camera%20Libraries.zip ) to all of the libraries you need to do this. It even has examples for saving photos to a FAT SD card.
You do know that twitter doesn't support photo uploads? You'll have to use twitpic. You say you've done most of this stuff before, so I trust you know how to use the ethernet shield to send HTTP requests, in which case the twitpic API page should be very helpful. Twitpic . The sample CURL request at the bottom has everything you need.
The TTL is the only option with an arduino and don't expect more than a single frame every few seconds, it has to be transferred byte by byte over serial and then stored on the SD card (also very slow). The arduino doesn't have enough resources to store or process the picture. Then you've got to get it up to the internet. You're going to need at least a mega to have enough resources to run the code and the required libraries . My honest opinion is you want something with a bit more horsepower than an arduino. Something like a 32 bit ARM processor and a good few megabytes of RAM so it itsn't struggling, you could then use a much cheaper PC type USB camera and not having to juggle the picture around very slowly in the very limited resources available in an arduino. It would also be able to determine from the camera picture whether anyone is sat in the chair, something way beyond the capabilities of an 8 bit processor with few K of RAM.
A little like a dog walking on its hind legs, it can be done, but not well.
As mentioned, you want the one that creates a JPEG on the camera and sends that to the arduino.
As for uploading it to twitter, you're going to need a web server to handle that. The picture will go camera - arduino - sd card - web server - twitter/twitpic. I haven't tried twitpic personally, but I think it's part of twitter and in that case the authentication is probably too complicated for the arduino to handle.
You will want a server which will allow your arduino to use a simple method to upload to the server (through the URL, for example, though I'm aware there's a limit to URL length depending on what system you're using), then for the server to upload the pic to twitter.
Can't beat something being on top of the job........
Since twitter doesn't do photographs, you could use the beagleboard to host the pictures and just link using twitter. The beagleboard is little more expensive than an arduino + ethernet shield + SD card, and can handle a cheap USB camera.
Using a sledgehammer to crack a nut is way better than trying to demolish buildings with a nut cracker.
CowJam:
As for uploading it to twitter, you're going to need a web server to handle that. The picture will go camera - arduino - sd card - web server - twitter/twitpic. I haven't tried twitpic personally, but I think it's part of twitter and in that case the authentication is probably too complicated for the arduino to handle.
You will want a server which will allow your arduino to use a simple method to upload to the server (through the URL, for example, though I'm aware there's a limit to URL length depending on what system you're using), then for the server to upload the pic to twitter.
No need for a webserver, the arduino or mbed can do that fine! Also, when you upload a file over http, all your really doing is sending it in the url, its just hidden (its a post request). Its the same idea as twitter from the arduino, just a little bit more data.
bilbo:
No need for a webserver, the arduino or mbed can do that fine! Also, when you upload a file over http, all your really doing is sending it in the url, its just hidden (its a post request). Its the same idea as twitter from the arduino, just a little bit more data.
I thought the authentication twitter uses these days was a lot more complicated than it used to be?
It should be fine, I dont believe the arduino actually has to access that page. If you look at the curl syntax, its sending the request to a non-encrypted page, the https page is only part of the header (twitpic deals with it).
bilbo:
It should be fine, I dont believe the arduino actually has to access that page. If you look at the curl syntax, its sending the request to a non-encrypted page, the https page is only part of the header (twitpic deals with it).
I came to that conclusion too. I might have a play later in the week.
wow...thanks everyone for all the feedback! gave me a lot to research...i'm sure i'll have many more questions that i'll post later in the forums once i get started.