ESP32 C3 Super Mini - LED - Blink

Learn how to blink an LED with the ESP32 C3 Super Mini in this beginner-friendly tutorial. This is one of the most fundamental Arduino projects that teaches digital output control—perfect for absolute beginners starting with ESP32 development.

In this tutorial, you'll learn:

ESP32 C3 Super Mini - LED - Blink

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 Kit
1×LED (red)
1×LED Module
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

An LED (Light Emitting Diode) is a semiconductor component that emits light when electric current flows through it.

  • Operating Voltage: Typically 1.8V to 3.3V (varies by color)
  • Current Rating: Usually 20mA for standard LEDs
  • Polarity Sensitive: Must be connected correctly to work
  • Colors Available: Red, green, blue, yellow, white, and more
  • Beginner-Friendly: Easy to use and provides instant visual feedback
  • Low Power: Consumes minimal energy compared to traditional bulbs

LED Pinout

The LED has two pins with different lengths for easy identification:

  • Cathode (-) pin: The shorter leg; connect this pin to GND (0V)
  • Anode (+) pin: The longer leg; connect to the control pin or VCC
LED Pinout

How LED Works

After connecting the cathode(-) to GND:

  • If we connect VCC to the anode(+), LED is ON.
  • If we connect GND to the anode(+), LED is OFF.
How LED Works

In addition, if a PWM signal is generated to the anode(+), the LED's brightness is changed in proportion to the PWM duty cycle. See more detailed in ESP32 C3 Super Mini fade LED tutorial.

※ NOTE THAT:

  • Usually, a resistor is required to protect LED from burning. The resistor can be placed between the anode(+) and VCC or between the cathode(-) and GND. The resistance value depends on the LED's specification.
  • Some LEDs have a built-in resistor, so there is no need to use a resistor for them.
  • For standard 5mm LEDs with ESP32 C3 Super Mini (3.3V output), a 220 ohm resistor is recommended.

ESP32 C3 Super Mini - LED

The ESP32 C3 Super Mini's digital output pin voltage can be programmed to VCC (3.3V) or GND (0V).

  • Digital Control: Each GPIO pin can be set HIGH or LOW
  • Direct Connection: Connect LED directly to any GPIO pin with a resistor
  • Programmable: Control LED state using simple Arduino functions
  • Multiple LEDs: Control several LEDs independently using different pins
  • Foundation Skill: LED control is the basis for controlling relays, motors, and other devices

Wiring Diagram between LED and ESP32 C3 Super Mini

Connect the LED to your ESP32 C3 Super Mini following the wiring diagram below:

  • Safety Note: Always use a current-limiting resistor (220 ohm) to prevent LED damage
  • Polarity Matters: Connect the longer LED leg (anode) to the resistor, and shorter leg (cathode) to GND
The wiring diagram between ESP32 C3 Super Mini LED

This image is created using Fritzing. Click to enlarge image

LED Pin Component ESP32 C3 Super Mini Pin
Anode (+) 220Ω Resistor D7
Cathode (-) Direct Wire GND

How To Program

This code demonstrates basic digital output control on the ESP32 C3 Super Mini:

  • Set up the GPIO pin as a digital output
  • Turn the LED on and off repeatedly
  • Create a blinking effect with time delays
  • Configure an ESP32 C3 Super Mini's pin to the digital output mode by using pinMode() function. For example, pin D7:
pinMode(D7, OUTPUT);
  • Program the pin to GND to turn OFF led by using digitalWrite() function:
digitalWrite(D7, LOW);
  • Program the pin to VCC to turn ON led by using digitalWrite() function:
digitalWrite(D7, HIGH);

ESP32 C3 Super Mini Code

Detailed Instructions

  • New to ESP32 C3 Mini? Complete our Getting Started with ESP32 C3 Mini tutorial first to set up your development environment.
  • Set Up Environment: If you are new to ESP32 C3 Super Mini, refer to the tutorial on how to set up the environment for ESP32 C3 Super Mini in the Arduino IDE
  • Wire the Circuit: Connect the components according to the wiring diagram above
  • Connect Board: Plug the ESP32 C3 Super Mini into your computer using a USB Type-C cable
  • Open Arduino IDE: Launch the Arduino IDE on your computer
  • Select Board: Choose ESP32 C3 Super Mini and its corresponding COM port
  • Copy Code: Copy the code below and paste it into Arduino IDE
/* * 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-blink */ // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin D7 as an output. pinMode(D7, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(D7, HIGH); // turn the LED on delay(500); // wait for 500 milliseconds digitalWrite(D7, LOW); // turn the LED off delay(500); // wait for 500 milliseconds }
  • Upload Code: Click the Upload button in Arduino IDE to compile and upload
How to upload ESP32 C3 Super Mini code on Arduino IDE
  • Observe Results: Watch the LED blink on and off once per second
  • Pro Tip: Try changing the delay values to make the LED blink faster or slower—experiment with 100, 1000, or 2000 milliseconds!

Line-by-line Code Explanation

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

※ NOTE THAT:

The above code uses the delay() function. This function blocks ESP32 C3 Super Mini from doing other tasks. To avoid blocking ESP32, see ESP32 C3 Super Mini blink without delay

Application and Project Ideas

Here are some practical ways to apply LED control with your ESP32 C3 Super Mini:

  • Status Indicator: Create visual alerts for temperature, humidity, or sensor thresholds
  • Smart Home Lighting: Build a WiFi-controlled LED system using ESP32's wireless capabilities
  • Notification System: Flash LEDs when receiving emails, messages, or IoT events
  • Security Alarm: Design a motion-activated LED warning system
  • Traffic Light Controller: Simulate a traffic light with red, yellow, and green LEDs
  • Visual Timer: Create a countdown timer with blinking patterns

Video Tutorial

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

Challenge Yourself

Try these challenges to enhance your ESP32 C3 Super Mini LED control skills:

  • Easy: Change the blink speed to flash 3 times per second instead of once per second
  • Easy: Create an SOS pattern in Morse code (3 short, 3 long, 3 short blinks)
  • Medium: Connect 3 LEDs and make them blink in sequence like a traffic light
  • Medium: Use the Serial Monitor to control LED on/off with keyboard commands
  • Advanced: Implement LED brightness control using PWM and fade effects

Language References

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