Photography options for the Arduino are few and far between. Webcams aren't practical for applications like kite photography or public photography, unless you feel like buying a 200 foot USB cable. And current techniques for stand-alone Arduino photography typically try to capture raw image data from CMOS cameras popped off of cell phones...and believe me, unless you need to digitally upload or alter those photos in real time, you don't want to go down that road. Why isn't there a normal, cheap, run of the mill digital camera that's controllable by Arduino? 

Turns out there is at least one - and they sell it at your local drug store (CVS/Rite-Aid/Walgreens/etc.) 
It's those chintzy little keychain cameras that they sell for $10-15 a pop. The photography on them isn't half bad with a resolution of about 300 by 200, they can store between 20 and 240 photos (depending on the one you find), and it turns out the little guys were just made to be hacked. You can also do this same hack with a cheap 1 or 2 megapixel camera that takes SD cards if needed (see below), but we'll be stepping through the process used on the more commonly found 300 by 200 cameras.

This Instructable will walk you through the process of disassembling, modifying and reassembling an off-the-shelf keychain camera. It will then walk you through wiring a simple set of transistor switch circuits that can be used by Arduino to turn the camera off and on and snap photos whenever your program desires. It'll also have sample code and plenty of pretty pictures.

Before we start, a few notes: 

*The camera being hacked may change from blue to silver and back in the photos. Don't fret, the internals of both cameras are the same (I'm working with both at the moment for research.). This same camera is sold across the country in different colors, under different brand names and even with slightly different physical casings.

*If this technique sounds familiar, it might be because what we're doing to the camera itself is very similar to the technique used by the CatCam, a project that went viral two years ago by putting small, time-lapse cameras on the collars of outdoor cats and watching where they go. The CatCam's technique uses a camera that's not easily available in the United States, and was written before Arduino really took off - hopefully this revisiting of the technique will help the DIY community rediscover and repurpose it in their projects. I discovered the CatCam as this project wrapped up, and both techniques were developed independently - so my technique likely varies from the CatCam technique; feel free to pick and choose techniques from the two.

*If you are outside the US or willing to order directly from CatCam, the hackable camera they sell is of a higher quality - 1 or 2 Megapixel - and can save photos directly to an SD card. Very nice for many projects (but not necessary for all.) But if you want a camera today, head to any Rite-Aid, CVS, etc and pick up the camera shown here - a Digital Concepts camera, usually distributed by Sakar international.

*My research actually has me controlling this camera via a stand-alone ATMega chip. If you're interested in learning that technique for some reason, let me know - if there's enough interest I'll whip up another Instructable. (I figured there'd be more demand for doing it via Arduino.)

UPDATE: By request I've added the circuit diagram to wire the stand-alone ATMega chip to the chip as the last photograph below. It won't be helpful for many of you, and I apologize for that - I hope to give this step its due diligence - but for those who are determined, it's better than nothing (I hope). 

*This technique is being documented as part of my research at Carnegie Mellon University's Master of Tangible Interaction Design program, in Pittsburgh, PA. If you are considering going back to school, enjoy making things and are interested in the intersection of technology and design or art, drop us a line! :)

Hope you found this helpful - comments on both technology and application are welcome! Feel free to write me directly or comment if you have any questions or want any clarifications.

Step 1: Assemble Supplies and Tools

You'll need a few tools and supplies before you can hit the ground on this Instructable. Let's run through them now, shall we? 

*A tiny Philips-head screw driver. (About the size of one you might use to repair glasses, or in a computer repair kit.)
*Helpful, but not critical if you have long fingernails - a tiny flat-head screw driver to use as a plier.
*Wire cutter/wire strippers
*Helpful, but not critical - multimeter.
*Soldering iron and solder. (Now, now, don't fret. All you'll have to do is heat up some existing solder and stick a few stripped wire ends into the existing connections. Only rudimentary knowledge of soldering necessary. You might even be able to get away with wire glue on some models, but soldering is safer.)

