Uploaded July 2026 | Updated November 2026, 6 days ago
Patreon: patreon.com/iforce2d
The docs for GPIO setup are here but the info is not on a single page and omits key details like at one point you need to reboot before extra params will appear.
ardupilot.org/copter/docs/common-gpios.html
ardupilot.org/copter/docs/common-relay.html
Let's say you want to use channel 6 on your radio to toggle the servo pin 5 between high and low. This will use an internal status value called Relay 1.
Set RC6_OPTION to 28 (Relay 1 on/off)
Set SERVO5_FUNCTION to -1 (GPIO)
Set RELAY1_FUNCTION to 1 (Relay)
At this point I think you need to reboot before some extra RELAY1_xxx parameters become available.
Set RELAY1_PIN to the appropriate pin number for servo pin 5 on your board. This will require looking up the 'hwdef.dat' file from here: github.com/ArduPilot/ardupilot/tree/master/libraries/AP_HAL_ChibiOS/hwdef
You're looking for the GPIO(xx) number that corresponds to the PWM(x) of your servo pin. In this example with an Omnibus F4 pro it would be 54, so RELAY1_PIN = 54
Patreon: patreon.com/iforce2d
The docs for GPIO setup are here but the info is not on a single page and omits key details like at one point you need to reboot before extra params will appear.
ardupilot.org/copter/docs/common-gpios.html
ardupilot.org/copter/docs/common-relay.html
Let's say you want to use channel 6 on your radio to toggle the servo pin 5 between high and low. This will use an internal status value called Relay 1.
Set RC6_OPTION to 28 (Relay 1 on/off)
Set SERVO5_FUNCTION to -1 (GPIO)
Set RELAY1_FUNCTION to 1 (Relay)
At this point I think you need to reboot before some extra RELAY1_xxx parameters become available.
Set RELAY1_PIN to the appropriate pin number for servo pin 5 on your board. This will require looking up the 'hwdef.dat' file from here: github.com/ArduPilot/ardupilot/tree/master/libraries/AP_HAL_ChibiOS/hwdef
You're looking for the GPIO(xx) number that corresponds to the PWM(x) of your servo pin. In this example with an Omnibus F4 pro it would be 54, so RELAY1_PIN = 54










