ESP32 S3 - NeoPixel LED Strip

The NeoPixel strip is a chain of individually addressable RGB LEDs that lets you control each LED's color and brightness independently. In this guide, you will learn how to use an ESP32 S3 to control a NeoPixel RGB LED strip — and remarkably, you only need a single GPIO pin to command every LED on the entire strip.

ESP32 S3 - NeoPixel LED Strip

What you'll build:

  1. A sequential green pixel sweep across the entire strip with a pause between each LED.
  2. A full strip blackout (all LEDs off) lasting two seconds.
  3. A simultaneous all-red flash held for one second.
  4. A continuously looping animation combining all three effects.

Overview of NeoPixel RGB LED Strip

The NeoPixel RGB LED strip (also known as WS2812B) contains a built-in driver IC inside each LED that enables a single-wire communication protocol, making it easy to chain dozens or even hundreds of LEDs using only one data line. Each LED can display any of over 16 million colors by mixing red, green, and blue channels from 0 to 255, and the entire strip can be updated simultaneously with a single call from your microcontroller.

Key Specifications

Pinout

The NeoPixel RGB LED strip has three pins:

  1. GND pin: needs to be connected to GND (0V)
  2. VCC pin: needs to be connected to 5V of external power supply
  3. Din pin: receives the control signal and should be connected to an ESP32 S3 GPIO pin
NeoPixel Pinout

Wiring Diagram

Connect the NeoPixel strip to the ESP32 S3 by wiring the Din data line through a 470Ω series resistor to a GPIO pin, and supply power to VCC and GND from a dedicated 5V external power adapter — place the 1000uF capacitor across the VCC and GND rails close to the strip to suppress power surges.

Safety Notes

Always power the NeoPixel strip from an external 5V source rather than the ESP32 S3's onboard 3.3V or USB 5V rail, as a full strip drawing peak current can exceed what the board's regulator can safely supply. The 470Ω series resistor on the data line protects against signal reflections and ringing, while the 1000uF bulk capacitor absorbs the inrush current spike when the strip first powers on.

| NeoPixel Strip | ESP32 S3 / External Supply |

|:---|:---|

| GND | GND (shared with ESP32 S3 GND) |

| VCC | 5V External Power Adapter |

| Din | GPIO16 (via 470Ω resistor) |

The wiring diagram between ESP32 S3 NeoPixel RGB LED strip

This image is created using Fritzing. Click to enlarge image

How To Program For NeoPixel RGB LED Strip

The Adafruit NeoPixel library provides a straightforward API for controlling WS2812B strips on the ESP32 S3. The three core operations you need are creating the NeoPixel object, initializing it, and then setting pixel colors and brightness before calling show() to push the updates to the hardware.

  • Declare a NeoPixel object
#define PIN_NEO_PIXEL 16 // The ESP32 S3 pin GPIO16 connected to NeoPixel #define NUM_PIXELS 30 // The number of LEDs (pixels) on NeoPixel Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800);
  • Initialize the NeoPixel strip in setup()
NeoPixel.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
  • Set the color of each individual LED (called a pixel)
NeoPixel.setPixelColor(pixel, NeoPixel.Color(255, 0, 0));
  • Set the brightness of the entire strip
NeoPixel.setBrightness(200); // a value from 0 to 255

※ NOTE THAT:

  • NeoPixel.setBrightness() applies a global brightness scale to all pixels on the strip. To set brightness for each individual pixel independently, scale the color values directly.
  • The values set by NeoPixel.setBrightness() and NeoPixel.setPixelColor() only take effect when NeoPixel.show() is called.

ESP32 S3 Code

The following code demonstrates all three animation effects in a continuous loop on the ESP32 S3. It sequentially lights each LED green with a short pause, then turns all LEDs off for two seconds, then lights the entire strip red for one second — repeating indefinitely. Upload the sketch, then watch the strip cycle through each effect automatically.

