Connect up the camera like this:
Visit the Github repository here. To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_VC0706. Check that the Adafruit_VC0706 folder contains Adafruit_VC0706.cpp and Adafruit_VC0706.h Place the Adafruit_VC0706 library folder your arduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.
If you're using Arduino v23 or earlier, you'll also need to install the NewSoftSerial library. Download it by clicking this link and install it as you did the Adafruit_VC0706 library. Arduino 1.0 has this built in now (called SoftwareSerial)
Taking a Snapshot
OK now you're finally ready to run the snapshot demo. Open up the Arduino IDE and select File-> Examples-> Adafruit_VC0706-> Snapshot sketch and upload it to the Arduino. Open up the serial monitor and you can see the sketch will take a 640x480 photo and save it to the microSD card. You can then pop the card into your computer to see the JPG file// This is the camera pin connection. Connect the camera TX // to pin 2, camera RX to pin 3 NewSoftSerial cameraconnection = NewSoftSerial(2, 3);
// Set the picture size - you can choose one of 640x480, 320x240 or 160x120 // Remember that bigger pictures take longer to transmit! cam.setImageSize(VC0706_640x480); // biggest //cam.setImageSize(VC0706_320x240); // medium //cam.setImageSize(VC0706_160x120); // small
Detecting Motion
A neat thing that the camera has built in is motion detection. It will look for motion in the video stream and alert the microcontroller (by sending a serial data packet) when motion is detected. IN this way you can save a bit of cash and skip on having a PIR sensor (although a PIR sensor will be better at detecting warm mammalian things).Load up the File-> Examples-> Adafruit_VC0706-> MotionDetect sketch and upload it to the Arduino. It will take a photo immediately because it just turned on. Then wait a few minutes and wave you hand in front of the camera, it will take another photo.
// Motion detection system can alert you when the camera 'sees' motion! cam.setMotionDetect(true); // turn it on //cam.setMotionDetect(false); // turn it off (default)