Step 5Hook the Camera to Your Arduino
First, load some code that will control the camera to the Arduino.
Below, we've uploaded/attached some sample Arduino code that we've used here in order to take time-lapse photography. The code will turn the camera on, take a picture, and then delay for a full minute (during which time the camera will automatically power off) before powering back on and taking another picture - repeating this for twenty photographs (the capacity of my first hacked camera.)
Now, let's hook your Arduino to your camera.
First, a bit of explanation: to control the camera fully, our code takes two digital output pins and map one to the on switch, and another to the shutter switch. When the code wants to turn the camera on or off or switch modes, it briefly holds the camera on output pin high - and when the code wants to take pictures, it holds the camera shutter output pin high. This action is translated to the actual pressing of the button by turning a transistor on and off, which is in turn connected via our camera wires to the switches on the real camera. The grounds of the camera and the Arduino are linked to give the Arduino and external camera circuits a common ground, allowing the transistors to work properly.
Take two wires to connect these two output pins (camera on and camera shutter) to different lines on the breadboard. Then, connect the base pin of a transistor to each of the two outpit pins. Finally, connect your two wires for each corresponding switch from your actual camera to the other two (collector and emitter pins) of the transistor. You may have to experiment with which wire goes to the collector and which goes to the emitter in each pair; which is which will depend on the internal wiring of the specific camera you're hacking.
Finally, **and this is important**, take your ground wire from the camera and plug it into the ground pin on the Arduino. This is necessary for your transistors to work and thus for your camera to respond to your arduino!
CameraTest.pde2 KB| « Previous Step | Download PDFView All Steps | Next Step » |

















































You need to change the extension of the file once it has downloaded to a .pde and open with the Arduino developing environment.