ESP32 S3 UNO - LED Strip
This ESP32 S3 Uno LED strip tutorial shows you how to switch a 12V LED strip on and off with relays and simple Arduino code. You will work with both a single-color LED tape and a 12V RGB LED strip on the ESP32 S3 Uno form board. In the end, your strip will blink on a timer or cycle through seven colors.
In this tutorial, you will:
- Learn the difference between addressable and non-addressable LED strips
- Wire a relay module to control a 12V LED strip
- Switch a single-color LED ribbon on and off from code
- Mix red, green and blue channels to show seven colors on an RGB LED strip
- Upload and test the code with the Arduino IDE
Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of LED Strip
An LED strip is a thin, flexible circuit board covered with small LEDs. People also call it LED tape or LED ribbon. You often see it under kitchen cabinets, behind TVs and along shelves, where it gives a soft glow or highlights an area.
Addressable LED strips
Every LED on an addressable strip has its own address. Because of this, you can set the color and brightness of each LED on its own.
Non-addressable LED strips
On a non-addressable strip, all the LEDs share the same wires. When you change the color or brightness, the whole strip changes at once.
This guide covers non-addressable LED strips only. If you have an addressable strip, use one of these tutorials instead:
- ESP32 S3 Uno - NeoPixel LED Strip tutorial
- ESP32 S3 Uno - WS2812B LED Strip tutorial
- ESP32 S3 Uno - DotStar LED Strip tutorial
Non-Addressable LED Strip Pinout
Knowing the pins tells you where the power goes and which wire turns each color on. Non-addressable strips come in two main kinds.
1-color LED strip
The color of this strip is fixed by the factory. It usually has two pins:
| Pin | Connection |
|---|---|
| 12V/24V | Positive (+) terminal of a 12V or 24V DC power supply |
| GND | Negative (-) terminal of a 12V or 24V DC power supply |
RGB LED strip
This strip can show many colors because it has a separate wire for red, green and blue. It usually has four pins:
| Pin | Connection |
|---|---|
| 12V/24V | Positive (+) terminal of a 12V or 24V DC power supply |
| R | Red channel. Connect it to the negative (-) terminal of the supply to light red |
| G | Green channel. Connect it to the negative (-) terminal of the supply to light green |
| B | Blue channel. Connect it to the negative (-) terminal of the supply to light blue |

Below, you will control each type with the ESP32 S3 Uno, one at a time.
How to Control a Non-Addressable 1-color LED strip.
A 12V LED strip lights up as soon as you connect it to a 12V power supply. The ESP32 S3 Uno works at 3.3V and cannot power the strip, so you need a relay between them. The ESP32 S3 Uno switches the relay, and the relay switches the 12V power of the strip.
If relays are new to you, read the ESP32 S3 Uno - Relay tutorial first. It explains the relay pinout, how it works and how to program it.
ESP32 S3 Uno Pinout
The image below shows the pinout diagram of the ESP32 S3 Uno form board. Use it to find the D3, D5, D6 and D7 headers and their GPIO numbers when you wire the relays.

Wiring Diagram.
The ESP32 S3 Uno only drives the relay inputs. The LED strip, the 12V power adapter and the DC power jack sit on the relay output side, so the 12V never touches the board.
Wiring Diagram between ESP32 S3 Uno and Non-Addressable 1-color LED strip.
One relay switches the whole strip. Its signal wire goes to D3.

This image is created using Fritzing. Click to enlarge image
| Component Pin | ESP32 S3 Uno Pin |
|---|---|
| Relay VCC | 5V |
| Relay GND | GND |
| Relay IN | D3 (GPIO17) |
Wiring Diagram between ESP32 S3 Uno and Non-Addressable RGB LED strip.
Each color channel needs its own relay, so you use three relays (or a multi-channel relay module).

