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 –

Replies

            • That's pretty much what I would have expected to see based on basic transistor theory.

              • So, I have the circuit built, and without the camera connected the LED glows dimly, and I measure 0.32V at the usb connection. When I use the "trigger camera now" function the voltage jumps to 0.50V and the LED glows brighter. Should I be seeing 5v at the usb connection? or do I need the camera connected first?

                • You should see almost 5V at the USB connection. You don't need to connect the camera.   Please draw and post another diagram - this time of the exact circuit you constructed?

                  Also,  try the original circuit (without substitutine the LED and 1K resistor). Looking at it now, you probably need to increase the current into the transistor base in order to get enough drive through the LED as you will be trying to pull a lot more current there than before.   If the circuit works without the LED's we can play with the value of R1 a bit next.

                  • Success :) camera can now be remotely triggered!
                    I notice every time I played with shutter duration it resets the trig_type and I have to change it back. That's a weird bug.

                    IMG_20150907_151845.jpg

                    IMG_20150907_153015.jpg

                  • Hi Thorsten,

                    Yep I have a bec plugged in on the output rail giving 5v. I run a lidar-lite this way.

                    A little frustrating the issue is not hardware or circuit related but settings within the pixhawk is what has given me the headache!

                    Anyway, glad to have it sorted now and an easy fix is always the best!

                    Just need to test with the camera...

                  • T3

                    Sandy,

                    do you provide 5V to the output rail of the Pixhawk form a BEC?

                    Best regards,

                    Thorsten

                  • I get readings of 0.28 doing nothing and 0.45 when triggered. Perhaps it is a setting in the pixhawk I need to change? I have changed the trig type to relay (1) and channel 7 is set to camera trigger and the camera shutter is set to RC10 (Aux2). The relay pin is set to 51. I have also tried changing the camera shutter to transistor to no avail but I am not getting 3.3V output on the signal line from pixhawk...

                    EDIT: Ok so that was my issue - channel 10 needs to be set to camera trigger not channel 7 in my case... I see 5v now :-)

                  • Did you try the original resistor values without the LED ?

                    If you want to use the LED,  drop the value of R1 to something between 6K and 10K.  That will get you a lot more current through the LED & R2 and a bigger voltage drop.

                  • Here is the circuit - It is the same as the link you sent me. I don't seem to be getting enough signal through. I have a 220K resistor on the 3.3v signal line from pixhawk (white cable) going to the transistor base (middle pin), and a 1000K resistor in series with the led across the + and - of the usb cable...3702946521?profile=originalOn the left red is 5v, black is earth and white is signal - on the right red is + and black -.

                    Drawing:3702946461?profile=originalTypo in the drawing - I labelled it 1000K but it is actually 1K.

      • Fantastic! Thanks Walter. What is the advantage of having the BC557?

This reply was deleted.

Activity