"Neopixel" Demos
I've accumulated a few addressable RGB LED rings and matrices (aka "Neopixels" - an Adafruit brand name). So I created a few demo programs to exercise them.
Neopixel rings
I've got a few of these rings in various sizes. These demos use a 12 pixel ring, but the principle is the same for all sizes. There are two demos:
- Using an Arduino Uno with the
Adafruit_NeoPixel
library. - Using an ESP32-C3 Super Mini using the WLED software.
1. Neopixel rings with Arduino Uno
A circuit was built on a breadboard as follows:
Breadboard circuit design
Breadboard circuit as built
To avoid overloading the Uno, the LED ring is powered using a breadboard power supply configured to supply 5V rather than from the Uno's 5V output. It is important that one of the Uno's GND pins is connected to the same ground as the power supply.
The source code that exercises the LED ring is a greatly modified version of code by "Elon" on Medium. The code can be found in the cahamo/demo-projects
repository on GitHub. The relevant code will be found in the neopixels/neopixel-ring--uno
directory. All the C++ code is in src/main.cpp
.
The demo can be seen running in the following video:
2. Neopixel rings with ESP32-C3 Super Mini
I was curious wether my newly acquired ESP32-C3 Super Mini would run the WLED Neopixel control software. The answer is yes it can, although the processor chip gets a bit hot to the touch!
Because Neopixels operate at 5V and ESP32s require 3.3V, we need to use a logic level shifter to convert the 3.3V output from the ESP32's data pin to the 5V required by the Neopixels. The following circuit was designed to accomplish this:
Circuit design
This circuit was built and tested on a breadboard, as follows:
Breadboard as built
To avoid stressing the ESP32 the Neopixels were powered from my bench power supply set to 5V. (No breadboard power supply this time - it died!)
The WLED software was configured using the WLED website to drive the 12 pixel ring. It was uploaded to the ESP32-C3 from the website. Several different sequences were tested via the website.
Neopixel matrices
My matrices are 8×8 pixels, so that's what is demonstrated here. However the principle is the same for any size matrix. There are two demos. Both of them target an Arduino Uno and use the Adafruit_NeoPixel
and Adafruit_NeoMatrix
libraries.
Both demos use the same circuit, which is in turn the same as that used for the Uno with the Neopixel ring as described in the section Neopixel rings with Arduino Uno above. Just replace the neopixel ring with the matrix: the connections are just the same. The following image shows the circuit as built:
Breadboard circuit as built
As above, the neopixels are powered via an external power supply, not from the Uno. (This demo was built after the breadboard power supply died!)
There are two software projects used to demonstrate the use of the Neopixel matrix:
- The first project runs a snake of different coloured pixels from top left to bottom right of the matrix. This project is in the
neopixels/neopixel-matrix-1--uno
directory of thecahamo/demo-projects
repository on GitHub: the C++ code is insrc/main.cpp
. This project was running when the above photo was taken. - The second project scrolls text across the matrix in a horizontal orientation. This project is in the above repository's
neopixels/neopixel-matrix-2--uno
directory: the C++ code is insrc/main.cpp
.
Both projects are modified versions of examples supplied with the Adafruit_NeoMatrix
library.
The following video shows neopixel-matrix-1--uno
running: