Controlling a 3v Relay with AuxOut Pins

Hi Gang!

So I am halfway to my desired result. My goal is to trigger a 3v relay with the channel 6 output of my radio. Ideally, my relay would be controlled via the FMU PWM Out Port from my Pixhawk 4 (which is of course connected to my receiver/radio).

I have been successful using the I/O PWM Out port and am not sure why I am getting different results with similar setup for the FMU PWM Out port… When I was successful, in mission planner I simply went to mandatory hardware > servo output > and changed the functions of position 7 to RCIN6. Afterwards, my relay worked like a charm when connected to the corresponding pin.

However, I did this test without my motor ESC wires connected to positions 1-6, and I believe the 5v from these will interfere with the operation of my relay. Hence my desire to use the FMU PWM Out port and the aux1/servo9 pin.

Looking at the full parameters list after setting up the position 7 to RCIN6 for Servo7 is see the following:

The pin chips that come with the Pixhawk 4 are identical and have 8 different positions each. Looking in mission planner I see there are 16 servos. If position 1-8 correspond to 1-8 for the I/O PWM port, I assume the 9-18 positions correspond to the FMU PWM Out port.

Under this assumption, I simply tried setting Servo9_Function = 56, which corresponds to RCIN6. I tried this after setting BRD_PWM_COUNT to both 0 & 8. I can see the relay respond (a slight adjustment in light) but am unable to toggle my relay as desired with RCIN6.

Wondering if someone knows if there are additional parameters I need to get servo9 to work as desired or if my assumption is not valid. All the documentation I can find on this seems to be for pixhawk 2.4.8 which seems to have a different pin architecture.

Second approach - In addition to the above I tried setting Relay_Pin = Auxout 1 & RC6_Option = Relay On/Off. This was not successful.

Which flight controller board, which ArduCopter version?

Pixhawk 4 FMUv5
ARducopter 4.0.6

P.S. Appreciate the help :blush:

The outputs are independent from the inputs. The inputs are controlled by RCx-OPTIONS
The outputs by SERVOx-FUNCTION

Thanks Amilcarlucas!

I think I am following. Let me know if there is any errors in my takeaway here:

My INPUT is RCIN6. The RCx-Options values seem to be what you would do with that input? Example: Relay On/Off.

My desired output is an on/off high/low signal on the 1st pin off my FMU PWN Out Port:

For Servo9_Function, not sure if I should change from RCIN6 to something else?

I guess my follow up question is, are there a combination of RC6-Option and Servo9-Function values that you recommend given my input output combo?

If you are trying to control a relay on the output, SERVO9_FUNCTION must surely be RELAY, not RCIN6, as that would be a PWM signal and not a relay signal.

But as for the RC6_OPTIONS parameter, I have no ideas, right now.

Thanks Amilcarlucas!

Below is a list of available Servo9_Functions. None of them appear to be Relay:

Depending on what you are planning to do, maybe you might configure the relay as camera shutter?

sorry to miss-lead you in the wrong direction. Try using CH7 input and AUX5 output instead:

This is described in the ArduCopter Relay documentation.

Thank you Jason and Amilcarlucas!

I’ll try these suggestions and let you know how it goes!

Thank you so much. This worked! I am now able to control the relay with the FMU/PWM!

Curiously, I didn’t find CH7_OPT in the parameter list but as an option under extended tuning.