*An off-the-shelf Keychain Digital Camera. Often sold under the brand names "Digital Concepts" or "Shift." Sold at CVS, Rite-Aid, Walgreens, some Walmarts, and all over the Internet.
*Helpful but not critical - a few spare AAA batteries. The camera should come with one AAA battery. But if you intend to use your project more than a few times or over long periods of time, you'll need spares - the camera eats them.
*A few feet of insulated wire. (Either normal-gauge plastic insulated, shown, or thin-gauge paint insulated is fine - both have their pros and cons; I tend to use paint insulated because I sometimes make custom male headers for my connections.)
*Breadboard or other protoboard.
*Two longish pieces of white wire (for connecting transistors to Arduino)
*Two longish pieces of black wire (for connecting ground from Arduino to breadboard)
*Two longish pieces of red wire (for connecting high power from Arduino to breadboard)
*Helpful, but not critical - an LED (for debugging output).
*Two transistors (I use NPN 2N3904 transistors.)
*An Arduino with USB cable.

Step 2: Crack Open and Disassemble the Keychain Camera

First things first - you start off this hack by taking your screwdriver and fingernail/pliers to this camera and taking it apart. In the images notes below, you'll see a step by step dissection of the camera - I'll point out where each screw is located in the image notes. When your camera is disassembled and looks somewhat like the last picture (albeit with more pieces), continue to Step 3.

Step 3: Hack the Camera Part I (Solder Into the Switches)

This is the hardest part of the hack - but it's not *that* hard, I swear. So take a deep breath and let's get soldering!

For this hack, we will be leaving the camera circuit board entirely intact. All we will be doing is soldering our own connections into the circuit board on either side of the push button switches used to operate the camera. This allows us to use our Arduino to digitally "push down" on each button whenever we wish (via external transistors acting as switches). 

When handling the circuit board, try to handle it by its edges whenever possible. The circuit board is fairly sturdy, but at the end of the day it is still exposed electronics, and it's worth not touching it directly any more than necessary.

Cut and strip the ends of four pieces of wire, each at least a foot in length. (Better longer than shorter in this case; this isn't something you'll want to redo too often.) Then, look at the two pairs of solder joints pointed out in the picture below, one pair around each of the two pushbutton switches. Using the continuity/short circuit function on your multimeter, you can confirm you've found the right pairs of joints to solder into by holding the ends to both switch joints and pressing the button manually to see if that creates a short between the joints. If it does (the resistance between the two drops from infinity to close to zero) you've found the right two. If you don't have a multimeter, you can just take a deep breath and trust the picture.

Once you're sure you've found the right joints, using your soldering iron, melt the solder at each of these four joints and attach an end of one of the four wire pieces into each of the four joints. If you have a helping hand on your soldering setup, by all means use it to hold your circuit steady (placing a small, folded piece of newspaper between the clamps to protect the circuit board.)

Step 4: Hack the Camera Part II (Solder a Ground Connection)

You just completed the hardest part of this hack - congratulations! That said, you've got one more (easier) solder joint to make. This one you'll need some fresh solder for. 

NOTE: Please ignore that in this picture, the circuit board is inside of the plastic front case. Don't do what it looks like I'm doing here - please solder this connection BEFORE putting the circuit back in its case, to avoid accidentally melting the plastic case. (I was simply sloppy in photographing this step and will try to fix it later.)

