NeoPixel troubleshooting guide for WS2812B RGB LEDs

Troubleshooting Common NeoPixel Problems (And How to Fix Them)

Updated

Updated November 2026 with a section on sewn circuits and conductive thread.

'NeoPixels' are WS2812B RGB LEDs with a tiny controller built into each LED. Each one contains a red, green and blue LED plus a driver chip, all in a 5 × 5 mm package, so you can control hundreds of them from a single data wire. Each pixel takes its colour, then passes the rest of the data down the chain to the next one.

Narrow WS2812B addressable LED strip

They come as flexible strips, rings, single modules and sewable pixels, and work with Arduino, ESP32 and most other microcontrollers. When they misbehave, it is almost always one of a handful of causes. Here they are, with fixes, plus sections on sewn circuits and the ESP32 boards I use for nearly everything.

Quick checklist

  • Is the strip getting power, and do all the grounds connect together?
  • Is the data wire on the DIN (input) end? Follow the arrows printed on the strip.
  • Does the pin in your code match the pin you wired?
  • Is the LED type and colour order right in your code? (WS2812B is usually GRB.)
  • Is the brightness sensible for your power source?

No lights at all

Check power first, then data. Make sure the strip has power and ground, that the data wire goes to the input end, and that your code uses the same pin you wired. Then run one of the test sketches at the bottom of this post. If a known-good sketch does nothing, the problem is in the wiring, not the code.

The first LED works but the rest don't

Either the data connection after the first pixel is broken (often a cold solder joint), or the first pixel itself is damaged and blocking the signal. Reflow the joints near the start of the strip. If that doesn't help, cut off the first pixel and connect your data wire to the second one. If the rest of the strip lights up, the first pixel was the culprit.

New to soldering strips? A soldering practice board and good 0.8 mm solder make clean joints much easier.

Only some of the LEDs light up

Check NUM_LEDS in your code. If it's set lower than the number of LEDs on your strip, the rest stay dark. If the cut-off point is always at the same pixel, look for a broken joint or damaged LED there.

Flickering, glitching or random colours at startup

This is usually power or electrical noise:

  • The power supply can't keep up with the LEDs.
  • The microcontroller and the LED power supply don't share a ground. All grounds must connect.
  • A long data wire is picking up noise, or the strip sits near motors or relays.
  • A loose wire or cracked solder joint.

Fix: connect all grounds together and keep the data wire short. For bigger builds, add a 470–1000 µF capacitor across + and − near the first LED, and a 220–470 Ω resistor in the data line. These smooth the power and protect the first pixel.

Wrong colours, or white looks pink

WS2812B pixels expect colour data in GRB order, not RGB. If red and green look swapped, change the colour order in your code. If whites look pink or odd, check whether you have RGB or RGBW pixels (they need different library settings) and that you picked the right chip type (WS2812B, WS2811 and SK6812 differ).

Dim LEDs, or colours fading along the strip

This is voltage drop. Each LED can draw up to about 60 mA at full white, and the thin copper on a strip can't carry that far. LEDs at the far end turn dim or orange. Use thicker wire to the strip (I use soft silicone 22 AWG because it bends with fabric), feed power into both ends (or every 100–150 LEDs on long runs), and lower the brightness. Most projects look great well below full brightness.

Sewn circuits: flicker and dim LEDs with conductive thread

Sewing NeoPixels into fabric brings its own problems, because conductive thread has far more resistance than copper wire, and that resistance adds up with every centimetre.

  • LEDs dim or turn orange further from the board: the power and ground lines are too long or too thin. Keep them short, sew them as two or three parallel lines, or use silicone wire for long power runs and thread only for short hops between pixels.
  • Flicker when you move: a loose stitch at a pad. Loop the thread through each pad three or four times, pull it snug, and seal knots with clear nail polish or fabric glue.
  • Random colours or a dead board: a stray fibre or thread tail is touching a neighbouring line. Trim every tail short and keep power, ground and data lines well apart.
  • Works flat, fails when worn: fabric stretch pulls stitches loose. Back the circuit with interfacing, or place it where the garment doesn't stretch.

Try it with: sewable pixel modules, stainless steel 2-ply thread, and a sewable JST adapter for a removable connection.

Animations stutter or run slowly

Too many LEDs for the refresh rate, too much maths in every loop, or delay() calls holding everything up. Update fewer LEDs per frame, pre-calculate values, and avoid long delays. An ESP32 has plenty of speed if you're moving up from an older Arduino.

LEDs keep showing the last pattern after a reset

The strip keeps its power when the microcontroller resets, so the pixels hold their last colour until new data arrives. Clear them at the start of setup(): FastLED.clear(); FastLED.show();

ESP32-specific problems

Can I power NeoPixels from the 3V3 pin?

For small builds, yes, and it's what I usually do. I've run 60 LEDs in a row off the 3V3 pin with no issues. It has a bonus: the LEDs and the ESP32's data signal are then at the same voltage, so you avoid the level problem described below.

Two things to keep in mind. The 3V3 pin is fed by the board's small regulator, which also powers the ESP32 itself, so keep the brightness modest. 60 LEDs at full white would ask for around 3.6 A, far more than that pin can give. Colours are also a little less bright at 3.3 V than at 5 V. For large or very bright builds, power the strip from 5 V (the 5V/VIN pin on USB, or a separate supply) and connect the grounds together.

