Where the current goes
HIGH puts a voltage on the LED's anode and current flows from your pin, through the LED and the resistor, and back to your board's GND. LOW puts nothing there, so nothing flows. That is all ACTIVE HIGH means.
One loop
There is exactly one path on this board. SIGNAL goes to the LED's anode, the long leg. The cathode, the short leg, goes to the resistor. The resistor goes to GND. Your board closes the loop: its pin at one end, its GND at the other.
Current needs the whole loop. Break it anywhere, whether that is a missing GND wire, a loose jumper or SIGNAL on the wrong pin, and nothing flows anywhere in it. That is why the first check for a dark LED is always the ground.
HIGH
digitalWrite(pin, HIGH) connects the pin to the chip's supply, 5 V on an Uno.
The LED takes about 3.0 V of that, which is what it costs to make blue light.
The resistor takes the remaining 2.0 V, and 2.0 V across 150 Ω is about 13 mA.
That 13 mA comes out of your microcontroller's pin. The pin is sourcing current: pushing it out into the circuit. Every milliamp the LED uses, the pin supplies.
LOW
digitalWrite(pin, LOW) connects the pin to ground instead. Now both ends of
the loop are at 0 V and there is no voltage to push current anywhere. The LED
is off because nothing is flowing through it.
Why the board says ACTIVE HIGH
Active high is the name for "HIGH turns it on". The silkscreen prints it on the front, and GLOWS WHEN HIGH on the back, because not every board works this way.
Many dev boards wire their built-in LED the other way round: from the supply, through the LED, into the pin. On those, the pin has to go LOW to pull current through, and they light on LOW. That is active low, and it is why a sketch written for one board's built-in LED can look inverted on another.
This block cannot be active low. The resistor's far end is soldered to GND, so a voltage on SIGNAL is the only thing that can light it.
When it does not work
Not on this board. The resistor's far end is soldered to GND, so the only way to push current through the LED is to put a voltage on SIGNAL. Boards that light on LOW have their LED wired to the supply instead, and they print ACTIVE LOW.
Yes. About 13 mA from a 5 V pin, or about 2 mA from 3.3 V, is well inside what the pin, the LED and the resistor can carry continuously. The resistor dissipates about 27 mW at 5 V, a fifth of what an 0805 part is rated for.
Indirectly. The current comes out of the GPIO pin, and the GPIO pin's driver takes it from the chip's own supply. That is why the pin's limit matters and the board's supply pin does not: nothing on this block is wired to VCC.
The same sketch, a third less voltage, and much less than two-thirds of the light.
Why it is dimmer on 3.3 V →Edit this page — content/books/xl-led/where-the-current-goes.mdx
Questions about this product
See what other owners have asked, and read their solutions.
XL LED
Loading 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.