ohmio

Circuits / Microcontrollers

ESP32 blinking an LED

A GPIO pin as an output: digitalWrite(13, HIGH) lights D1, delay() sets the rhythm

ESP32 blinking an LED, simulated on a breadboard

Tap a part to see its voltages and currents. It is a model, not a measurement.

What do you need?

How does an ESP32 blink an LED?

A GPIO pin set as an output with pinMode(13, OUTPUT) can be switched between 0 V and 3.3 V by the program. digitalWrite(13, HIGH) puts 3.3 V on pin D13, and current flows through R1 (220 Ω) and the LED back to GND, about 6.7 mA: 1.5 V across the resistor and 1.7 V across the LED. digitalWrite(13, LOW) brings the pin back to 0 V and the LED goes off. The two delay(500) calls hold each state for half a second, so the LED blinks once per second. The resistor matters even more here than on 5 V: an ESP32 pin should stay well below its 40 mA absolute maximum, and without R1 nothing would limit the current. Change delay() to blink faster or slower; change R1 to make it brighter or dimmer.

Values from the Protoboard ISO simulation: a model, not a bench measurement.