This image is created using Fritzing. Click to enlarge image
| Component Pin | ESP32 S3 Uno Pin |
|---|---|
| Relay VCC | 5V |
| Relay GND | GND |
| Relay 1 IN (Blue) | D5 (GPIO20) |
| Relay 2 IN (Red) | D6 (GPIO3) |
| Relay 3 IN (Green) | D7 (GPIO14) |
WARNING
D6 (GPIO3) is a boot strapping pin on the ESP32 S3 Uno. The chip reads it at startup. A relay input usually does not cause trouble, but if the board fails to boot or upload, unplug the D6 wire, upload the code, then plug it back in.
※ NOTE THAT:
Most relay modules have a 5V coil, so power the relay VCC from the 5V pin. The IN pin only gets the 3.3V signal from the ESP32 S3 Uno, which most modules accept. Never send a 5V signal back into an ESP32 S3 Uno pin, because the ESP32 S3 Uno pins are NOT 5V tolerant.
ESP32 S3 Uno Code
There are two sketches below, one for each strip type. Both only use digitalWrite(), so no extra library is needed.
ESP32 S3 Uno Code for controlling Non-Addressable 1-color LED strip.
This sketch switches the relay on D3 every 5 seconds. The LED strip stays on for 5 seconds, then off for 5 seconds, and repeats forever. Each change is also printed to the Serial Monitor.
ESP32 S3 Uno Code for controlling Non-Addressable RGB LED strip.
This sketch turns the three color relays on and off in different combinations. The strip shows red, green, blue, yellow, magenta, cyan and white, with 2 seconds for each color.
Detailed Instructions
Follow these steps in order:
- New to the ESP32 S3 Uno? Follow ESP32 S3 Uno - Getting Started first.
- Wire it up as shown in the diagram for your strip type.
- Connect the board to your computer with a USB Type-C cable.
- Open Arduino IDE, choose the ESP32S3 Dev Module board and the correct COM port.
- Copy the code for your strip type and paste it into the Arduino IDE.
- Upload the code by clicking the Upload button.
- Open the Serial Monitor at 9600 baud and watch the LED strip.
- Tip: You should hear the relay click each time the strip changes. If it clicks but the strip stays dark, check the 12V adapter and the relay output wires.
For the RGB sketch, the Serial Monitor shows something like this:
Code Explanation
The comments in the code explain each line. The idea is simple: each relay is a digital output, so HIGH turns that channel on and LOW turns it off. On the RGB strip, turning two or three channels on at once mixes the colors.
A relay can only switch fully on or fully off. If you want to dim the strip or mix in-between colors, use a PWM driver such as the L298N driver instead of a relay.
Video Tutorial
Watch the video below to see this ESP32 S3 Uno project step by step.
FAQ
Can the ESP32 S3 Uno power a 12V LED strip directly?
No. The ESP32 S3 Uno pins give only 3.3V and a small current. The strip needs its own 12V power adapter. The board only switches a relay, and the relay switches the 12V.
Will a 5V relay module work with the 3.3V ESP32 S3 Uno pins?
Most 5V relay modules work. Power the module VCC from the 5V pin, and connect IN to a GPIO. The 3.3V signal is enough for most modules with a transistor input. If the relay LED lights but the relay does not click, use a 3V relay module.
Can I dim the LED strip or make other colors?
Not with a relay, because it is only on or off. Use a MOSFET module or an L298N driver and the analogWrite() function. The ESP32 S3 Uno supports PWM on all the Uno header pins used here.
Can I use a 24V LED strip instead of a 12V one?
Yes. Use a 24V power adapter that matches the strip, and check that the relay contacts are rated for the voltage and current. The code stays the same.
Why does the RGB code use pin 3 for red when the wire goes to D6?
On the ESP32 S3 Uno, the header label and the GPIO number are different. D6 is GPIO3, D5 is GPIO20 and D7 is GPIO14. In code you always write the GPIO number.
What if my project needs more pins than the Uno headers give?
The ESP32 S3 Uno has two extra rows of holes with more GPIOs. GPIO15 and GPIO16 work as I/O, PWM and analog. GPIO45 and GPIO35 to GPIO42 work as I/O and PWM. GPIO47 and GPIO48 are output only, with PWM. Solder pin headers to them and write the GPIO number in code. For extra relays, GPIO35 to GPIO42 are a good 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.
Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| No COM port in Arduino IDE | USB driver is missing or the board is not in upload mode | Install the CP210x or CH340 driver, or hold BOOT while pressing RESET |
| Relay never clicks | Relay VCC or GND is not connected | Power VCC from 5V and check the GND wire |
| Relay LED lights but it does not click | The 3.3V signal is too weak for this module | Use a 3V relay module or one with a transistor input |
| Relay clicks but the strip stays dark | 12V adapter is off or the strip is on the wrong relay terminals | Check the adapter, the DC power jack and use the COM and NO terminals |
| Strip is on when it should be off | Relay module is LOW level trigger or wired to NC | Use the NO terminal, or swap HIGH and LOW in the code |
| Wrong colors on the RGB strip | R, G and B wires go to the wrong relays | Match red to D6, green to D7 and blue to D5 |
| Board does not boot or upload with the RGB wiring | D6 (GPIO3) is a boot strapping pin | Unplug the D6 wire, upload, then plug it back in |
| Board resets when the relay switches | Power drop from the relay coils | Use a good USB cable or power supply and keep the 12V load on its own adapter |