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 between each pin and its lamp, so the pin drives a tiny CMOS input and the light is paid for by the 5 V rail.
Where the LED is wired
The shield page says there is a lamp beside every signal pin. This is the circuit behind that.
The LED is not on your pin. Each pin goes to the input of one inverter in an SN74HC04, a chip with six inverters in it, and the LED hangs off that inverter's output. Five chips of six is thirty inverters, and 22 of them are used.
Where the current comes from
The LED's top end goes through a 5.1 kohm resistor to the +5V 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 lamp.
The pin only has to drive the inverter's input. TI's datasheet puts that at no more than 1 uA of leakage and 10 pF of capacitance. So the pin sees almost nothing, and the current that lights the lamp comes out of the rail, not out of your signal.
Why HIGH is always HIGH enough
A chip decides HIGH by comparing its input with a fixed level. The inverters here run from the 5 V rail, and TI's datasheet asks for at least 3.15 V on the input to call it HIGH. An ATmega328P output that is HIGH is about 4.1 V even while it supplies 20 mA, which is far more than this input takes. The margin is about a volt in the right direction, so every driven pin lights its lamp.
The S3 PinPulse shield runs its inverters from 3.3 V instead. This one runs from 5 V, and that is the Nano's own logic level, so the two line up.
What it costs
Each lamp takes about 0.59 mA, from the 5 V rail through 5.1 kohm. That is illustrative: it assumes the red LED drops 2 V, and the real figure depends on the LED. With all 22 lit it is about 13 mA, and every milliamp of it comes from the Nano's 5 V rail, which is fed from USB-C or VIN, and none from a pin. The 40 mA that the datasheet allows per pin is not touched by any of this.
The two pins that only listen
A6 and A7 are analogue inputs on the ATmega328P and nothing else. There is no
digitalWrite(A6, HIGH), and the shield marks them IN for that reason. Their
lamps still work, but they report a voltage somebody else applies: lit when it
is above the inverter's threshold, dark when it is below. That is a yes or no,
not a reading. analogRead(A6) is the reading.
What it means in practice
- A pin set as an input shows what the outside world is doing to it. Wire a
button from D2 to ground, set the pin to
INPUT_PULLUP, and its lamp goes dark while the button is pressed. - A lamp shows a level, not a speed. A PWM pin at half duty looks like a steady half-bright lamp, because the light changes faster than an eye can follow.
When it does not work
Check the row, not the column: the lamp beside a name belongs to that name. If it 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.
Each one runs at about half a milliamp through its 5.1 kohm resistor. That is enough to read indoors and little enough that all of them together are small next to the rest of the board. They are indicators, not lighting, and a bright room washes them out.
A6 and A7 are analogue inputs only on the ATmega328P. The sketch cannot drive them, so nothing in the sketch lights their lamps. Wire the pin to 5V or GND with a jumper and the lamp follows it. analogRead is still the way to measure it.
It adds one CMOS input to the line: 10 pF and 1 uA at most, from TI's datasheet. That is less than a short jumper wire adds, and it is small next to what the ATmega328P's pin can drive.
Edit this page — content/books/nano/how-a-pin-lights-its-led.mdx
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.