5 V strip, 3.3 V data

ESP32 pins put out 3.3 V. When the strip is powered from 5 V, that data signal is right on the edge of what the LEDs read reliably. It often works, and most small builds never need anything more. If you see flicker or random pixels, power the strip from 3V3 for small builds, keep the data wire short, or add a level shifter such as a 74AHCT125.

Pick a safe data pin

  • Classic ESP32 (30 and 38-pin): use GPIO 13, 14, 16–19, 21–23, 25–27, 32 or 33. Avoid GPIO 6–11 (flash), 34–39 (input only) and the strapping pins 0, 2, 5, 12 and 15.
  • ESP32-C3 SuperMini: avoid GPIO 2, 8 and 9, which are strapping pins (GPIO 8 is also the onboard LED).
  • ESP32-S3 SuperMini: the onboard RGB LED is on GPIO 48. Avoid strapping pins 0, 3, 45 and 46.

For every board we sell, see the ESP32 pinout and touch pin guide.

A bright white flash when uploading

While the board boots or uploads, the data pin floats and the LEDs can flash white. That's normal and stops once your code runs.

Glitches when WiFi is busy

If your LEDs glitch only when WiFi or Bluetooth is active, update your LED library to its latest version first. ESP32 support in these libraries keeps improving.

Test code: FastLED

A simple test for any ESP32. Change DATA_PIN and NUM_LEDS to match your wiring. For quick tests without soldering, a Neo Tester and alligator clip jumpers are all you need.

#include <FastLED.h>

#define NUM_LEDS 10
#define DATA_PIN 13   // a safe GPIO on the classic ESP32

CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(40);   // keep it low when powering from 3V3
}

void loop() {
  fill_solid(leds, NUM_LEDS, CRGB::Red);
  FastLED.show();
  delay(1000);

  fill_solid(leds, NUM_LEDS, CRGB::Green);
  FastLED.show();
  delay(1000);

  fill_solid(leds, NUM_LEDS, CRGB::Blue);
  FastLED.show();
  delay(1000);
}

If you see green when the code says red, your colour order is wrong.

Test code: CMozGlow

We wrote our own free library, CMozGlow, to make this easier. Pick an effect, change one number and upload. It also tells you in plain English when something is wrong, instead of failing silently, and it can cap the power your LEDs draw, which is ideal when you're running from the 3V3 pin or a small battery.

In the Arduino IDE, open File > Examples > CMozGlow > CMozGlow_Basics, or paste this:

#include <CMozGlow.h>

// ========== CHANGE THESE ==========
const uint8_t  EFFECT   = 8;    // 0-13, see the effects table in the README
const uint16_t NUM_LEDS = 1;    // onboard only = 1
const uint8_t  SPEED    = 5;    // 1 dreamy ... 10 party
const uint32_t COLOR    = CMozGlow::Color(255, 42, 120);
const uint8_t  LED_PIN  = 3;    // GPIO 3 = onboard pixel; change for other boards
// ==================================

CMozGlow glow(NUM_LEDS, LED_PIN);

void setup() {
  Serial.begin(115200);
  if (!glow.begin()) {
    Serial.println(glow.errorText());   // it tells you what to fix
    while (true) delay(1000);
  }
  glow.setPowerBudgetmA(450);           // safe on USB or a small LiPo
  glow.setEffect(EFFECT);
  glow.setEffectColor(COLOR);
  glow.setEffectSpeed(SPEED);
}

void loop() {
  glow.update();                        // that's it
}

LED_PIN is your data pin. GPIO 3 is the onboard pixel on our CMoz ESP32-S3 Mini, which is still in testing. On any other board, set it to the pin you wired (for example 13 on a classic ESP32) and set NUM_LEDS to the number of LEDs on your strip. If anything is wrong, errorText() prints the reason to the Serial Monitor. The full effects table and pin notes are in the README on GitHub.

PlatformIO: add the library to your platformio.ini:

[env:cmoz_s3_mini]
platform  = espressif32
board     = esp32-s3-devkitc-1
framework = arduino
lib_deps  = cmoz/CMozGlow @ ^1.2.2

Arduino IDE: open Tools > Manage Libraries, search for CMozGlow and install. For an ESP32-S3 board, set USB CDC On Boot to Enabled so CMozGlow's error messages reach the Serial Monitor.

Want to design your effect first? The CMozGlow simulator and code generator runs in your browser and writes the sketch for you.

CMozGlow simulator and code generator

Quick answers

Can I power NeoPixels from an ESP32's 3V3 pin? Yes, for small builds at low brightness. Use 5 V for large or bright builds and connect all grounds.

Which ESP32 pin should I use for NeoPixel data? GPIO 13 is a safe choice on the classic ESP32. Avoid flash pins 6–11, input-only pins 34–39 and strapping pins.

Why do my NeoPixels flicker? Usually a weak power supply, a missing shared ground, a long data wire or a loose joint. In sewn circuits, check for loose stitches.

Why are my colours wrong? WS2812B uses GRB colour order. Set GRB in your code.

Still stuck?

Start from a known-good strip and a test sketch, change one thing at a time, and most problems show themselves quickly. Need LEDs to practise on? The NeoPixel Starter Strip is an easy first step, and there are plenty more in our addressable LEDs collection. You can also bring your question to my Wednesday live stream on CMozMaker. Happy making!

Back to blog

Leave a comment