Introduction: Hacking a Keychain Digital Camera for Arduino Control

Picture of Hacking a Keychain Digital Camera for Arduino Control

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

Picture of 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

Picture of 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)

Picture of 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)

Picture of 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

Picture of 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!

Picture of 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.


gibberfish (author)2017-02-24

what kind of usb cable is this?

onitreb (author)2013-11-06

Great project. So is there a mini-usb port on these little cameras?

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

AdamQ4 (author)onitreb2017-01-05

There is a usb port, but it is not a standard one. The cable comes with the camera.

Linux or Mac can download the photos via the cable with the program "gphoto2". The commands are "gphoto2 --auto-detect" to see the camera, "gphoto2 --list-files" to see the images, and "gphoto2 --get-all-files" to download them.

DyanD1 (author)2015-10-16

is it okay of i use this kind of camera?I'm from the Philippines by the way.

JasonR23 (author)2015-08-25

Can I add a micro sd storage board to this project?

PrimaA (author)2015-08-18

cool project and nice instructable...

is it possible if Keychain digital camera changes to Webcam?

how to integrated between PIR sensor to auto capture if use a webcam?

could you help me explain more?

claurusu (author)2015-02-14

Driver found here

Only for Windows Xp

RTGoldman made it! (author)2014-05-09

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

ferjanyen (author)2013-10-07

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!!

bottom-dragger (author)2013-09-12

have spent the past week looking for Windows 7 drivers for these cameras. Wish I knew before my purchsse.

peter6961 (author)2013-05-03

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!
My question is can it be done and why a cheep camera and not something like what i want to do?

Marcaine Art (author)2013-04-09

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?

gkern (author)2012-07-16

Anyway to keep the LCD Display...

Multhjoned (author)2012-06-14

Any resolution to the issues below? I'm new to Arduino and want to know if anyone has tried this with a ATtiny chip?

venzorc (author)2012-01-18

Is the newspaper for static discharge?

benashbe (author)2011-12-25

Did anyone ever find a driver? This is a great project - my first experience soldering. Thanks!


starvinartist17 (author)2011-11-15

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?

robonerd (author)starvinartist172011-12-08

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 "el cheapo" camera! lol!

robonerd (author)starvinartist172011-12-03

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?

magikid (author)2011-08-24

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?

pcooper2 (author)magikid2011-09-13

Keychain cameras produce JPEG files, if memory serves.

pcooper2 (author)2011-09-13

The reason many of the "keychain" 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.

Build_it_Bob (author)2011-04-12

Excellent work ! I have one of these cams ...just need to find the time to hack it and try your code.


EmptyFlash (author)2010-02-17

For some odd reason I can't view the pde file. I'll try to make one on my own though.

marthaaa (author)EmptyFlash2010-03-01

 i also can't view the pde file. can you help??????

jonnyboy323 (author)2010-02-13

 Thanks for the fantastic Instructable. It worked like a charm :D
I now understand transistors too.

NXTreme (author)2010-02-12

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!

smb (author)NXTreme2010-02-12

 I suspect any NPN would work. One way to find out I suppose. :)

NXTreme (author)smb2010-02-13

True, very true. Thanks!

mmalham (author)2009-12-28

I love this instructable. Going to buy a keychain cam tonight. Can you add a schematic for the wiring of the arduino?

Ora (author)2009-12-16

This is a great instructable. Really simple and easy to do, but still super cool.

Another instructable, or maybe just an additional step, explaining how to build the circuit to use a standalone Atmega would also be helpful.

smb (author)Ora2009-12-20

I should indeed. 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.) That should help you on your way if you're already familiar with the Atmega-Arduino pinouts.

exabopper (author)2009-12-20

I've been thinking of doing one of these myself. The camera I chose is by Vista Quest (as used by the Cat Cam  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.  I picked up a few at Toys R Us, for about $30 each clearance.  One other thing I 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.

Great job overall!  Do you have a cat?  or a kite?  They also use these connected to a motion detector (Deer Cams, or wildlife cams).  Lots of applications here...

smb (author)exabopper2009-12-20

 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 It's good stuff. 

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.

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.)

The main downside is that the Vivitars take 3 AAA batteries, as opposed to 1 on the VistaQuest (probably to run the screen) - 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.

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.

And no, I sadly have neither cat nor kite. Fortunately, I have friends with both. :)

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 ControlUsing Copper Tape To Create A Digital Selection Pad
Add instructable to: