ESP32 S3 UNO - Blink multiple LED

ESP32 S3 Uno blink multiple LED

This ESP32 S3 Uno blink multiple LED tutorial shows you how to make several LEDs blink at different speeds at the same time on the ESP32 S3 Uno form board. You will not use the delay() function, so every LED keeps its own rhythm. The example uses three LEDs, but you can easily change it to blink two LEDs, four LEDs or more.

In this tutorial, you will:

  1. Wire three LEDs to the ESP32 S3 Uno
  2. Blink multiple LEDs at different speeds without delay()
  3. Install and use the ezLED library in the Arduino IDE
  4. Manage an array of LEDs with a simple for loop

Hardware Preparation

1×ESP32 S3 Uno-form Board
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

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

This project builds on the single LED basics. If you have not used an LED before, learn how it works first, because each LED here is wired the same way.

The LED tutorial explains the LED pins, how it lights up, how to wire it with a resistor and how to control it with code on the ESP32 S3 Uno. You can read it here: ESP32 S3 Uno - LED tutorial.

※ NOTE THAT:

You need one LED and one 220 ohm resistor for each LED you want to blink. For this example, that means three LEDs and three resistors.

ESP32 S3 Uno Pinout

The image below shows the pinout diagram of the ESP32 S3 Uno form board. Use it to find the Uno header pins (D7, D8, D9…) and their GPIO numbers when you wire the LEDs.

ESP32 S3 Uno pinout diagram

Wiring Diagram

Each LED connects to its own pin through a 220 ohm resistor, and all LED cathodes go to GND.

The wiring diagram between ESP32 S3 Uno multiple LED

This image is created using Fritzing. Click to enlarge image

Component Pin ESP32 S3 Uno Pin
LED 1 anode (+) through 220 ohm resistor D7 (GPIO14)
LED 2 anode (+) through 220 ohm resistor D8 (GPIO21)
LED 3 anode (+) through 220 ohm resistor D9 (GPIO46)
LED 1, 2, 3 cathode (-) GND

WARNING

LED 3 uses D9 (GPIO46). This is a boot strapping pin on the ESP32 S3 Uno. The chip reads it at startup to pick the boot mode. An LED with a 220 ohm resistor to GND is normally fine, but if the board does not boot or upload, unplug the wire from D9 first, upload the code, then plug it back in.

※ NOTE THAT:

The ESP32 S3 Uno pins work at 3.3V, not 5V. A 220 ohm resistor still works well, the LEDs are just a little less bright than on a 5V board.

Video Tutorial

Watch the video below to see this ESP32 S3 Uno project step by step.

FAQ

Can I blink multiple LEDs on the ESP32 S3 Uno without delay()?

Yes. Use millis() to check the time, or use the ezLED library, which does the timing for you. With delay(), the board stops and waits, so the LEDs cannot blink at different speeds.

Which pins can I use for LEDs on the ESP32 S3 Uno?

Almost any Uno header pin works, because they all support digital output and PWM. Good choices are D2 (GPIO18), D3 (GPIO17), D4 (GPIO19), D5 (GPIO20), D7 (GPIO14) and D8 (GPIO21). In code, always write the GPIO number, not the D label. Avoid D0 and D1, because they are used for USB serial.

Do I need a different resistor on the ESP32 S3 Uno than on a 5V Arduino?

No. A 220 ohm resistor works fine. The ESP32 S3 Uno pins give 3.3V, so the current is a bit lower and the LED is a little dimmer. Do not connect an LED without a resistor, because it can damage the pin.

Why does my board not boot when an LED is on D9?

D9 is GPIO46 on the ESP32 S3 Uno, which is a boot strapping pin. The chip reads it at startup. A plain LED with a resistor to GND usually does not cause a problem, but if the board does not start or upload, unplug D9 while you upload, or move the LED to a free pin and change the pin number in code.

What if I want to blink more LEDs than the Uno headers give?

The ESP32 S3 Uno has two extra rows of holes with more GPIOs: GPIO15 and GPIO16 (I/O, PWM, analog), GPIO45 and GPIO35 to GPIO42 (I/O, PWM), and GPIO47/GPIO48 (output only, PWM). Solder pin headers to use them and write the GPIO number in code. For extra LEDs, GPIO35 to GPIO42, GPIO15 and GPIO16 are the best choice. Be careful with two things. First, GPIO47 and GPIO48 may run at 1.8V instead of 3.3V on some modules (especially ones with "V" in the name, like R8V or R16V), so 3.3V devices can be damaged or act strangely. Second, GPIO0, GPIO3 (D6), GPIO45 and GPIO46 (D9) are boot strapping pins, and a wrong connection can stop the board from booting or uploading code. Use the other extra pins first.

Does the ezLED library work on the ESP32 S3 Uno?

Yes. The ezLED library only uses standard Arduino functions like digitalWrite() and millis(), so it works on the ESP32 S3 Uno just like on other Arduino boards.

Troubleshooting

Problem Possible Cause Solution
No COM port in the Arduino IDE USB driver missing or charge-only cable Install the CP210x or CH340 driver, use a data USB cable, or hold BOOT while pressing RESET
Upload fails or board does not start LED circuit on D9 (GPIO46) affects the boot strapping pin Unplug the D9 wire while uploading, then plug it back in
One LED never lights up LED is in backwards or the wire is loose Put the long leg (anode) toward the resistor and pin, and check every jumper wire
All LEDs stay off Common GND wire is missing Connect all LED cathodes to a GND pin of the ESP32 S3 Uno
Compile error ezLED.h not found ezLED library is not installed Install ezLED from the Library Manager
LEDs blink once and then stop The loop() function of an LED object is not called Call loop() for every LED object inside loop()
LEDs are very dim Resistor value is too high Use a 220 ohm resistor, the pins only give 3.3V

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