Clarification of aux port "relay" function

I’m sorting through the relay function for a camera shutter. This is my first time since the changes in relay function since the Copter 4.1 and 4.2 changes.

As I understand the wiki docs - when the “relay” is LOW, no voltage is present between the Aux port signal pin and the ground pin - and the resistance is more or less infinite.

When the "relay: goes HIGH, it presents 3v or 5v between the signal and ground pins - depending on the flight controller.

When I connect a meter between the signal and ground - this what the meter shows.

In testing, when the “relay” goes HIGH, the voltage is only momentary. In fact, with my inexpensive meter, the voltage is present for such a short period of time, it doesn’t fully register.

Earlier today I thought I could get a steady 3V when the relay commanded HIGH (using the Mission Planner servo/relay control screen) but I can’t seem to make it do that now - not sure why.

While this function is called a “relay” - it seems to me it’s really more of a 3V/5V power switch - something that might momentarily activate a relay. To keep the relay in the activated state, the voltage would have to stay present when the “relay” is HIGH.

When connected to a circuit of the right polarity, this can appear as a “relay” because it allows current to flow - along with the voltage the Aux port presents. This is how it’s working when I have my camera shutter leads connected to the Aux port for that relay.

I’ve searched the WIKI docs for a more detailed description of how this functions, but can’t seem to find anything.

Is there such a document? If now - I’d appreciate comments that help me fully understand the “relay” function.

Thank you!

It is using a GPIO as a GPO so you should threat it as microcontroller output with fairly limited current capabilities. Driving small transistors or MOSFETS is fine putting a meaningful load on it is not.

Thanks - that confirms what I suspected.

It’s not really all that important, but I’m curious why the terminology is “relay” - as the states aren’t just “open” and “closed”.

I haven’t had the occasion to use them, but I have some semiconductor activated relays on my parts shelf that may work perfectly when I need a relay that handles significant load.

I don’t know why the name was chosen but I would expect it to be related to Arduino times heritage. Besides using a voltage controlled switch (a relay or nowadays a MOSFET) is a standard way of dealing with switching anything other than very small loads.

Mavproxy uses HIGH and LOW which is appropriate for GPIOs.

I used one of the AUX ports on a cube black to drive MOSFET controlling a LED (IIRC 200-300mA) worked like a charm.

I like knowing the history of things - it often helps fit the puzzle pieces together.

When the first of the recent changes to relay function (version 4.1??) I had Naked GoPro with a Aux port controlled shutter. That was the last time I looked into all this. As I recall, there was an issue with how the relay functioned when the firmware booted up. The result was that the GoPro’s shutter was activated when the ArduPilot firmware booted up. One of the DEV’s (@rmackay9 as I recall) mentioned that there’s something in the bootloader that caused this. He reported that he thought it was done that way a long time ago for some reason, but couldn’t recall what that reason was. And because it’s in the bootloader, it can’t be simply changed in the ArduPilot firmware code.

As it happened, I was using the Naked GoPro to record video - so the video would just start recording when the copter booted up. Frequently I just left it on - and edited out the first couple of minutes before takeoff.

In my present project I’m using the Aux port relay to control the shutter of a Foxtech Map-02 (a naked Sony A5100) - and it’s working fine in manual operation. I hope it works as well with 1-second or less shutter intervals on mapping missions.

One of the reasons I think it’s important to make the distinction about how the Aux port relay functions is that because it’s applying voltage, polarity may be an issue. I think that’s the case for my Foxtech camera. I saw nothing in the wiki that mentioned that.

There are two more things I’d like to know - but aren’t essential to my project right now. I’d like to know how to set the relay to HIIGH and have it stay at HIGH until commanded back to low.

And I have I faint recollection that it’s possible to set the initial condition to either HIGH or LOW. I may be mistaken about that - I haven’t been able to find it in the wiki.

Thanks for all your help! I appreciate it.