ESP32 C3 Super Mini - LED Module

Add a big, bright status light to your ESP32 C3 Super Mini project with a 10mm LED module. The module plugs in with three jumper wires and needs no extra parts, so you can go from an empty breadboard to a blinking light in a few minutes.

In this tutorial, you'll learn:

ESP32 C3 Super Mini - LED Module

Hardware Preparation

1×ESP32 C3 Super Mini
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 Module
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 Module

Think of the LED module as an LED that comes with its own helper parts. A 10mm diffused LED sits on a tiny 20mm x 20mm black board, together with a current-limiting resistor and a small transistor. The ESP32 C3 Super Mini only tells the transistor when to switch, and the transistor feeds the LED from the VCC pin. You get a clean, evenly lit dot of light without doing any resistor math.

Key Features:

  • 10mm diffused round LED - soft light that is easy to see from across the room
  • Comes in a pack of 5 colors: red, yellow, blue, green and white
  • Works from 3.3V to 5V DC - happy on the 3.3V rail of the ESP32 C3 Super Mini
  • Onboard 330Ω resistor for the LED and 1KΩ resistor on the IN line
  • Onboard transistor switch: IN = HIGH turns the LED ON, IN = LOW turns it OFF
  • Presoldered 3-pin right-angle header (2.54mm pitch)

Why the LED Module is Great for Beginners:

  • No resistor to pick and no risk of burning the LED with a wrong value
  • No anode/cathode guessing - every pin is printed on the board
  • The GPIO pin only drives the transistor, so it gives a tiny current and stays cool
  • Supports PWM on the IN pin, so the same module can blink, dim and "breathe"

LED Module Pinout

The module has one 3-pin header. The pins are labeled GND, VCC and IN, in that order:

  • GND pin: the ground connection; join it to a GND pin of the ESP32 C3 Super Mini (0V)
  • VCC pin: the power for the LED; join it to the 3.3V pin (5V also works)
  • IN pin: the control input; join it to a GPIO pin. HIGH = LED ON, LOW = LED OFF, PWM = dimmed LED
LED Module Pinout
image source: diyables.io

※ NOTE THAT:

LED module vs. bare LED: a bare LED has two legs (anode and cathode) that must face the right way, and it needs a series resistor (for example 220Ω) or it can burn out. The LED module removes both problems: the resistor is already on the board, and the labeled pins tell you exactly where each wire goes. See the ESP32 C3 Super Mini LED blink tutorial if you want to compare it with a bare LED.

Wiring Diagram between LED Module and ESP32 C3 Super Mini

Only three wires are needed. Power the module from the 3.3V pin and send the control signal from GPIO7 (marked D7 in the Arduino code examples of this site). GPIO7 is a good choice because it is not a strapping pin, so it does not affect how the board boots, and it can output PWM for the fade example.

The wiring diagram between ESP32 C3 Super Mini LED Module

This image is created using Fritzing. Click to enlarge image

LED Module Pin ESP32 C3 Super Mini Pin
GND GND
VCC 3.3V
IN D7 (GPIO7)

※ NOTE THAT:

Avoid GPIO8 for the IN pin. On most ESP32 C3 Super Mini boards GPIO8 already drives the small blue onboard LED, and it is also a strapping pin (together with GPIO2 and GPIO9).

ESP32 C3 Super Mini Code - Fade LED Module with PWM

Because the IN pin only switches the onboard transistor, a PWM signal on IN switches the LED at the same rate. The longer the ON part of each cycle, the brighter the LED looks. This sketch uses analogWrite() to move the brightness from 0 up to 255 and back down in 17 steps each way.

What the code does:

  • Sets GPIO7 as an output for the PWM signal
  • Writes a brightness value from 0 (OFF) to 255 (full) to the IN pin with analogWrite()
  • Prints the brightness as a raw value and as a percentage
  • Adds 15 to the brightness on every step, and reverses the direction at 0 and 255
  • Waits 60 milliseconds between steps, so one full fade in and out takes about 2 seconds
