The Hardware Setup

Because the ESP32-S3 DevKitC-1 lacks a traditional built-in status LED on a standard GPIO, we will connect an external LED to GPIO 2. Always use a current-limiting resistor to protect your microcontroller pin from drawing too much current.

ESP32-S3 LED Wiring Diagram Figure 1: Connecting an external LED to GPIO 2 via a 220Ω resistor.
LED Long Leg (Anode): GPIO 2 (via Resistor)
LED Short Leg (Cathode): GND (Ground)
Resistor Value: 220Ω to 330Ω

The Arduino Source Code

Copy and paste this code directly into your Arduino IDE. Make sure you have selected ESP32S3 Dev Module under your Tools > Board menu.


// ESP32-S3 LED Blink Tutorial - CircuitHub.pro
#include <Arduino.h>

// Define the pin connected to our LED
const int LED_PIN = 2; 

void setup() {
  // Initialize the GPIO pin as an output
  pinMode(LED_PIN, OUTPUT);
}

void loop() {
  // Turn the LED on (HIGH voltage level)
  digitalWrite(LED_PIN, HIGH);
  delay(1000); // Wait for 1 second (1000 milliseconds)
  
  // Turn the LED off (LOW voltage level)
  digitalWrite(LED_PIN, LOW);
  delay(1000); // Wait for 1 second
}
                    

Required Components

Need to grab the parts for this project? Here is exactly what was used in this guide. Click any item to view it on Amazon:

ESP32-S3 Board ESP32-S3 DevKitC-1 Buy Board
220 Ohm Resistor 220Ω Resistor Pack Buy Resistors
Breadboard and Wires Breadboard & Wires Buy Kit

🚀 Take It Further: The SOS Challenge

Now that you can blink an LED, try modifying the delay() timings in the code to flash Morse code! Can you make the LED blink the international distress signal?

  • S (Short): 3 quick blinks (200ms delay)
  • O (Long): 3 long blinks (600ms delay)
  • S (Short): 3 quick blinks (200ms delay)

Stuck? Check out our upcoming Intermediate Coding guides for the solution!