Setup. LED Blink Sequence project, full-size (800) breadboard with an MB102 power module on the rails (variable adapter at 6.00 V). Three LEDs, each wired ESP32 GPIO → LED (long leg +) → 330 Ω → − rail, with a jumper from the ESP32's GND to that − rail.
| LED | Pin |
|---|---|
| 🔴 red | GPIO 14 |
| 🟢 green | GPIO 12 |
| 🔵 blue | GPIO 13 |
The led-blink-sequence sketch lights all three for a 1 s self-test, then chases red → green → blue at 0.4 s per step. It worked first time once uploaded over USB (/dev/cu.usbserial-0001, CP2102 chip).
What I discovered
1. I didn't need the power module. The LED current comes straight out of the ESP32's GPIO pins, which are powered from USB. A GPIO set HIGH is a little 3.3 V supply of its own. The module's + rails weren't part of the circuit at all.
2. The current has to return to the source that pushed it. The loop is:
GPIO pin (out) → LED → 330 Ω → − rail → jumper → ESP32 GND (back in)
The jumper from the ESP32's GND to the − rail is what closes the loop for all three LEDs at once, because every resistor ends on that rail. Without it nothing lights. Turning on ⚡ Current on the canvas shows the return path going into the ESP32's GND pin.
3. Shared − rail = common ground. Because the module's − rails are tied to the ESP32's GND through that jumper, both supplies share one 0 V reference. That's good practice whenever two supplies share a board. Rules to remember:
- never let the module's + rail (4.5–5 V) touch an ESP32 GPIO or its 3V3 pin
- don't feed the module's 5 V into the ESP32's VIN while USB is also plugged in
- the module becomes useful when parts need more current than a GPIO should give (about 12 mA per pin): power them from the rails and let the ESP32 switch them, through a transistor, for example
Numbers
- GPIO HIGH = 3.3 V (not 5 V)
- Red LED (Vf ≈ 2.0 V): (3.3 − 2.0) ÷ 330 ≈ 4 mA, clearly lit (calculated)
- Blue / bright green (Vf ≈ 3.0 V): (3.3 − 3.0) ÷ 330 ≈ 1 mA, so expect them dimmer (calculated). A 100 Ω resistor would give about 3 mA.
- The module's rails sat at 4.50 V with the adapter at 6.00 V. That's its 5 V regulator in dropout: it needs about 6.5 V or more on the barrel jack. It didn't matter here, because the rails weren't powering anything.
Also learned along the way
- On the canvas LED, the bent leg is the anode (+) (the longer leg on a real LED); the straight leg is the cathode (−).
- Resistor legs bend: a 2-hole resistor reaches from a rail into row a.
Comments (0)