Take a fifth piece of wire, and cut it to at least a foot in length with edges stripped. Ideally, this piece of wire should be colored black, or at least differently from the first four. Now, solder one end of it to the outer side of the ground end of the battery holder, as shown. You'll need to add your own solder to this connection and solder directly onto the metal here. I've found this to be much easier than attempting to add your wire to the existing solder holding the battery holder to the circuit board. (I'll point out the right and wrong ways in the photos.) 

Why are we doing this? Well, for an Arduino-controlled transistor to be able to control the switches on the keychain camera, the Arduino circuit and the keychain camera circuit need to share a common electrical ground. This wire simply lets you physically connect the camera's ground to the Arduino's ground later, via a common row on the breadboard.

Step 5: Hook the Camera to Your Arduino

Now it's time to start hooking your camera up 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!

Step 6: Take Pictures!

Plug a AAA battery into your camera. It should beep and turn on.
Wait 30 seconds for the camera to turn off. (The code I've included assumes the camera is already off when it is run, and will turn your camera on for you.)
Now, position your camera and Arduino for your desired viewing angle and turn on your Arduino. Voila!

Maybe you're asking - this camera is a little unwieldy, with an Arduino and breadboard and all. Can't we make this a little more compact, to take pictures from pretty much anywhere we want ?
The good news is, it can! This was designed for use as a stand-alone circuit, using the Atmega pulled off of an Arduino, on a single camera/circuit object which can be placed anywhere. I've included a picture of that setup below as well - and if folks are intrigued by it, I'll work on another Instructable or at least add the Eagle files to this page for others to work from. Just let me know!

Hope you found this helpful - comments on both technology and application are welcome! Feel free to write me directly or comment if you have any questions or want any clarifications.

<p>what kind of usb cable is this?</p>
Great project. So is there a mini-usb port on these little cameras? <br> <br>Also <br>If you replaced the arduino with a raspberry pi or other tiny linux unit, is there a way to communicate with the camera and download the photos directly from the camera to the raspberry
<p>There is a usb port, but it is not a standard one. The cable comes with the camera. </p><p>Linux or Mac can download the photos via the cable with the program &quot;gphoto2&quot;. The commands are &quot;gphoto2 --auto-detect&quot; to see the camera, &quot;gphoto2 --list-files&quot; to see the images, and &quot;gphoto2 --get-all-files&quot; to download them.</p>
<p>is it okay of i use this kind of camera?I'm from the Philippines by the way.</p><p>http://www.lazada.com.ph/5mp-mini-digital-camera-video-recorder-536741.html</p>
<p>Can I add a micro sd storage board to this project?</p>
<p>cool project and nice instructable...</p><p>is it possible if Keychain digital camera changes to Webcam?</p><p>how to integrated between PIR sensor to auto capture if use a webcam?</p><p> could you help me explain more?</p>
<p>Driver found here</p><p>Only for Windows Xp</p><p>http://lib.store.yahoo.net/lib/shoptronics/MINIDSC16MB.zip</p>
<p>Hey smb! I just completed my instructable for a motion-sensing camera and alarm that I made from my electronics class. Following your instructions, I hacked my own keychain digital camera. It takes pictures whenever the motion sensor detects movement. My arduino is programmed to turn the camera on if it has been inactive for 30 seconds or more. If you'd like to see how your work helped me create my project, check out my instructable at </p><p><a href="https://www.instructables.com/id/Motion-Sensing-Digital-Camera-Alarm-aka-the-Critte/" rel="nofollow">https://www.instructables.com/id/Motion-Sensing-Dig...</a></p>
Nice project!! could you expand the circuit to take the photos with an infra-red sensor or a movement detector,it will make a good security camera!! let me know please!!
have spent the past week looking for Windows 7 drivers for these cameras. Wish I knew before my purchsse.
hi there, ive been wanting to do this for a long time with a Samsung L100 Digital camera, your instructible is very close to what i want to do BUT the only diffrence is my camera like most has the on/off button but the shutter and focus is in one button! now ive worked out that button (focus/shutter) works by shorting ground with focus (like a normal button) but then press it further and it shorts on more time to activate the shutter! <br> My question is can it be done and why a cheep camera and not something like what i want to do?
Great instructable. I found this one while reading the motion sensor camera that references you. I just ordered a few of these cameras and want to make some inexpensive security cameras for around the outside of my house. Any thoughts on attaching a solar battery and charger to the camera for power?
Anyway to keep the LCD Display...
Any resolution to the issues below? I'm new to Arduino and want to know if anyone has tried this with a ATtiny chip?
Is the newspaper for static discharge?
Did anyone ever find a driver? This is a great project - my first experience soldering. Thanks!<br><br>Ben
I have done all of the wiring and the camera was working fine until I tried to download the images to my computer. I installed the CD and it doesn't recognize the device. I've uninstalled, rebooted, done pretty much all I can think of. What more can I try?
Did you figure it out? I put an email in to the company, but no response (go figure) I may actually have to bite the bullet and call them! I really want this to work! The only thing that doesn't is the stinkin driver for the &quot;el cheapo&quot; camera! lol!
Same problem here. Must be a software issue? did you find a solution by any chance? BTW, this is an awesome instructible! Everything is documented quite well. THANKS!!! I'm wondering if I can use this on an old fuji finepix camera of mine?
Thanks for this awesome article! I was looking into the possibility of lifelogging with the arduino and realized that it's possible with something like this. A quick question though, what type of image does the camera output ie jpeg, raw, png?
Keychain cameras produce JPEG files, if memory serves.
The reason many of the &quot;keychain&quot; digital cameras eat batteries is that they store the images in cheap DRAM, not flash memory. They need to be always on. If the battery dies, so do your pictures, so plan on recovering them from the camera within an hour or two after you shoot them. If the application isn't weight or size sensitive, you could also rig up a HUGE external battery with alkaline D cells that could power the camera for days.
Excellent work ! I have one of these cams ...just need to find the time to hack it and try your code. <br> <br>Thanks! <br>Build_it_Bob
For some odd reason I&nbsp;can't view the pde file. I'll try to make one on my own though.<br />
&nbsp;i also can't view the pde file. can you help??????
&nbsp;Thanks for the fantastic Instructable. It worked like a charm :D<br /> I now&nbsp;understand&nbsp;transistors too.<br /> Jon
Great idea! I have two of those exact cameras (blue and silver) that I got for about $6 each. I do have one question though as I am a bit new to transistors. Would any NPN transistor work? I have a couple different ones just lying around that I have taken out of random electronic things and I was hoping I could just substitute those. Thanks!<br />
&nbsp;I suspect any NPN would work. One way to find out I suppose.&nbsp;:)
True, very true. Thanks!<br />
I love this instructable. Going to buy a keychain cam tonight. Can you add a schematic for the wiring of the arduino?
This is a great instructable. Really simple and easy to do, but still super cool.<br /> <br /> Another instructable, or maybe just an additional step, explaining how to build the circuit to use a standalone Atmega would also be helpful.<br />
Thanks! <br /> I should indeed.&nbsp;To start you on your way I'll at least toss my EAGLE circuit diagram onto the last page. (Unfortunately, I can't seem to embed it in the comment - maybe I have to be a Pro member to do that.)&nbsp;That should help you on your way if you're already familiar with the <a href="http://www.arduino.cc/en/Hacking/PinMapping" rel="nofollow">Atmega-Arduino pinouts.</a>
I've been thinking of doing one of these myself. The camera I chose is by Vista Quest (as used by the Cat Cam <a href="http://www.mr-lee-catcam.de/cc_index_en.htm" rel="nofollow">www.mr-lee-catcam.de/cc_index_en.htm</a>).&nbsp; They make (or made) a couple of cameras that have no display for keychain use, but they have 3 megapixel capability, take videos, and output to an SD card, so you can take thousands of pictures or hours of video. Perfect for a kite cam.&nbsp; I picked up a few at Toys R Us, for about $30 each clearance.&nbsp; One other thing I&nbsp;thought about is taking the little beeper output of the cam and making it and input for the u-controller, so it would know when the camera had taken a pic and was ready for the next.<br /> <br /> Great job overall!&nbsp; Do you have a cat?&nbsp; or a kite?&nbsp; They also use these connected to a motion detector (Deer Cams, or wildlife cams).&nbsp; Lots of applications here...<br />
&nbsp;I actually did ran into the CatCam stuff as I was wrapping up this project (it's cited above somewhere, I think towards the bottom.) I could have avoided some mistakes reading his story first. :P&nbsp;It's good stuff.&nbsp;<br /> <br /> The VistaQuest camera looks swell, but I have yet to find any like it here in the US. I hit all of the major shops in Pittsburgh and chose to hack the Digital Concepts because it seemed the most commonly available. <br /> <br /> That said, I really do want one with all of the VistaQuest fancy specs. I wrote the CatCam guy directly, and he generously offered to get me a VistaQuest untouched from his distributor - but I'm opting to try first with a Vivitar, which currently seems to be a much more common option here in the US. (I picked up the Vivitar 5022, a nice 5MP with preview screen and SD card reader up to 8 gig for $30 on sale at Target this week. Moreover, they have plenty of Vivitars at Toys R Us.) <br /> <br /> The main downside is that the Vivitars take 3 AAA batteries, as opposed to 1 on the VistaQuest (probably to run the screen)&nbsp;- so the weight difference is significant, possibly too heavy for kite or kitty. I'd have to switch to a lithium ion (one protected from kitty bites at that) to reduce the weight before saddling flyers or felines with that thing.<br /> <br /> Using the beeping as an input to make a feedback loop is a slick idea. I'd love to see that in action - I think if each out immediately triggered an in, you'd get a picture about once every second or so. I wonder if you could literally pipe or otherwise hook the beeping straight to a transistor across the shutter and skip the chip all together? That could be a super quick, super cool kite camera construction trick if you're not picky about how frequently photos are taken.<br /> <br /> And no, I sadly have neither cat nor kite. Fortunately, I have friends with both. :)<br />

About This Instructable




Bio: I'm a technology designer currently studying Tangible Interaction Design at Carnegie Mellon University. I'm particularly interested in applications of technology to cities, on ... More »
More by smb:Hacking A Keychain Digital Camera for Arduino Control Using Copper Tape To Create A Digital Selection Pad 
Add instructable to: