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
Apr 27
DIY Robocars via Twitter
Apr 27
DIY Robocars via Twitter
RT @f1tenth: Sliding (autonomously) into the weekend like ... 🤖😎 #f1tenth #robots #AutonomousVehicles @OpenRoboticsOrg @NVIDIAEmbedded @Aut…
Apr 25
DIY Robocars via Twitter
RT @chr1sa: One of the problems with autonomous car racing is that watching software drive is not a very exciting spectator sport. To help…
Apr 25
DIY Robocars via Twitter
RT @SmallpixelCar: Replaced AGX Xavier with @NVIDIAEmbedded Jetson Xavier NX. Now both cars look fast and clean https://t.co/jlcoY2EjZf
Apr 25
DIY Robocars via Twitter
RT @chr1sa: Yesterday we had a record number of competitors (36) in our monthly @DIYRobocars virtual autonomous car race. We kept it going…
Apr 25
DIY Robocars via Twitter
Apr 16
DIY Drones via Twitter
RT @chr1sa: After more than a year of only virtual races, @DIYRobocars returns to the newly renovated @circuitlaunch on May 22 for the resu…
Apr 11
DIY Robocars via Twitter
RT @DAVGtech: And now available with LiDAR 🔥 https://twitter.com/Heavy02011/status/1381137016381964293
Apr 11
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #9 - #ParkingLotNerds #thunderhillracetrack, CA Join us for the next race April 24th,…
Apr 11
DIY Robocars via Twitter
RT @DWalmroth: Weather's finally cooperating, looking forward to racing 1:10 scale autonomous cars outdoors again! @diyrobocars, @NVIDIAEm…
Apr 7
DIY Robocars via Twitter
RT @AIDRI_: I finally succeeded in optimizing the trajectory and speed of a car on a #racetrack. Next step: implement a 2d controller and…
Apr 7
DIY Robocars via Twitter
@jetdillo @circuitlaunch Actually the second *in person* event in a year. We do virtual races every month
Apr 2
DIY Robocars via Twitter
Update: we're moving it back one day to Sunday (the 4th) at 11:00am instead
Apr 2
DIY Robocars via Twitter
@GrantEMoe @circuitlaunch Update: we're doing it on Sunday (4th) at 11:00am instead
Apr 2
DIY Robocars via Twitter
RT @chr1sa: Maybe we should have a mini @DIYRobocars race in our lower school's playground https://t.co/xLFeua1R6X
Mar 29
More…