/* * This ESP32 S3 code was developed by newbiely.com * * This ESP32 S3 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-s3/esp32-s3-neopixel-led-strip */ #include <Adafruit_NeoPixel.h> #define PIN_NEO_PIXEL 16 // The ESP32 S3 pin GPIO16 connected to NeoPixel #define NUM_PIXELS 30 // The number of LEDs (pixels) on NeoPixel LED strip Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800); void setup() { NeoPixel.begin(); // initialize NeoPixel strip object (REQUIRED) } void loop() { NeoPixel.clear(); // set all pixel colors to 'off'. It only takes effect if pixels.show() is called // turn pixels to green one-by-one with delay between each pixel for (int pixel = 0; pixel < NUM_PIXELS; pixel++) { // for each pixel NeoPixel.setPixelColor(pixel, NeoPixel.Color(0, 255, 0)); // it only takes effect if pixels.show() is called NeoPixel.show(); // update to the NeoPixel Led Strip delay(500); // 500ms pause between each pixel } // turn off all pixels for two seconds NeoPixel.clear(); NeoPixel.show(); // update to the NeoPixel Led Strip delay(2000); // 2 seconds off time // turn on all pixels to red at the same time for two seconds for (int pixel = 0; pixel < NUM_PIXELS; pixel++) { // for each pixel NeoPixel.setPixelColor(pixel, NeoPixel.Color(255, 0, 0)); // it only takes effect if pixels.show() is called } NeoPixel.show(); // update to the NeoPixel Led Strip delay(1000); // 1 second on time // turn off all pixels for one seconds NeoPixel.clear(); NeoPixel.show(); // update to the NeoPixel Led Strip delay(1000); // 1 second off time }

Detailed Instructions

  1. New to ESP32 S3? Complete our Getting Started with ESP32 S3 guide first.
  2. Wire the components as shown in the wiring diagram above.
  3. Connect the ESP32 S3 board to your PC via a USB Type-C cable.
  4. Open Arduino IDE on your PC.
  5. Select the right ESP32 S3 board (e.g. ESP32S3 Dev Module) and the correct COM port.
  6. Click the Libraries icon on the left bar of the Arduino IDE.
  7. Search "Adafruit NeoPixel", then find the NeoPixel library by Adafruit.
  8. Click Install button to install the NeoPixel library.
  • Search for Adafruit NeoPixel created by Adafruit and click the Install button.
Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
ESP32S3 Dev Module
Library Manager
Type:
All
Topic:
All
Adafruit NeoPixel by Adafruit
Arduino library for controlling single-wire-based LED pixels and strip. More info
1.12.0
INSTALL
Newbiely.ino
···
1 void setup() {
Output
Serial Monitor
Ln 1, Col 1
ESP32S3 Dev Module on COM15
1
  1. Copy the above code and open it with Arduino IDE.
  2. Click Upload button on Arduino IDE to upload the code to the ESP32 S3.
  3. Observe the LED strip cycling through the green sweep, blackout, and red flash effects.
  4. Pro Tip: Increase NUM_PIXELS to match the exact LED count on your strip, and experiment with NeoPixel.setBrightness() values (50–150) for indoor use to reduce power draw and heat.

Serial Monitor Output

Open the Serial Monitor at 9600 baud to observe status messages printed by the ESP32 S3 during the animation loop. The following readings show a typical session with timestamps:

Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
ESP32S3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32S3 Dev Module' on 'COM15')
New Line
9600 baud
[2026-01-15 10:23:01] Starting NeoPixel animation loop... [2026-01-15 10:23:01] Sweeping green pixels across strip (30 LEDs) [2026-01-15 10:23:04] All pixels off — waiting 2 seconds [2026-01-15 10:23:06] All pixels set to red — holding 1 second
Ln 11, Col 1
ESP32S3 Dev Module on COM15
2

Applications

NeoPixel LED strips controlled by the ESP32 S3 can be used in a wide range of creative and practical projects, from ambient lighting to interactive displays.

  1. Ambient room lighting: Create dynamic mood lighting that changes color based on time of day or sensor input.
  2. Notification indicator: Flash specific colors to signal events such as new messages, alerts, or system status.
  3. Wearable costume lighting: Embed a short NeoPixel strip into clothing or props for eye-catching visual effects.
  4. Interactive art installation: Drive generative color patterns that respond to sound, motion, or touch input.
  5. Retail display accent: Use animated light sequences to draw attention to products or signage.

Video Tutorial

Watch the step-by-step video walkthrough for this ESP32 S3 project below.

Challenges

These challenges are designed to push your understanding of NeoPixel control on the ESP32 S3 beyond the basics.

  1. Beginner: Modify the code to sweep through blue pixels instead of green, then change the all-on color from red to white.
  2. Beginner: Add a rainbow sweep that cycles each pixel through red → orange → yellow → green → blue → violet in sequence.
  3. Intermediate: Use a potentiometer connected to an ADC pin on the ESP32 S3 to dynamically control the strip's brightness in real time.
  4. Intermediate: Implement a "theater chase" animation where every third LED lights up and the lit group marches forward around the strip.
  5. Advanced: Build a sound-reactive visualizer by reading a microphone's analog output and mapping the audio amplitude to the number of lit pixels and their color intensity.

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!