LOGBOOK

HELP

Quiz Entry - updated: 2026.09.25

How is the LED wired to the ESP32 dev board in the blink demo, and why is the resistor there?

The LED's anode (long leg) goes to GPIO pin IO5; its cathode (short leg) goes through a 330 Ω resistor to GND. The resistor limits the current the pin has to supply.

LED Resistor ESP32
Anode (long leg) — IO5
Cathode (short leg) 330 Ω GND

When the program sets IO5 high, the pin drives 3.3 V through the LED and resistor to ground, and the LED lights. Set low, both ends are at 0 V and it goes dark. The resistor can sit on either side of the LED; in a series loop the current is the same everywhere. With a red LED it limits the current to about (3.3 V − 2 V) ÷ 330 Ω ≈ 4 mA, well within what an ESP32 GPIO can safely supply.

The pinout diagram matters because the dev board's pin labels (IO5, GND, 3V3, EN…) are the only mapping between the chip's GPIO numbers and the physical header. Some ESP32 pins are strapping pins that affect boot, or are input-only, so picking a pin is not arbitrary; IO5 is a safe general-purpose choice.

Go deeper:

  • doc ESP-IDF — GPIO driver — the gpio_set_direction / gpio_set_level API used in the demo, and which ESP32 pins have restrictions.

From Quiz: SIOT / Real-Time Operating Systems and Task Scheduling | Updated: Sep 25, 2026