ESP32 S3 - Blink multiple LED

This tutorial instructs you how to program the ESP32 S3 to blink multiple LEDs simultaneously without using the delay function. By using the ezLED library and LED arrays, you can cleanly manage multiple LEDs with minimal code.

What you'll build:

  1. Wire multiple LEDs to the ESP32 S3 board
  2. Use the ezLED library to blink each LED independently
  3. Control blink timing without blocking delays
  4. Simplify the code further using an array of LED objects

Hardware Preparation

1×ESP32 S3 WROOM N16R8
1×USB Cable Type-A to Type-C (for USB-A PC)
1×USB Cable Type-C to Type-C (for USB-C PC)
1×LED Kit
1×LED (red)
1×LED Module
1×Alternatively, Button and LED Kit
1×220Ω Resistor
1×Breadboard
1×Jumper Wires
1×Optionally, DC Power Jack

Or you can buy the following kits:

1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

Buy Note: Use the LED Module for easier wiring. It includes an integrated resistor.

Overview of LED

The LED (Light Emitting Diode) is one of the most fundamental output components used with microcontrollers like the ESP32 S3. It converts electrical current into visible light and is commonly used for status indicators, debugging signals, and visual feedback in embedded projects. Understanding how to control multiple LEDs independently is an essential skill for building more complex ESP32 S3 applications.

Key Specifications

  • Forward voltage: typically 1.8V–3.3V depending on color
  • Current limiting resistor: 220 ohm recommended for 3.3V logic
  • Control: digital output pin (HIGH = on, LOW = off)

We have a dedicated tutorial about LEDs with detailed information and step-by-step instructions about hardware pinout, working principles, and wiring connections to the ESP32 S3. Learn more at the following link:

Wiring Diagram

Connect each LED in series with a 220 ohm resistor between a GPIO pin on the ESP32 S3 and GND. Make sure to observe correct LED polarity — the longer leg (anode) connects toward the GPIO pin through the resistor, and the shorter leg (cathode) connects to GND.

Safety Notes

Always use a current-limiting resistor with each LED to prevent damage to both the LED and the ESP32 S3 GPIO pin. The ESP32 S3 GPIO pins source up to approximately 40 mA per pin, but keeping current below 12 mA per LED is recommended for safe continuous operation.

The wiring diagram between ESP32 S3 multiple LED

This image is created using Fritzing. Click to enlarge image

GPIO Pin LED
GPIO 39 LED 1 (anode via 220Ω resistor)
GPIO 40 LED 2 (anode via 220Ω resistor)
GPIO 41 LED 3 (anode via 220Ω resistor)
GND All LED cathodes

Serial Monitor Output

Open the Serial Monitor at 9600 baud to observe runtime messages from the ESP32 S3. The following are example readings you might see during operation:

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:00:01] LED 1 ON [2026-01-15 10:00:01] LED 2 ON [2026-01-15 10:00:01] LED 3 ON [2026-01-15 10:00:02] LED 1 OFF [2026-01-15 10:00:02] LED 2 OFF [2026-01-15 10:00:03] LED 1 ON [2026-01-15 10:00:04] LED 3 OFF
Ln 11, Col 1
ESP32S3 Dev Module on COM15
2

Applications

Blinking multiple LEDs independently on the ESP32 S3 is a foundational technique that applies to many real-world embedded projects. Here are some practical use cases:

  1. Status Indicators: Use multiple LEDs to show different system states such as power, connectivity, and error conditions simultaneously.
  2. Traffic Light Simulation: Implement a simple traffic light controller with red, yellow, and green LEDs cycling at defined intervals.
  3. Notification System: Flash different LEDs to signal incoming alerts, messages, or sensor events without blocking other program logic.
  4. Debugging Aid: Assign one LED per subsystem to visually monitor which parts of your ESP32 S3 firmware are active at any moment.
  5. Decorative Lighting: Create animated LED patterns for displays, costumes, or art installations using independent blink timing.

Video Tutorial

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

Challenges

Practicing with variations of this project will help you deepen your understanding of non-blocking code and LED control on the ESP32 S3. Try the following exercises to extend your skills:

  1. Beginner: Add a fourth LED on a new GPIO pin and configure it to blink at a different interval than the existing three.
  2. Intermediate: Modify the array-based code to read blink intervals from an array of values, so you can change all LED timings in one place without touching individual objects.
  3. Advanced: Use the ESP32 S3's built-in touch pins or a button to toggle each LED's blink state on/off independently at runtime, combining input handling with multi-LED output.

※ 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!