NeoPixel Strip

Chainable RGB LED strip built on the WS2812B, where every pixel carries its own driver IC and is set individually over one data wire.

NeoPixel Strip: Custom density and length at runtime

What is the NeoPixel Strip?

A NeoPixel strip is a flexible chain of individually addressable RGB LEDs. Each pixel is a WS2812B, a 5050-size package that integrates a red, a green, and a blue LED die together with a control IC, a data latch, and a signal-reshaping circuit. The whole strip is driven from a single microcontroller data pin, and strips are sold on cuttable flex PCBs so density (for example 30, 60, or 144 LEDs per meter) and length can be chosen to fit the build.

The pixels are controlled with a single-wire NZR protocol running at 800 Kbps. Each pixel expects 24 bits of color (8 bits each for green, red, and blue, in GRB order), giving 256 brightness levels per channel and 16,777,216 colors. The first pixel keeps its own 24 bits, reshapes the waveform, and forwards the remaining data out of DOUT into the next pixel's DIN, so the chain self-propagates without added buffers. After the last bits are sent, a reset (low for more than 50 microseconds) latches the new colors to the LEDs.

The strip runs on 5V, and each pixel can draw up to about 60mA at full-white brightness. A 30-LED segment can therefore pull roughly 1.8A, so power budgeting and an adequately rated 5V supply matter as strips get longer. Because logic and power share the same 5V rail, driving the data line from a 3.3V board is marginal and usually needs a level shifter.

Specifications

LED driver chip
WS2812B (control IC + RGB LED integrated in one 5050 package)WS2812B datasheet (Worldsemi)
Supply voltage
5V typical (absolute max 3.5-5.3V VDD)WS2812B datasheet (Worldsemi)
Data protocol
Single-wire NZR serial, 800 KbpsWS2812B datasheet (Worldsemi)
Color per pixel
24-bit, 8 bits per channel in GRB order (16,777,216 colors)WS2812B datasheet (Worldsemi)
Logic-high threshold
VIH >= 0.7 x VDD (3.5V on a 5V supply)WS2812B datasheet (Worldsemi)
Reset / latch time
Data line held low for more than 50 microsecondsWS2812B datasheet (Worldsemi)
Current per pixel
Up to ~60mA at full-white (all three channels on)Adafruit NeoPixel Uberguide
Data direction
One way only, DIN in and DOUT out; chain DOUT to next DINWS2812B datasheet (Worldsemi)

Every specification is cited to its source.

Circuit requirements

  • Power and data are both 5V. The WS2812B needs a logic high of at least 0.7 x VDD (about 3.5V on a 5V rail), so a 3.3V microcontroller output is marginal. Use a level shifter such as a 74AHCT125 or 74HCT245 to raise the data signal to 5V.
  • Data flows in one direction only. Connect the microcontroller to the DIN (input) end of the strip; the printed arrows on the flex PCB point from DIN toward DOUT. Feeding data into the DOUT end will not light anything.
  • Place a 300-500 ohm resistor in series on the data line between the microcontroller pin and the first pixel's DIN to limit spikes and protect that first LED.
  • Add a large electrolytic capacitor (500-1000 microfarads, rated 6.3V or higher) across the 5V and ground terminals at the strip's power input to buffer inrush current when many pixels switch on at once.
  • Budget the supply for peak load: each pixel can draw up to 60mA at full white, so a 60-LED run can approach 3.6A. Power the strip from a dedicated 5V supply rather than the microcontroller's onboard regulator, and inject 5V and ground at both ends (or periodically) on long runs to avoid voltage droop and color shift.
  • The microcontroller and the strip's 5V supply must share a common ground for the data signal to be read correctly.

Board compatibility

The NeoPixel Strip connects to any of the microcontrollers supported in Tinkered.

Common NeoPixel Strip mistakes

Wiring data into the wrong end

Data only moves from DIN to DOUT. If the strip stays dark, check the direction arrow and make sure the microcontroller drives the DIN end, not DOUT.

Driving 5V pixels from 3.3V logic directly

A 3.3V data line barely meets the 0.7 x VDD high threshold. It may work on a short bench setup and then glitch on longer strips. Use a 74AHCT125 or 74HCT245 level shifter to get a clean 5V data signal.

Under-powering the strip

At 60mA per pixel a full-brightness strip draws amps, far more than an Arduino 5V pin can supply. Powering a long strip from the board's regulator causes brownouts and flicker. Use a properly rated 5V supply.

Skipping the series resistor and capacitor

Without the ~330 ohm data resistor and the bulk capacitor across the power terminals, the first pixel can be damaged by spikes and the strip can behave erratically at power-up.

Wrong color order in code

WS2812B pixels take data in GRB order. Configuring the library for RGB swaps red and green, so a command for red shows up as green until the color order is set correctly.

Popular NeoPixel Strip projects

Ambient room and desk lighting

Cut a strip to length and run color-fade or breathing animations for backlighting a monitor, shelf, or gaming setup.

Sound-reactive light bar

Map audio levels from a microphone or line-in to a moving VU-style bar or spectrum display along the strip.

Addressable status and progress display

Use individual pixels as indicators for build status, timers, sensor thresholds, or a countdown, each set to its own color.

Wearables and props

Sew or mount short segments into costumes, badges, and signs for animated patterns driven by a small 5V microcontroller.

Build with the NeoPixel Strip.

Drop the NeoPixel Strip into a circuit, write firmware, and simulate it in your browser, then deploy to real hardware. All in one editable Tinkered project.