PWM or GPIO when armed for controlling LEDs

I am currently building up an AtomRC Dolphin foam plane using a Matek F405-WTE flightcontroller. In hindsight I should have chosen an H743 which allows LUA scripts, but the F405-WTE is compact, light and features an integrated ELRS receiver making it a good fit for the plane.

I added several 1W Luxeon side emitter LEDs to the wing- and vertical stabilizer tips of the plane to enhance visibility in the air, even in daylight. These LEDs are mounted on a strip of brass for cooling, but since the foam insulates heat so well this piece of brass is still insufficient to support full (350mA) LED current without moving air passing by. Therefore I would like to reduce LED current during standstill and only use full LED current when flying.

The LEDs are driven by AL8805 LED-driver IC’s which accepts an analog control voltage or a PWM signal for LED intensity control.

The easiest/best option would be to use one of the flightcontroller servo outputs in a suitable group as a 0-100% PWM channel with PWM frequency <=500Hz doing ~20% PWM output when not armed and 100% PWM output when armed, or even better, when the throttle to the motor is above 1000 / motor is running. Is one of these possible without lua scripting?

The second best option is to setup a GPIO that reflects the arming state (or motor-is-running state) and use a couple of resistors to derive the correct analog control voltages from this digital output. How can I reflect the arming state onto a GPIO?

The third best option would probably be to translate the arming RC channel into an output, either PWM or digital. But then it is probably better to accept my losses, get an H7-powered FC and separate receiver, and solve LED-control through Lua.

what radio do you have? if its opentx based you could easily do what you want with logical switches.

Even if its not open radio cant you do it with a programable mix?

You could tie it to the arm switch

I am using a Radiomaster TX16S running EdgeTX, DIY ExpressLRS as the radio system, Yaapu telemetry scripts.

Using the arm channel to control LED current is the third best option, but it does not reflect true arm status. Channel may go high while the arming checks are still preventing arming. Therefore I prefer to use true arming status coming from the Ardupilot logic, when possible.

True if he had an open tx radio with telemetry that would be the way to do it using logical switches, but since it’s just LEDs and they aren’t going to overheat for a while connecting it to arming should be ok.

OK, I duplicated the arming status of the transmitter to another RC channel (10), used that channel to control relay_pin3 (RC10_OPTION=35), setup servo5_function to GPIO (SERVO5_FUNCTION=-1) and setup relay_pin3 to the GPIO number found in the hwdef.dat for my flightcontroller.

This works as expected. But it raises another question: Do I really have to sacrifice an entire RC channel just to control a binary output? I have not managed to use RC channel 5 for both arming and LED control. I do have enough channels for a simple plane, but still it feels wasteful.

(I am used to the Betaflight/iNav method of assigning ranges to functions, which is way more flexible)

you could use a lua script to activate the relay when armed

Not on F405…

Upgrading the flightcontroller is the best plan. Will do that later and keep the mirrored arming status for now. The missus is complaining about the constant trickle of money towards RC parts. Sounds familiar I suppose.

Ask her if she’d rather an endless flow of every cent into ice, betting, smokes, booze, etc etc