Display PWM

LED

An LED is a light-emitting diode: a directional semiconductor part that turns electrical energy into visible light.

Part images

LED. A simple output part used in the first Pico circuits. Image source: SunFounder Pico 2 W Starter Kit documentation, Components section, © 2026 SunFounder.
LED symbol. The diode symbol reminds you that LED direction matters. Image source: SunFounder Pico 2 W Starter Kit documentation, Components section, © 2026 SunFounder.

What it is

An LED is a light-emitting diode: a directional semiconductor part that turns electrical energy into visible light.

How students use it

Students use single LEDs for first outputs, status indicators, traffic lights, alarms, and debugging signals. A Pico pin can switch an LED on/off or use PWM to dim it.

Pins and power

Anode and cathode. SunFounder notes the longer leg is the anode and the shorter leg is the cathode.

Use a current-limiting resistor in series. SunFounder notes typical red/yellow/green forward voltage around 1.8V, white around 2.6V, and common LED current up to 20mA.

The LED conducts one way. Anode goes toward the positive side of the circuit, cathode toward the lower-voltage side or ground path.

Voltage and safety

Do not connect an LED directly across a supply or GPIO without current limiting.

Bright LEDs can be uncomfortable at close range. Keep current low and avoid staring into high-brightness LEDs.

Module internals

A current-limiting resistor is required in typical Pico LED circuits.

Datasheet notes

SunFounder does not identify one exact LED part number. For a real LED datasheet, match the color, package size, and manufacturer; key values are forward voltage, recommended current, viewing angle, and brightness.

Common libraries

Use machine.Pin for on/off control and machine.PWM for dimming or fading.

Common mistakes

Reversing polarity, forgetting the resistor, using too small a resistor, assuming every LED color has the same forward voltage, and trying to power too many LEDs from one GPIO pin.