BMOW title
Floppy Emu banner

RC Servo Signal Decoder for Camera Shutter Switch

Hey, I’m back. I think my oscilloscope made me do it. For the past six months I’ve been working with RC airplanes, not doing any electronics work. The oscilloscope has been taking up space on my desk while it sits untouched, gathering dust. Last week I finally decided I was never going to use it again, and packed it away in a closet. But that got me to thinking about electronics again, and about what kind of projects I could do related to RC. So after just a few days, the oscilloscope has returned from its closet banishment and is in use once more for a new project.

I recently bought an Aiptek SD 1.3 megapixel camera, with the idea to mount it on the fuselage of one of my planes, and do some aerial photography. The Aiptek weighs just 52 grams (about 2 ounces), and so it won’t weigh down the plane excessively. But the tricky part is finding a way to activate the shutter while the plane is in the air. It turns out that this is mostly a solved problem, and it’s possible to build a circuit to decode the servo signal from an unused receiver channel, creating a 0 or 1 pulse depending on the position of a transmitter switch or stick. Then by hacking into the camera guts and a bit of soldering, that pulse can be used to trigger the shutter.

Spektrum 6110 receiver with servo hacking harness connected

Here’s one of my planes (a GWS Slow Stick), with three spare wires hooked into the receiver’s “gear” channel (which I don’t normally use), connected to the oscilloscope and a growing circuit on the protoboard. It turns out that these servo signals for the channels are ideal for hacking with digital logic. Of the three wires connected to the receiver, one is ground, one is a regulated +5 volts, and one is a modulated position signal that indicates the desired position for that channel (rudder, elevator, aileron, flaps, gear, whatever). The connectors are even standard 0.1 inch male headers. What could be easier?

Slow Stick sevo decoder

I examined the servo signal with the oscilloscope. It’s a regular pulse train with a 22ms period. The width of the pulse varies depending on the desired position for the channel. The width is about 1.2ms at the minimum position, and 2ms at the maximum position. Taking 1.6ms as the midpoint, what’s needed is a circuit that outputs 0 if the pulse width is less than 1.6ms, and 1 if it’s greater than 1.6ms. This could be done many different ways: the first two that come to mind are a small microcontroller, or a low-pass filter that turns the servo signal into a DC voltage, and compares it to a reference voltage.

I’ve decided to follow another example I found, which I thought was especially clever. It uses just two flip-flops and a couple of passive components. You can check out the circuit schematic for the details. The servo signal pulse train is used to clock the first flip-flop. It’s D input is tied high. When it’s clocked, its Q output goes high, which begins to charge an RC circuit. When the capacitor voltage gets high enough, it activates the asynchronous reset, clearing the Q output. The complementary /Q output is used to clock the second flip-flop, whose D input is the servo signal. If the RC time constant is chosen correctly, then the second flip-flop will be clocked 1.6ms after the first one, sampling the servo signal at that time. If the pulse width is less than 1.6ms it will sample a 0, otherwise it will sample a 1. Pretty neat!

My only headache is that I don’t have the 4013 CMOS flip-flop called for in the circuit. I do have lots of 74LS74 flip-flops, which are similar, but are TTL designs with an active low asynchronous reset instead of active high. I’d thought it would be simple to modify the circuit to work with an active low reset, but after a couple of hours of futzing around with it, I concluded that it’s either not possible, or I’m just not smart enough. I started by swapping the positions of the resistor and capacitor, but the circuit initializes in the reset state and never exits it. And even if I found a solution to that, the input current on this LS series chip is so high, that with a 10K resistor to ground, the voltage at the input pin is actually pulled up to 2 volts! Ack! I decided I’ll just buy a 4013 for a few cents, and stop banging my head.

Read 5 comments and join the conversation 

5 Comments so far

  1. Jeff Hopkins February 21st, 2010 10:02 pm

    I do like that method for converting the PWM signal to digital logic…. I suppose it would be even possible to have it sample at multiple times to get several bits onto a single PWM signal. Granted it wouldn’t be as light once you had all the components for multiple bits, but still neat.

  2. Merlin Skinner February 26th, 2010 4:38 am

    I’m glad you made it work in the end. Pulling an LS input to 0V via a resistor is tricky due to the current required. 10K certainly isn’t low enough. You could have used a transistor and a couple of resistors as an inverter – there’s a nice example here: http://www.kpsec.freeuk.com/trancirc.htm#inverter. In practice, it’d probably work without the pull-up resistor, but I’d not guarantee it.

  3. Steve February 26th, 2010 7:02 am

    Cool. I did some RTL stuff like that ages ago. I did try values as low as 100 ohm for the pulldown with my original circuit, but never thought of trying a transistor inverter. But in the end, I was happy to spend 29 cents to get the CD4013 used in the reference design, and stop struggling with it.

  4. D McCreary August 5th, 2010 1:16 pm

    I wonder if juggling the RC time constant to compensate for the pulse rate of digital servos signals versus analog would result in it working on the digital hardware now being employed today. It’s worth a second look.

  5. TheLT May 29th, 2013 3:02 pm

    Wow! That schematic worked! Thanks!

Leave a reply. Comments may not be monitored regularly. For product support questions, visit the Contact page.