Main Content

How to control Neopixel strip with WiFi

We make a NeoPixel light installations using Fishino and NodeMCU, controlled via Wi-Fi from PC or Raspberry Pi through a Python library.

A few years ago, the American Adafruit Industries revolutionized the LED market by introducing its NeoPixels, whose main feature is to integrate, in a single package, an RGB LED and its controller. Adafruit’s goal was to meet the Arduino world by simplifying the LEDs management, integrating both the controller and the RGB LEDs in the same package. Since then, NeoPixels have spread widely among the public, mainly because, in addition to integrating the controller, they can be cascaded and addressed individually, controlling the color and brightness one by one. Inside each NeoPixel LED there is an RGB SMD LED (usually a 5050 and an integrated WS2811 or WS2812, that acts as a driver. A microcontroller (e.g., Arduino) sends an array of bytes with a precise timing through all the LEDs connected in series and makes it possible to create colorful and bright animations.

NeoPixel products are available in various shapes and compositions: Single LEDs, stripes, rings, arcs, and matrices. The widespread use of these LEDs has led to the creation of many projects that have proved their versatility: indoor and outdoor lighting, gadgets, bright clothes, LED walls, and many more. In many projects, the microcontroller connected to the NeoPixels contains predefined effects sequences that it cyclically reproduces or is connected via USB to the PC to receive commands making it challenging to install these projects in remote locations, without having to resort to long wiring or updating the sketch every time you have to change animation.

In this article we present a system that allows you to control several NeoPixel installations scattered around the house via Wi-Fi, without having to change each time the sketch loaded on the microcontrollers; We will connect Fishino Guppy to a NeoPixel star while NodeMCU will be connected to a 150 LED NeoPixel strip (both are equipped with the ESP8266 chip, that will provide Wi-Fi connectivity), while as a software controller we will use a Python program (with a specially developed library) that can be run both on a Windows PC and on Raspberry Pi and that will send, via the Wi-Fi network, the various effects to be played to all connected NeoPixel devices.

To carry out the project, we need the following components, available on the website:

a NeoPixel 5 meters strip with 30 LEDs/meter (code STRIP150LED);
one NeoPixel star with 56 LEDs (code FT1300M);
a 5-volt DC power supply unit with correctly sized power supply (code MW05005);
a 470-ohm resistor;
two 1,000 µF, 6 volt or higher capacitors;
a Fishino Guppy board (code GUPPY);
a NodeMCU board (code NODEMCUESP);
a logical level converter 3,3 ÷ 5 volts (code LLCTTL);
cables for wiring and jumpers;
a Raspberry Pi 3 board with its microSD and power supply (code RASPKITV7).
When working with NeoPixels, it is vital to size the power supply because you have to consider that a LED of this type can absorb 60 milliamps when lit in white light at maximum brightness: multiplying this value by the 150 LEDs in the strip of 5 meters we get absorption of 9 amps.

Other two tricks that we must consider when working with these LEDs are undoubtedly the capacitor and resistor usage: the capacitor must be connected to the power supply cables respecting the right polarity to level the initial peak voltage generated by the power supply that would damage the LEDs; the resistor must be connected between the pin of the microcontroller and the data line (DIN pin) of the NeoPixel strip (not necessary if you use the star because it has already been provided in the PCB).”

Link to article

Related Content