An external LED or LED Display can be added by connecting it to the autopilot’s I2C port or, in 4.0 and later versions, if a serially programmed device, via an output using the SERVOx_FUNCTION for that output. UAVCAN LEDs on the CANBUS are also supported (See UAVCAN Setup ).
Note that the same grouping restrictions which apply to setting outputs to different PWM rates and/or DShot, apply to LEDs also since the timer associated with each group of outputs cannot be used for different rates. See also ESC Related Configuration
RGB LEDs/Displays with I2C Connection¶
Two types of I2C devices are supported: IC2 connected RGB LEDS using an LED driver chip and OLED displays.
RGB LEDs/drivers supported are:
- Toshiba LEDs (no longer manufactured)
- PCA9685 driver
- NCP5623 driver
OLED Displays supported are SSH1106 and SSD1306 with 128x64 pixel displays. See Onboard Display for more information.
Serially Connected Devices¶
Currently, Ardupilot supports the Neopixel style RGB LED and strings. They can be used for NTF notifications from the autopilot on status and warnings like other RGB LEDs, or be programmed in unlimited ways using LUA scripts on the autopilot’s SD card. See Lua Scripts for more use examples using LUA scripts.
A “NeoPixel” style (WS2812B compatible) RGB LED can be attached to any PWM output by setting its SERVOx_FUNCTION to one of the
NeoPixelx output functions and setting NTF_LED_TYPES parameter to
NeoPixelx output functions are provided for connecting multiple strings (up to 4).
Be sure the output is configures as normal PWM instead of a GPIO output. See GPIOs
If used for notification purposes, be sure to set NTF_LED_TYPES to “Neopixel” (8).
Most WS2812 style LED and strings will operate correctly when connected to the autopilot. However, if you get intermittent or non-operation, you may need to implement one of the configurations below. This is due to the fact that the autopilot outputs swing to 3.3V but the worst case input signal high spec for the LED is 4.3V at a 5V supply. So at extremes of tolerance/manufacturing spec, you can get a combination which will not work correctly. In that case the easiest solution is to lower the LED supply as shown below.
But this causes a small loss in LED brilliance. An easy way to avoid this, if an LED can be isolated in the string, is to use an LED to level shift the signal for you so that the rest of the string can be powered by the full 5V.