Talking to the camera

One of the best things about designing hardware yourself is that you have full control over exactly what you want the devices to do. Lately we’ve been figuring out what to do with the one piece of complex hardware that we didn’t design – the Canon SX100IS digital camera. Let’s just say that Canon’s engineers never imagined that anyone would be controlling the camera remotely from a normal PC, let alone an embedded board within a capsule that’s going up into the edge of the atmosphere.. Lucky for us, there’s a really dedicated group of Canon camera hackers out there that run an open-source project called CHDK, which sits on top of the Canon camera firmware and executes scripts that you write beforehand. These scripts can do a lot more than what you can normally access on the camera’s front panel. For instance, you can write a script to take pictures at certain intervals, choose flash settings, ISO, shutter speed, monitor the battery voltage – basically anything you want.

It sounds amazing, but the only problem with the CHDK is it still expects users to be able to press buttons on the camera and turn the scripts on and off! Obviously up at 100,000 feet there’s not going to be a human up there to press buttons, so we need some way to get our flight computer to talk to the camera. Unfortunately the camera won’t accept commands over the USB cable (we were hoping the CHDK would support this, but unfortunately it doesn’t). The other option, ripping off all the buttons on the camera and soldering wires connected to GPIO pins on our board, requires a lot of work to implement and means that we have to physically program in the button presses that correspond to the right menu options. Not fun. So we found a third solution…

There’s a function you can call from within the scripts called get_usb_power. Interestingly, it returns how long (in ms) power was applied to the USB port on the camera. Now, even though we can’t actually communicate over USB, there’s nothing stopping us from sending bursts of “power” on the Vcc line over the USB cable… and transmit data as a sort of “morse code” based on the pulse length! Old-fashioned, sure – but it works, and it’s elegant enough that it doesn’t require us to do things like dismantle the camera and solder wires to every button on the camera’s front panel. So to test this, we threw together a quick circuit with the trusty 555 timer chip to generate pulses which we’ll send to the camera:

555 timer circuit for "Morse code"

It goes to show that no matter what, there’s always some way to get a message through, even if it means using the USB power wire as a serial data cable. :)

  1. #1 by motorcycle insurance on May 3, 2013 - 1:04 am

    Generally I don’t read article on blogs, but I would like to say that this write-up very pressured me to check out and do it! Your writing taste has been surprised me. Thanks, very nice article.

  2. #2 by cannonInikonIphotographyIPhotography equipmentInikon dslrIslr cameras on December 7, 2013 - 1:25 pm

    I used to be recommended this web site by my cousin. I’m not certain whether this put up is written by means of him as nobody else recognize such designated about my trouble. You are incredible! Thank you!

  3. #3 by big bang on March 9, 2014 - 6:15 pm

    We are not confident the place you will be taking your information and facts, nevertheless good theme. We ought to shell out a long time finding out much more or understanding more. Thanks for excellent data I’d been looking for this info for my quest.

  4. #4 by Http://Pinterest.Com/Pin/243687029807640209 on June 6, 2014 - 4:26 pm

    Random Pictures from 2010

  5. #5 by Plati on September 6, 2014 - 12:46 pm

    Plolific の Web サイトを見ましたら、 が最新版ですね。ドライバは32bit/64bit 両方対応しているようですね。なので大丈夫かと。File NameRelease DateVersionFile SizePL2303_Prolific_DriverInstaller_v1.7.0.zip2012/08/011.7.04039.81KBWindows Driver Installer Setup Program(For PL2303 HXA, XA, HXD, EA, RA, SA, TA, TB veosirns)Installer veosirn Build date: 1.7.0 (2012-8-1)Windows XP (32 64-bit) WDM WHQL Driver: v2.1.35.211 Compatible with Windows 2000SP4 Server2003Windows Vista/7/8 (32 64-bit) WDF WHQL Driver: v3.4.36.247 Windows 8 Certified WHQL Driver Compatible with Windows Server2008/Server2008R2/Server2012 Driver also available via Windows Update (Vista, 7, 8). Refer to User Manual.

  6. #6 by on October 22, 2014 - 7:23 pm

    At long last, factors to neutralize Sunny Beach obviously comes with

  7. #7 by Beavis Butthead on October 27, 2014 - 6:38 pm

    The guys that run this website are total fart knockers.

  8. #8 by on January 11, 2016 - 5:21 pm

    I go to university in Canada and we just now are learning
    about this in class. Thank you for helping me with the final part of my report.

(will not be published)