/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-led-module */ // ESP32 C3 Super Mini - LED Module: fade the LED up and down with PWM // No library is needed. analogWrite() sends a PWM signal to the IN pin of the module, // and the onboard transistor switches the LED at the same duty cycle. #define LED_MODULE_PIN 7 // The ESP32 C3 SuperMini pin GPIO7 (D7) connected to the IN pin of the LED module #define FADE_STEP 15 // how much the brightness changes on each step (255 / 15 = 17 steps per direction) #define STEP_DELAY 60 // time between two steps, in milliseconds (bigger value = slower fade) int brightness = 0; // current PWM duty cycle: 0 = LED OFF, 255 = full brightness int fade_amount = FADE_STEP; // positive = getting brighter, negative = getting dimmer // The setup function runs once on reset or power-up void setup() { Serial.begin(115200); // start the Serial Monitor at 115200 baud (enable "USB CDC On Boot" in Arduino IDE) pinMode(LED_MODULE_PIN, OUTPUT); // set GPIO7 as an output; analogWrite() will produce PWM on it } // The loop function repeats indefinitely void loop() { analogWrite(LED_MODULE_PIN, brightness); // apply the current brightness (duty cycle 0 to 255) to the IN pin Serial.print("Brightness: "); Serial.print(brightness); // print the raw PWM value Serial.print("/255 ("); Serial.print(brightness * 100 / 255); // print the same value as a percentage Serial.println("%)"); brightness = brightness + fade_amount; // move one step towards brighter or dimmer // when the brightness reaches either end, clamp it and reverse the fade direction if (brightness <= 0) { brightness = 0; // never go below 0 (LED fully OFF) fade_amount = FADE_STEP; // start fading in again } else if (brightness >= 255) { brightness = 255; // never go above 255 (LED fully ON) fade_amount = -FADE_STEP; // start fading out again } delay(STEP_DELAY); // wait a little so the eye can see each brightness level }

Detailed Instructions

  • Keep the same wiring: The fade sketch uses the same GPIO7 pin, so you do not need to move any wire.
  • Copy the code: Copy the fade code above and paste it into a new Arduino IDE sketch.
  • Upload the code: Click the Upload button.
  • Open Serial Monitor: Keep the baud rate at 115200.
  • Observe the result: The LED module slowly gets brighter, then slowly dims, like it is breathing. The Serial Monitor prints every brightness level:
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32C3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32C3 Dev Module' on 'COM15')
New Line
9600 baud
Brightness: 0/255 (0%) Brightness: 15/255 (5%) Brightness: 30/255 (11%) Brightness: 45/255 (17%) Brightness: 60/255 (23%) Brightness: 75/255 (29%) Brightness: 90/255 (35%) Brightness: 105/255 (41%) Brightness: 120/255 (47%) Brightness: 135/255 (52%) Brightness: 150/255 (58%) Brightness: 165/255 (64%) Brightness: 180/255 (70%) Brightness: 195/255 (76%) Brightness: 210/255 (82%) Brightness: 225/255 (88%) Brightness: 240/255 (94%) Brightness: 255/255 (100%) Brightness: 240/255 (94%) Brightness: 225/255 (88%)
Ln 11, Col 1
ESP32C3 Dev Module on COM15
2
  • Pro Tip: Change FADE_STEP to 5 for a smoother fade, or STEP_DELAY to 150 for a slow "sleeping" glow. For more fade methods without delay(), see the ESP32 C3 Super Mini LED fade tutorial.

Line-by-line Code Explanation

The above ESP32 C3 Super Mini code contains line-by-line explanation. Please read the comments in the code!

Applications and Project Ideas

The ESP32 C3 Super Mini has WiFi and Bluetooth LE, so the LED module makes a good "at a glance" light for small connected gadgets:

  • WiFi status light: blink fast while connecting to WiFi, stay ON once connected
  • Heartbeat light: a slow fade shows the board is alive and the code has not frozen
  • Fault or alarm light: use the red module to warn when a sensor value goes out of range
  • Desk notification lamp: light the LED when a new message or e-mail arrives over WiFi
  • Traffic light model: combine the red, yellow and green modules on three GPIO pins
  • Plant watering reminder: turn on the blue module when soil moisture is too low

Video Tutorial

Watch the video below for a visual walkthrough of this project.

Challenge Yourself

Try these tasks to practice with your ESP32 C3 Super Mini and LED module:

  • Easy: Make the LED stay ON for 200ms and OFF for 1800ms, like a short "ping" flash
  • Easy: Limit the fade so the brightness only goes between 30 and 180
  • Medium: Wire a second LED module of another color and make the two blink in turn
  • Medium: Type "on" or "off" in the Serial Monitor to control the LED module by hand
  • Advanced: Rewrite the blink sketch with millis() so the board can read a button at the same time
  • Advanced: Host a small web page on the ESP32 C3 Super Mini with a slider that sets the LED brightness over WiFi

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