What you will build
An LED on a breadboard that switches on and off at a steady rhythm. You will change one number and watch the rhythm change. This is the "hello world" of electronics: if it blinks, your board, cable, drivers and upload tool all work.
How it works
The sketch sets GPIO 26 as an output. In loop() it drives the pin HIGH (3.3 V, LED on), waits, drives it LOW (0 V, LED off), waits, and repeats forever. The resistor limits the current so the LED and the pin are not damaged.
Parts
| Part | Qty | Purpose | Required |
|---|---|---|---|
| ESP32-DevKitC V4 (38-pin) | 1 | Runs your program | Yes |
| 5 mm LED (any colour) | 1 | The light | Yes |
| 220 Ω resistor | 1 | Limits current | Yes |
| Breadboard + 2 jumper wires | 1 set | Connections | Yes |
| USB data cable | 1 | Power and upload | Yes |
Build steps
- Push the ESP32 into the breadboard so it straddles the centre gap.
- Insert the LED. The long leg (anode) goes towards GPIO 26, the short leg (cathode) towards GND.
- Connect GPIO 26 → 220 Ω resistor → LED long leg.
- Connect the LED short leg → GND.
- Plug in the USB cable. In Arduino IDE 2 choose Tools → Board → ESP32 Dev Module and the correct port.
- Paste the code below and click Upload. Checkpoint: the LED blinks once per second.
- Change
BLINK_MSto200, upload again, and watch it blink faster.
Try it in the browser
Playground Simulation. Open the sketch in the Playground: the virtual LED on the breadboard follows the same code. Edit BLINK_MS and press Run. The simulation shows logic levels, not real voltage or current.
Code
// Blinking LED — XBOTNOW
// Board: ESP32-DevKitC V4 · Core: esp32 v3.x
const int LED_PIN = 26; // GPIO connected to the resistor
const int BLINK_MS = 1000; // time on and time off, in milliseconds
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
digitalWrite(LED_PIN, HIGH); // LED on
delay(BLINK_MS);
digitalWrite(LED_PIN, LOW); // LED off
delay(BLINK_MS);
}
Troubleshooting
| Symptom | Likely cause | Check |
|---|---|---|
| No port in Arduino IDE | Charge-only cable or missing USB driver | Try another cable; install the CP210x or CH340 driver for your board |
| Upload stuck at "Connecting…" | Board not in boot mode | Hold BOOT, click Upload, release when writing starts |
| Uploads but LED stays dark | LED reversed or wrong pin | Flip the LED; confirm the wire is on GPIO 26 |
| LED very dim | Resistor too large | Use 220–330 Ω |
Safety and limitations
Always use the resistor. GPIO pins supply a few milliamps of logic current. They cannot power motors, LED strips or anything over 3.3 V.
Checklist
Next project
Button-controlled Light: make the LED react to you instead of a timer.

