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 @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27, 2022
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24, 2022
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24, 2022
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24, 2022
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24, 2022
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20, 2022
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8, 2022
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23, 2022
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23, 2022
DIY Robocars via Twitter
Oct 23, 2022
DIY Robocars via Twitter
Oct 19, 2022
DIY Robocars via Twitter
Oct 18, 2022
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13, 2022
DIY Robocars via Twitter
RT @araffin2: 🏎️ After hours of video editing, I'm happy to share a best of my Twitch videos on learning to race with RL. 🏎️ Each part is…
Oct 13, 2022
More…