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

            • Note my previous posts...using 1/8 watt 220k resistors works as well....I'm taking 5v off the receiver into the pixhawk main I/o rail.

              Relay duration is set to minimum @ 1/10 sec...works every time. Using KAP, I've got it set to instantly execute the script w/o delays etc.

      • T3

        Hi Theo,

        well, it seems you are right! Thanks!

        I checked my order and it is indeed 220 Ohms instead of 220k Ohms. I should better have double checked the colors.

        However, it is working... 

        Can anyone with some background in electronics comment on this - especially on the potential consequences?

        As a side note: this is working with the 5V provided by the AUAV-X2. So there is no additional BEC required to power the output rail (just bench tested). But I am a little scared now because of the R2 "shortcut". As R2 seems not to be required... 

        Cheers,

        Thorsten

    • Thorsten - I built the cable using the circuit board from OSHPark..soldered-up and connected to my Iris.

      Camera is a Elph 330HS with CHDK loaded...the script i'm running works if I plug a USB into a charger....it fires right off.
      I connected to AUX 5 and configured in MP per the forums etc.  I connected +5 and ground from the receiver channel 4 connector into position 8 on the "main out" area of the px4.

      Set Aux 5 to trigger via relay, set pin 54 as relay pin.

      Commanded a camera trigger from MP...nothing....

      Tthhe receiver 5v output provide enough amperage? I checked on my voltmeter...there is indeed 5v there.

      • UPDATE - I did not check the EBC layout on the transistors I bought (store said they were a replacement for the BC547)....and of course the notation in the vendor data on-line (NTE Electronics) said the EBC was 180 rotated from the BC547.

        So....built another cable and voila!  very slick.

        Here is my install...not elegant, but functional and it works. +5v from the receiver on the white/black leads into the main out bus on the PX4. Connected the CHDK cable onto AUX 5, set the signal to relay per my previous post. The circuit board is wrapped under some rather thick shrink tube ("its what they had"). USB cable from an old Motorola phone charger.

        3702718311?profile=original

        3702718144?profile=original

        3702718336?profile=original

    • Cheers Thorsten, I am happy I managed to help someone :o)  You can also use this to operate leds or other things you need to switch on and off ..current is only limited by the transistor specs, you can also increase the voltage supplied if you may need 12v ..

      • T3

        Hi Reuben,

        yes, thanks! :-)

        Previously, I used  Marco's design. It works great and reliable as well but the advantage of your circuit and ZaPf's layout is, that it has less parts and that you can order the board form OSH Park for $1.15 for three of them - which is perfect!

  • MR60

    Here now the correct circuit to trigger a Sony Alpha 5000 with one transistor (tested succesfully by configuring one of the Aux port as a relay):

    3702059444?profile=original(This is real live diy !)

    • Hi hugues i have some problems with your circuit. What is the usb pinout connection ?. Shutter and focus goes to V+?

    • Developer

      Nice job Hugues! ;)

    • Hi..

      Is this woks for RX100m2 ?

      Thanks

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @knightsautoteam: Hi @diyrobocars, we are Orlando's first Autonomous racing club and would love your support. We are hosting our first K…
12 hours ago
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #14 - #ParkingLotNerds join us January 15th for #AutonomousRacing #RoboRace ⁦@DAVGtec…
Monday
DIY Robocars via Twitter
RT @chr1sa: And after that came our races, 50 in all. This battle between these two Russians was the best we've ever seen -- incredible fig…
Monday
DIY Robocars via Twitter
RT @chr1sa: Before our @DIYRobocars virtual race this weekend, we had a presentation from the team that won the Indy Autonomous Challenge i…
Monday
DIY Drones via Twitter
Dec 12, 2021
DIY Robocars via Twitter
Dec 12, 2021
DIY Robocars via Twitter
RT @chr1sa: Just a week to go before our next @DIYRobocars race at @circuitlaunch, complete with famous Brazilian BBQ. It's free, fun for k…
Dec 4, 2021
DIY Robocars via Twitter
How to use the new @donkey_car graphical UI to edit driving data for better training https://www.youtube.com/watch?v=J5-zHNeNebQ
Nov 28, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Wrote a program to find the light positions at @circuitlaunch. Here is the hypothesis of the light locations updating ba…
Nov 26, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Broke my @HokuyoUsa Lidar today. Luckily the non-cone localization, based on @a1k0n LightSLAM idea, works. It will help…
Nov 25, 2021
DIY Robocars via Twitter
@gclue_akira CC @NVIDIAEmbedded
Nov 23, 2021
DIY Robocars via Twitter
RT @luxonis: OAK-D PoE Autonomous Vehicle (Courtesy of zonyl in our Discord: https://discord.gg/EPsZHkg9Nx) https://t.co/PNDewvJdrb
Nov 23, 2021
DIY Robocars via Twitter
RT @f1tenth: It is getting dark and rainy on the F1TENTH racetrack in the @LGSVLSimulator. Testing out the new flood lights for the racetra…
Nov 23, 2021
DIY Robocars via Twitter
RT @JoeSpeeds: Live Now! Alex of @IndyAChallenge winning @TU_Muenchen team talking about their racing strategy and open source @OpenRobotic…
Nov 20, 2021
DIY Robocars via Twitter
RT @DAVGtech: Live NOW! Alexander Wischnewski of Indy Autonomous Challenge winning TUM team talking racing @diyrobocars @Heavy02011 @Ottawa…
Nov 20, 2021
DIY Robocars via Twitter
Incredible training performance with Donkeycar https://www.youtube.com/watch?v=9yy7ASttw04
Nov 9, 2021
More…