WS2812B (NeoPixel) Integration

To be frank, I haven’t set anything !. I was just asking whether the LED pin (connection) in Kakute F7 will work. As this build doesn’'t have a status LED like Pixhawk, I would like to have one.
So waiting for some experts to chime in.

EDIT:- Tried connecting like in the above picture.
Not working…


I think if we can figure out which servo output (i.e. which “x” in SERVOx_FUNCTION) corresponds to the LED pin on the Kakutef7 it might work. Maybe @andyp1per knows.

So far though I haven’t actually seen any user get the NeoPixels working with Copter-4.0.

Thank You for sparing your valuable time.
I will be waiting eagerly for it to happen.

Just had a little play with this, CubeOrange both scripting and notify neopixles work. Interestingly the Saleae did not detect the protocol when it was working on the CubeOrange either so possibly my previous test is invalidated.

So after more poking about I concluded that the voltage was to high for the signal level on the MatekF405. The Cube would drive the led’s powered by the Matek and the Matek would drive the the led’s powered by the Cube. Measuring the voltages showed 4.5v powered from the Cube and 5.5v on the Matek. I would guess, but did not test, that the Cube also has a higher signal level. I added a diode between the Matek 5v and the LED power and it all started working. This shows the test, and the final installation.

Since it was now working I flashed back to Copter 4.0 and can confirm NeoPixles work as they should. (@rmackay9)

A little change to the code and I now have all 6 leds working.


@iampete, thanks for this. So I guess we need some more information added to the wiki to tell users what they might need to do to get it working with some boards. I wonder if you could give some more info to @hwurzburg about where the diode is connected?

1 Like

of course, but I would hope that this is just a peculiarity of my setup rather than something that everyone will have to do.

this is an old old issue with NeoPixels…WS2812 specs min input high logic level as 0.7vxVCC…0.7x5v=3.5V…our FC outputs are 3.3V max…since this is worst case spec…MOST leds will work, but get 5% high on 5V or 5% low on 3.3V regs on autopilot, or just a worst case tolerance LED (and a lot are floor sweepings from China) you are hosed…easy fix is diode in WS2812 supply…but you loose brilliance…better fix is to cut a minimal amount of the strip that you can isolate, hopefully just one led, power it from the diode, then power the rest from 5V using its signal output,which is now 4.3V swing…

PS I havent checked but maybe Neopixel changed the spec in these last years so that the “real” one will use uP logic levels…will try to find an official current DS…then we say “just use new Neopixel OEM devices”…but that is rather cramping also…will check

update: even the B versions on the Adafruit site have this same spec…so most of the time, no problem…corner cases need the diode or the more complicated fix…will add to leds page I’m working on before merging


I have finally got this to work, but it appears that it will only work if the AUX output is configured as a PWM and not a GPIO, which is the opposite of this note in the wiki:

I have a string of 8 WS2812B LEDs connected, but of course, only the first LED in the string responds to the data from the AUX output. Ideally, I would like to have a group of 4 (or more) LEDs respond so it is bright enough to see when the copter is flying. I guess that this is where Lua scripting gets involved?

Does anyone already have a working Lua script that I could use to control multiple LEDs, please … :wink:

This is a example script from Tridge.

There is also this PR to allow you to confige how many to use on as notify leds.

That Wiki tip is defiantly backwards, this PR corrects it


Thanks @iampete … the PR to “Change NeoPixel Length for NTF LEDs” is exactly what I am looking for :grinning:

I just need to wait now until it is available in the 4.x released code?

how many do you want on what board? Copter?

1 Like

I want to use one of these 2 x 2 LED assemblies:


fitted to the rear of the quadcopter so I can see the status of the FCU from a distance. The reason for using 2 x 2 (or mayber 4 x 4) is to get enough brightness to be able to see the status from a distance.

The FCU that I am using is a Pixhawk v2.4.8.

Arducopter 4.0.1-rc3 build for Pixhawk1 with 8 NeoPixel’s for notify

1 Like

Wow … that was quick! Thanks @iampete:smiley:

I will give it a try later today with the 2 x 2 LED module.

Yes, it works perfectly @iampete

Well, almost.

I have NTF_LED_OVERRIDE set to 0, which means that the NeoPixels should display the same colours and sequence as the built-in LED - i.e. the “Standard” sequence. However, when the built-in LED flashes GREEN, the NeoPixels flash RED … :open_mouth:

I guess that this is just a “colour mapping issue” within the NeoPixel code? And is easily fixed?


While the solution of diode, cutting, etc, is ingenious, you should read:
Microchip Compiled Tips ‘N Tricks Guide
chapter 8, tips #6, #7 and #13.

This is a case of 3.3V->5V unidirectional. For #7 and #13 on the Pixhawk you have 3.3V available at the Spektrum connector.

I don’t think that tip #6 is suitable as it inverts the signal?

I am using a level translator as described in tip #13 and it works fine.

hum, NeoPixles are the correct colours for me. Maybe you have a slightly different led type. There are WS2812 (not B) maybe there is some difference there.

Flashing green should be all happy with GPS lock but not armed. I guess this is the state you were actually in? Flashing red would be a failsafe of some sort probably.

True, there are many different ways to level translate…all the ones mentioned are more complex, more components, or require more soldering…I like to keep the WIKI KISS, if possible…fortunately, the problem seems to only occur in the corner cases…

Can you make some parameter in which to specify the number of connected diodes? I have 8 pieces of them in the Assembly, only one works…