ESP32-S3 bases/The PinPulse shield/17. How a pin lights its LED
The PinPulse shield · 17 of 22

How a pin lights its LED

An LED needs current, and current drawn from a signal pin changes the signal. The shield puts an inverter chip between each pin and its LED, so the pin drives a tiny CMOS input and the light is paid for by the 3.3 volt rail.

Where the LED is wired

The page before this one says the lights cannot disturb a bus. This is the circuit that makes it true.

The LED is not on your pin. Each GPIO goes to the input of one channel of an SN74HC04, a chip with six inverters in it, and the LED hangs off that channel's output. Six chips, six channels each: thirty-six LEDs.

Where the current comes from

What lights the LED, and what it costs the pin
pin LOW
What the sketch does with GPIO 13
From the GPIO
≤ 1 µA
Through the LED
0 mA
All 36 lit
10 mA
LOW leaves it dark. The inverter’s output is HIGH, both ends of the LED sit at 3.3 V, and no current flows. Your signal is loaded exactly as much as it was a moment ago.

The LED's top end goes through a 5.1 kΩ resistor to the 3.3 volt rail. Its bottom end goes to the inverter's output. Current flows when that output is LOW — and an inverter's output is LOW when its input is HIGH. That is why a HIGH pin lights its LED.

The pin itself only has to drive the inverter's input. TI's datasheet puts that at no more than 1 µA of leakage and 10 pF of capacitance: less than a short jumper wire adds. So the pin sees almost nothing, and the quarter of a milliamp that lights the LED comes out of the rail, not out of your signal.

Why HIGH is always HIGH enough

A chip decides HIGH by comparing its input against its own supply. The inverters here run from the same 3.3 volt rail as the ESP32-S3, and the S3 guarantees its HIGH is at least 80 % of that rail. The HC04 needs about 70 % at this supply. Same rail, and a margin in the right direction, so every lit pin lights its LED.

That is a difference from the classic ESP32 PinPulse base, which runs its inverters from 5 V and sits much closer to the edge.

What it means in practice

  • A pin set as an input shows what the outside world is doing to it. Wire a button from GPIO 4 to ground, set the pin to INPUT_PULLUP, and its LED goes out while the button is pressed.
  • An LED shows a level, not a speed. A 1 kHz PWM signal looks like a steady half-bright LED, because the light is changing faster than an eye can follow.

When it does not work

An LED is lit while my sketch has the pin LOW

Check the row, not the column: the LED beside a number belongs to that number. If it really is the right row, the pin is not LOW — something else is driving it, or pinMode was never called for it and it is floating. Print digitalRead of the pin to see what the chip thinks.

The LEDs are dimmer than I expected

Each one runs at about a quarter of a milliamp through its 5.1 kΩ resistor. That is enough to read indoors and little enough that all 36 together draw around 10 mA. They are indicators, not lighting, and a bright room or direct sunlight washes them out.

Does the LED slow down a fast signal like SPI or I²C?

It adds one CMOS input to the line: 10 pF and 1 µA at most, from TI's datasheet. The previous page puts that against the I²C rise-time budget and the push-pull SPI drive, and it is a small slice of both.

Can I use the LED column as outputs, to light something else?

No. The LEDs are driven by the inverter chips, not wired to anything you can reach, and the chips are driven by the GPIOs. To light something, wire it to the GPIO's pin or socket like any other load.

Where this goes next

Why an unclaimed pin flickers when you wave a hand near it.

The floating pin →

Edit this page — content/books/esp32s3-base/how-a-pin-lights-its-led.mdx

Questions people ask first

  • Which way round does the ESP32-S3 go on the base?

    Its USB sockets go over the two boxes printed USB, at the bottom of the base, with the antenna end at the top under the display connector.

    Nothing stops the other way: the two sockets are identical, so the board seats just as firmly end for end. Put in backwards, its 3.3 V regulator output ends up wired to ground, and the board can be damaged for good. Seat the board first and plug the USB cable in second, every time.

  • Where does the power for my sensors come from?

    The base has no regulator, no battery connector and no power input. It is powered through the ESP32-S3's own USB sockets, and every power way on it is one of that board's pins carried out.

    The 3V3 ways are the output of the regulator on the ESP32-S3. The 5V ways are the board's 5V pin: about 4.6 V with a USB cable plugged in, and nothing without one. Nothing on the way is switched, fused or filtered.

  • Can I run a motor, relay or LED strip from the base?

    Not from its power ways. Motors, relays, servos and long LED strips need their own supply, with its ground joined to a GND way on the base, because the ESP32-S3's regulator is small and is also running your sketch.

    Small sensors and a display can take 3V3 and ground from the base. No current rating is quoted for the ways, because none has been checked.

  • How many GPIOs does the Pluggable Terminal Base bring out?

    24 of the ESP32-S3 Gold's 36 GPIOs, once each, on two 12-way push-in blocks, plus two 4-way power blocks.

    Twelve do not come out: 0, 1, 2, 3, 4, 35, 36, 37, 43, 44, 45 and 46, and the RST pin. GPIO 1, 2 and 4 reach the display connector and nothing else. All of the I²C and SPI pins are on the left block, and GPIO 19 and 20 (the native USB pair, on the right block) should be left alone while a sketch is using USB.

  • How many GPIOs does the Screw Terminal Base bring out?

    26 of the ESP32-S3's GPIOs, once each, on two 15-way screw terminal blocks, with 3V3 on the left block and 5V on the right. Ten GPIOs do not come out.

    The native USB pins (GPIO 19 and 20) are on the right block: a wire on either one shares the USB lines with the computer, so leave them alone unless the sketch is not using native USB.

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →