Using AUX pins as relays for CHDK

I'm confused and a bit frustrated, would appreciate any help as I'm not sure how to proceed.

Setup: I have a pixhawk autopilot running Arduplane 2.77, using Mission Planner 1.2.95

I've been following this guide to get my CHDK enabled camera working with my pixhawk. I'm interested in getting the camera triggering based on distance traveled.

Obviously the guide was written with APM in mind, so it needs to be adapted a bit for pixhawk; specifically the setting for RELAY_PIN. I've kept the rest of the settings the same as in the tutorial.

Pixhawk has 6 AUX ports according to the quick start guide, I am assuming that the numbers above the pins correspond to the AUX port numbering. When you mouse over the RELAY_PIN parameter, it says that pin 54 corresponds to Pixhawk FMU AUX1.

Tried setting RELAY_PIN to 54, no joy. Did a bit more looking, discovered in the release notes for 2.77: 

"Improved relay code
The relay and servo set code has had a major overhaul, with up to 4 relays now supported for MAVLink control and much better support for the DO_SET_SERVO, DO_SET_RELAY, DO_REPEAT_SERVO and DO_REPEAT_RELAY MAVLink commands. Along with these changes is a new parameter BRD_PWM_COUNT which allows you to specify how many auxillary PWM outputs to enable, with the remaining outputs being available as digital relays. This allows you to re-assign some of the aux servo outputs on Pixhawk for use as relays, by setting the RELAY_PIN, RELAY_PIN2, RELAY_PIN3 and RELAY_PIN4 parameters. The pin numbers for these pins start at 50 for the first aux servo pin, and go to 55 on Pixhawk."

Additionally,I found this github issue about this same problem that states that the Pixhawk can't trigger CHDK because its relay pins operate at 3.3V instead of 5V.

So i suppose my specific questions are:

1) Is AUX1 pin 50 or 54?

2) Can anyone confirm that the relays, when working properly, won't be able to trigger CHDK?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


      • Developer

        Here the S2 multiport pinout:

         0 0 0 0 1 1 1 1 1 1  
        6 7 8 9 0 1 2 3 4 5
        \ /
        1 2 3 4 5

        USB connection:

        01 VBUS (+5Vin, max <2A)
        02 D-
        03 D+
        04 USB_ID
        05 GND

        Multiport connection:

        06 +3.1V (LANC_DC)
        07 res.
        08 res.
        09 res.
        10 res.
        11 Focus
        12 Shutter
        13 n.c.
        14 GND
        15 res.

  • Ok guys who knows this info ?

    I have been trying to find out how much load (current in ma) the aux pins can handle .. I have been sourcing some micro relays that are very tiny and can be easy for people to make and will work with Apm and Pixhawk without the need for the transistors and resistors and I need the info .. I tried to look here ( )  but no info on this page . perhaps it should be added for all boards?  

    Pixhawks 3.3v Aux digital signal line max milliamps 

    Apm 5v signal lines Max milliamps  

    • Looking at the STM32 F4 data sheet page 77 and not the schematics of the pixhawk it is either 25mA on 3.3v or 5 mA on 5 volt tolerant pins. The APM with the Atmel 2560 mega can handle 40mA per the data sheet page 367.

      Regardless of which one you go with they can't handle very much current. I would look into using relay switches you can buy fairly inexpensive which work off the 3.3 pwm signal. You need to make sure there is 5 volts provided on the servo rail. I would provide this with a separate 5v power source such as a SBEC or UBEC.

      • Thanks Rob ..

        I have found some tiny relays avail in 500ma contact rating and 6ma coil rating .. also some 1amp contact rating and 16ma coil rating .. It might be easier for people to use these to make their trigger cables.

        see compared to a mini relay and a servo plug.


        • I did also find this on page 92 ..

          seems its true the I/O pins can only take 25ma max.


  • Hi..

    I have built Marco's circuit, but it didn't work to trigger the Camera with Pixhawk

    I measure Signal pin voltage after plugged in the circuit was 0.0 volts, then I push Trigger Camera Now from MP the voltage jump only to 2,.. volt. If the circuit didn't plugged in, signal pin have 3,..volt. Is that normal?

    In MP, I have set :

    • CAM_TRIGG_DIST: 3 (indoor test)
    • RELAY_PIN: 54

    If there's something wrong with CHDK setting ?


    • Maybe I have solved accidentally way :)

      No need any circuit... just connecting red cable from USB to (+) pin and black cable to Signal pin in AUX port. I have tested it and  can trigger camera based on distance....

      • Hi..opiq

        I want to  trigger my camera with Pixhawk by CHDK such as your method.

        So, I try to make a cable myself such as attach files. Is that right?

        And the setting of MP is 

        • CAM_DURATION: 1
        • CAM_TRIGG_DIST: 2
        • CAM_TRIGG_TYPE: 1
        • RELAY_PIN: 54

        And the connection of Pixhawk and my canon S100 also like attach files.

        actually, I am not sure whether the connection is right or not...

        The script of CHDK I use is E38_APM.bas.


        The camera still cannot work, no matter how I try to do!!

        Is there something wrong with CHDK or MP setting?

        Is there something still need to set I ignore?


        2015-04-01 12.00.27.jpg

        2015-04-01 12.01.46.jpg

        2015-04-01 12.02.03.jpg

      • This is a very bad idea you could blow the board ..or cause it to brown out and you will crash, The signal pin on the Pixhawk is only 3.3v signal line and must not take a high load, you must use this circuit i have provided ..


        • This reply was deleted.
          • Hi For Canon use this one 


This reply was deleted.