Typical NeoPixels have LEDs which each have three colours: red, green, and blue. RGBW NeoPixels have four LEDs per pixel: red, green, blue, and white. Why add an extra white LED? Can’t we make white just by mixing red, green, and blue?

Since “white” isn’t a colour by itself, but a mixture of light at different frequencies there is more than one way to make “white”. The white produced by mixing 100% red, green, and blue is often looks very artificial (like fluorescent lights in a late night convenience shop).

The RGBW led strips we have in class have red, green, blue, and “warm” white LEDs (four colour channels). The warm white LED has a “warmer” tone that is closer to the yellow light produced by a candle. By using just the warm white LED we can make a comfortable yellow/white colour. If we want a “cooler” white we could use the warm white LED and mix in some blue or the cold white produced by using equal values of RGB. We can also take a totally saturated colour like pure blue and add some warm white to make it more washed out / pastel / desaturated. Let’s give it a try!

Three versions of “white”. RGB, W, RGBW

Hardware References

Software References

Collect the necessary parts
  • Feather M4 Express with Prop-Maker FeatherWing
  • 8x RGBW warm white NeoPixel strip
  • JST-PH 3-pin connector that matches the NeoPixel port on the Prop-Maker FeatherWing
  • Female jumper cable (not included with kit – available in IM Lab parts)
Cut the female headers off the cable (think about how long you want the connection to the LED strip to be). OR cut the male pins off JST-PH cable.
Strip the wire ends. They exposed metal should be about the same length as the exposed metal on the pads of the LED strip.
Set iron to 350C
Jab the tip into wire brush to clean off any gunk, then apply fresh solder and jab again. The tip should be shiny with a thin layer of solder.
Tin the wires with a small amount of solder. Tin the pads by adding a small amount of solder.
Hold the appropriate wire and pad together and heat to melt the solder and make the connection. Use a memorable combination of wire colour and pad, e.g. Red to 5V, Brown to GND, Orange/Yellow to Data In (DIN).
Female header wires attached to RGBW strip
The connection on the Prop-Maker Wing are labelled on the bottom of the board. Match the GND to GND, V+ to 5V, Neopix to DIN.
Copy the neostrip_rgbw.py from DMA GitHub to your CIRCUITPY drive
Update your code.py to load the neostrip_rgbw.py code
You may need to install the neopixel.py library by downloading the CircuitPython Library Bundle for 7.x and copying the neopixel.mpy file and adafruit_bus_device directory to your CIRCUITPY/lib directory.
The example code goes through a few different colours. First we make white using equal values of RGB, e.g. (R = 128, G = 128, B= 128, W = 0). Notice how we see all the colours in the chart but it looks a bit artificial
Then white using just the warm white LED e.g. (R = 0, B = 0, G = 0, W = 128). We see all the colours and they’re more pleasing, but the overall hue is a bit yellow (warm)
Then white using a mix of all four channels. E.g. (R = 128, B = 128, G = 128, W = 128). The overall mix is closer to daylight with a good balance of colours and less of an artificial feeling. The warm white helps smooth out the colour spectrum.
We start from pure saturated blue (R = 255) and add in warm white.
With some warm white added we still have a strong blue, but it’s not quite so intensely blue
As we add more warm white, the colour becomes less saturated.
With a lot of warm white the colour starts to feel like white with a slight blue tinge. This kind of subtle colouring is difficult to achieve with just RGB.

Try making your own changes to the code, and experiment with creating different feelings with your light! Can you make the light cozy / relaxed just using RGB? What happens when you add different amounts of W? What colours are more stimulating? What colours are easier to read by?

Categories: Tutorial