ESP32 S3 - LED Module

A bare LED on a 3.3V pin always asks two questions: which leg goes where, and which resistor do I need? The 10mm LED module answers both for you, so your ESP32 S3 only has to send one signal wire to switch a big, bright status light.

What you'll build in this tutorial:

  1. What sits on the LED module board and why its IN pin is so easy to drive
  2. How to connect GND, VCC and IN to the ESP32 S3 with three jumper wires
  3. How to upload a sketch that blinks the module once per second and reports each change
  4. How to upload a second sketch that brightens and dims the module with PWM
ESP32 S3 and 10mm LED Module

Hardware Preparation

1×ESP32 S3 WROOM N16R8
1×Alternatively, ESP32 S3 SuperMini Dev Module
1×Alternatively, ESP32 S3 Uno-form Board
1×Alternatively, ESP32 S3 Camera 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×Optionally, DC Power Jack
1×LED Module
1×Breadboard
1×Jumper Wires
1×Recommended: Screw Terminal Expansion Board for ESP32 S3
1×Recommended: Breakout Expansion Board for ESP32 S3
1×Recommended: Power Splitter for ESP32 S3

Or you can buy the following kits:

1×DIYables ESP32 S3 Starter Kit (ESP32 S3 included)
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 Module

LED Module Pinout
image source: diyables.io

Think of this module as an LED that has already been wired for you. A 10mm diffused LED sits on a small black board, and right next to it are its 330Ω resistor and a tiny transistor switch. The LED takes its power from the VCC pin, not from the ESP32 S3. The IN pin only flips the transistor, through a 1KΩ resistor, so GPIO7 gives just a very small current. This is good news for a 3.3V board like the ESP32 S3: the light does not depend on how much current the GPIO pin can give.

Key Specifications

The board measures 20mm x 20mm and works from 3.3V to 5V DC. Control is active HIGH: IN at HIGH turns the light on, IN at LOW turns it off, and a PWM signal on IN sets any level in between. DIYables sells it as a pack of five colors (red, yellow, blue, green and white), so you can give each signal in a project its own color.

LED Module Pinout

A presoldered 3-pin header with right-angle pins (2.54mm pitch) sits on one edge, labeled in this order:

  1. GND — ground (0V); goes to any GND pin of the ESP32 S3
  2. VCC — power for the LED itself; 5V or 3.3V both work
  3. IN — control input; goes to a GPIO pin that can output PWM (GPIO7 in this guide)

Compared with a plain LED, you never need to find the anode or the cathode, and you never pick a resistor value. The pin names are printed on the board, so the only thing to check is that each wire lands on the right label.

Wiring Diagram

All three module pins go straight to the ESP32 S3 headers, with no other parts in between. Run GND to GND, VCC to the 5V pin, and IN to GPIO7, the same pin our ESP32 S3 LED fade tutorial uses.

The wiring diagram between ESP32 S3 LED module

This image is created using Fritzing. Click to enlarge image

LED Module Pin ESP32 S3 Pin
GND GND
VCC 5V (or 3V3)
IN GPIO7

Safety Notes

Plug or unplug the jumper wires only while the USB cable is out, because a VCC wire that slips onto a GPIO pin for a moment can harm the board. The IN pin is happy with 3.3V logic, so you never need a level shifter here. If you feed VCC from the 3V3 pin instead of 5V, the module still works, but blue and white LEDs may look a bit dimmer, since they need a higher voltage to glow at full strength.

How To Program For LED Module

No library is needed, because the module behaves just like one plain output. In setup(), pinMode() makes GPIO7 an output. After that, digitalWrite() with HIGH or LOW switches the light fully on or off, and analogWrite() with a value from 0 to 255 picks a brightness; on the ESP32 S3 the Arduino core turns that call into a hardware PWM signal for you.

ESP32 S3 Code - LED Module Fade

Now the IN pin gets a PWM signal instead of a plain HIGH or LOW. The duty value climbs from 0 to 255 in steps of 15, then walks back down to 0, and after a half-second pause the cycle starts again. The result is a smooth "breathing" light.

/* * 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-led-module */ #define LED_MODULE_PIN 7 // ESP32 S3 GPIO7 connected to the IN pin of the LED module #define FADE_STEP 15 // how much the duty changes on each step (0 to 255 range) #define STEP_DELAY 60 // time between two steps, in milliseconds void setup() { Serial.begin(9600); pinMode(LED_MODULE_PIN, OUTPUT); } void loop() { // brighten: duty goes from 0 (off) up to 255 (full brightness) for (int duty = 0; duty <= 255; duty += FADE_STEP) { analogWrite(LED_MODULE_PIN, duty); // PWM on the IN pin sets the brightness Serial.print("Brightness: "); Serial.println(duty); delay(STEP_DELAY); } // dim: duty goes from 255 back down to 0 for (int duty = 255; duty >= 0; duty -= FADE_STEP) { analogWrite(LED_MODULE_PIN, duty); Serial.print("Brightness: "); Serial.println(duty); delay(STEP_DELAY); } delay(500); // short dark pause before the next cycle }

Detailed Instructions

  1. Keep the same wiring; GPIO7 already supports PWM, so nothing moves.
  2. Replace the blink sketch with the fade sketch and click Upload.
  3. Keep the Serial Monitor open at 9600 baud and watch the brightness numbers rise and fall.
  4. Pro Tip: Change FADE_STEP to 5 for a softer, slower glow, or STEP_DELAY to 20 for a fast pulse like a heartbeat.
∞
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
Brightness: 0 Brightness: 15 Brightness: 30 Brightness: 45 Brightness: 60 Brightness: 75 Brightness: 90 Brightness: 105 Brightness: 120 Brightness: 135 Brightness: 150 Brightness: 165 Brightness: 180 Brightness: 195 Brightness: 210 Brightness: 225 Brightness: 240 Brightness: 255 Brightness: 255 Brightness: 240 Brightness: 225 Brightness: 210
Ln 11, Col 1
ESP32S3 Dev Module on COM15
2

Application and Project Ideas

A bright, ready-to-wire light like this fits almost any ESP32 S3 project that needs to show its state at a glance.

  1. WiFi status lamp: Keep a green module solid while the ESP32 S3 is online, and blink it while the board is trying to reconnect.
  2. Fault alarm light: Flash a red module fast whenever a sensor reading goes out of its safe range.
  3. Desk traffic-light model: Use red, yellow and green modules on three GPIO pins to rebuild a small crossing.
  4. Heartbeat light: Let a blue module breathe slowly with PWM to show that your sketch is still running.
  5. Message waiting light: Light a white module when the ESP32 S3 receives a new MQTT message, and turn it off when you press a button.

Challenge Yourself

  1. Beginner: Make the module blink twice quickly, then stay dark for two seconds, like a pager light.
  2. Intermediate: Read a potentiometer with analogRead() and use map() to set the module brightness from the knob.
  3. Advanced: Serve a small web page from the ESP32 S3 with ON, OFF and a brightness slider, and control the module from your phone.

Video Tutorial

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

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