Driving the “808” keychain camera with a microcontroller

I’ve been playing around with the “808” keychain video camera. This is a tiny digital video recorder that captures very good quality video, yet sells for less than $15, shipped! (Try eBay.) That includes an internal LiIon battery, recharged via the USB port, but not the microSD card you need to buy separately. (My hat is off to the Chinese manufacturers – how they can do it at that price I don’t know.)

Quite a few of the flyers in the local CMASS rocket club have been attaching these to model rockets (using high-tech attachment methods like masking tape or velcro) to get in-flight videos.

Chuck Lohr’s wonderful site at http://www.chucklohr.com/808/ is the place for technical information on this thing – this posting is my little contribution to the cause.

The “808” keychain camera
(image courtesy of http://squeezebuck.blogspot.com/2011/02/cheap-keychain-spy-dvr-camera-808-8.html)

I’ve been working on installing mine (a so-called #3 type – see Chuck Lohr’s page) in the electronics bay of my GPS-steered rocket recovery system, to take videos of the parachute deploying and being steered in flight (plus, it’s cool).

Since a high-power rocket will sometimes sit on the launch pad for 30-60 minutes before flight, I need a way to turn it on with my on-board microcontroller at launch time.

This technique should work with any microcontroller that runs on 3.3 volts (the same voltage as the logic in the camera). The specifics apply to the #3 type camera, but the general idea will probably work with the others as well.

If you open up the #3 (carefully, avoid stripping or cracking the delicate plastic screw holes), the side of the board with the buttons looks like this:

“808” keychain camera, type “#3”, button side
(click image for larger version)

I’ve marked four positions on the board, you want to solder wires onto these:

  • The right side of the capacitor near the left end of the board. This can be used to monitor whether the camera is turned on. When there is 3.3v on this cap, the camera is turned on. When there’s 0v (ground), it’s off. Connect this to an input line on your microcontroller.
  • The lower right connection on the power button. This controls when the power button is pressed; connect it to an output. Driving this pad low (0v) presses the power button, driving it to 3.3v releases it.
  • The upper right connection on the mode button. This controls when the mode button is pressed. The voltages on it are the opposite of the power button: 3.3v presses the button, 0v releases it.
  • Note there’s a place at the top right of the board for another SMD LED. I soldered a green one there to see what it would do – it lights up when the board is connected to a live USB port.
  • Last, you’ll need a ground connection. I found the best place to be any one of the four tabs that attach the USB connector (on the other side of the board, not shown). Just add a blob of solder and attach the ground wire.

[Update 2011-07: Since I wrote this posting, I got a 2nd “#3” camera on eBay. This one appears identical externally and functionally, but internally has a newer PCB. Driving it is identical, except that the mode button has opposite polarity – 0v is closed, 3.3v is open. YMMV.]

Once you’ve got at least the 3 minimum wires connected up (power button, mode button, and ground), operating the camera is a simple matter of software.

To take a movie on the #3 camera (others may vary), press the power button for 1.3 seconds to turn on the camera. Then release it and wait 4.5 seconds. Then press the mode button for 3.0 seconds. The camera will start recording a movie.

To stop it, just turn off the camera by pressing the power button for 1.3 seconds again. [Update 2011-07: A better way is to press the mode button for 200 mS.]

These times are the minimum values I found would work reliably. Note that if you wait more than about 40 seconds between pressing the power button and the mode button, the camera will turn itself off, and you’ll have to start over.

Here’s my modified 808, ready to connect up to the microcontroller – I can still press the buttons with a little screwdriver.

Modified 808 camera, all buttoned up.


Update, September 2013:

Lately I’ve had a few people ask me for the source code I use to drive the camera, so here it is: videoCam.zip.

It’s pretty self-explanatory, but the idea is that you call InitVideo() once to initialize it, then call ManageVideo() periodically (at least every 100 mS or so) to manage the camera. The global “Video” tells it if you want to be recording or not.

It’s implemented as a simple finite-state machine.

Post any questions here; I’ll try to answer.

11 thoughts on “Driving the “808” keychain camera with a microcontroller

  1. I’d like to know more specifics about the microcontroller. Where was it purchased, ease of programming.

  2. Can you show a more detailed picture of the connections? All I want to do is to take a picture using a separate manual switch on a long leash. Can I just connect the ground and then another to the mode button?

  3. Chris,

    Click on the photo and you’ll get a much larger picture.

    If you just want a long leash, solder your own switches (at the end of the leash) onto the switch connections in parallel with the existing switches. It’ll work fine.

    –Dave

  4. I’m thinking of using an arduino as a uC for the camera.. however i have a few questions.
    Are you using the same power source to power the uC and the camera or does the camera still uses its internal battery?
    If i want to have different power sources (one for camera and another for arduino) the best way to hack the pressbuttons is using opto-isolators, right?

    thanks

  5. I’m still using the internal battery. The camera runs at 3.3v and the MCU runs at the same voltage, so no optoisolators are needed.

    As long as the ground is common (I just connected them with a wire), it’ll work the way I posted.

    Good luck!

    –Dave

  6. Hello. I found this just now via Google… don’t know if its still being monitored for posts. If you are reading this, I was wondering if you have any ideas about taking the SD data to the micro too? What I’d really like to do is control 2 (or more) of these via a central board that a) synchronizes the start/stop of the 808s and b) stores the files on a single storage medium rather than an individual microSD on each one. I’ve got 4 on their way to me but thought I’d see what your thoughts were in the meantime. Thanks.

  7. Hi Steven,

    Synchronizing the start/stop is easy – just make sure all the cameras are the exact same model and exact same firmware (otherwise they may have slightly different timing). You should be able to drive them all with a single pair of pins – just connect them all in parallel.

    I’m not sure why you want the video on a single medium instead of on the separate microSDs; it’s easy to take the video off the SD card afterward and move them to one storage device. Given that the innards of the camera are undocumented, I think it would be quite challenging to get the data onto anything other than the microSD in real-time.

    If you really want to do that (for some reason I don’t understand), I think I’d make an interface that emulates a microSD card, insert one of those into each of the cameras, and have that interface output a data stream that you can store on some separate medium.

    It sounds like you’re doing something interesting – I’d like to know more.

    Cheers,

    –Dave

  8. Hello,

    please correct me if i am wrong. Is this mod for turning camera on/off, start/stop rec, edit mode… with an GPIO Port for example.

    I have a LinuxBoard connected a key chain cam and stream it over network, so a wifi key chain cam. But every time need to press button to turn it in webcam mode.

    If i understand it right, it is possible pressing the buttons with the GPIO Output-Port. I know about possibility to read-out buttons with GPIO Input-Port, but this is new for me.

    Hope to clarify my doubts about.
    Thanks and best regards
    Cheers
    Rudi

  9. Hi Rudi,

    You understand correctly – this is about turning the camera on/off, etc. via some GPIO outputs.

    I’m curious – which key chain cam are you using that outputs a stream over the network? The one I’ve been using only records to a micro SD card; it won’t stream in real time.

    Regards,

    –Dave

  10. Hi Dave,

    i am using #16 V2 and connect to carambola´s usb port http://8devices.com/
    By pressing power button for 2 sec the cam goes to webcam mode. With mjpg-stream for openwrt is possible streaming over network. Not possible to stream and store to SD.
    And streaming is in mjpg-format instead of h.264 on SD
    For more information visit 8devices wikipage or community forum.

    Cheers
    Rudi

Leave a Reply

Your email address will not be published. Required fields are marked *