Part

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

or see every part
  • 2 pins
  • 1 property
Drawn live by the editor's own code, at the size you see it.
Reference

Every one of its 2 pins

Pin
What it does
A
Anode. Current goes in here.
C
Cathode, the shorter leg on a real part. Current comes out here.
This part

What it does

An LED is a diode, not a resistor. Below about 1.5 volts a red one barely conducts; past that its current climbs exponentially with the voltage across it, so it takes whatever the rest of the loop can push through it while its own drop hardly moves. That is why an LED always needs a series resistor to set its current, never a bare wire to the supply: the resistor is what actually does the limiting. Mokxi models the Shockley equation itself rather than a fixed drop, so the anode net sits where the curve puts it (1.72 V for a red LED at 14.9 mA, and lower at lower currents) at whatever value the circuit’s resistor sets. What you see is not the instantaneous state either. The probe is a short-lived average of the LED’s brightness, with a time constant close to 8 milliseconds, the same range the eye’s own response takes, which is why a fast-blinking or PWM-dimmed LED here looks the way it would on a real bench rather than flickering once per switch.

Reference

The one property you can set

Property
Default
What it means
color
red (or green, blue, yellow, white)
red, green, blue, yellow or white. It changes the picture and the die: each color is specified by its drop at 20 mA, which is how a datasheet specifies one. Red 1.8 V, yellow 2.0 V, green 3.0 V, blue 3.0 V, white 3.1 V.
How it is modeled

What is true about the LED, here

What is modeled

The LED is a diode and the diode is the Shockley equation, I = Is (exp(Vj / (N Vt)) - 1), with N = 2 and 12 ohm of bulk resistance, and the color's drop at 20 mA is what sets Is. So the drop is not a number the part carries around: it is whatever the curve gives at the current the circuit is passing. A 5 V rail through 220 ohm lights a red LED at 14.9 mA with 1.72 V across it, and the same LED on 3.3 V through 220 ohm passes 7.7 mA at 1.60 V. The drop falls with the current, which is what a real LED does and what a fixed drop could never show.

Blue and white changed on September 17, 2026. They were 2.2 V while the model was a fixed drop and they are 3.0 V and 3.1 V now, because that is what a real blue die does, so a blue LED on 5 V through 220 ohm passes 9.8 mA where it used to pass 11.9 mA: about a fifth less light, and correct. On a 3.3 V rail the difference is much larger: 2.8 mA against the 7 mA the old model claimed, which is the real reason a blue LED looks dim on a 3.3 V board.

The LED loads the net it is on, the way a real diode does, and below about a nanoamp of forward current it lets go of both nets entirely: no leakage, no reverse current. The probe is not the instantaneous brightness either: it is an 8 ms rolling average of it, the same time constant your own retina uses, so a PWM-dimmed LED reads as dimmed rather than as a random flicker.

Not modeled

One curve per color, and no spread. Real LEDs of the same color vary by a couple of hundred millivolts from part to part; every red LED here is the same red LED. The bulk resistance is 12 ohm and the emission coefficient 2 for every color, which is the middle of the range indicator LEDs sit in rather than a measurement of any one part.

No junction capacitance and no temperature. The junction is at 27 C and stays there, where a real LED's drop moves about 2 mV a degree, and it switches in nothing flat. There is no reverse breakdown either: reverse biased it passes its saturation current, which is femtoamps, however much you put across it.

Full brightness is 20 mA and the probe stops there. Brightness is the forward current divided by 20 mA and clamped at 1, so 20 mA and 200 mA look identical on the canvas even though the probe reports the current honestly.

No maximum current and no burnout. Wire an LED straight across a 5 V rail with nothing in series and it lights at whatever current the diode drop allows, and the probe will tell you that current honestly. A real LED would not survive it. There is no smoke here on purpose: a mistake you can read off the probe teaches more than a part that silently vanishes.

LEDs, seven-segment dies and RGB LEDs (`led`)

modelwhat sets it
the same equation, with N = 2 and 12 ohm of bulkthe color's drop at 20 mA: red 1.8 V, yellow 2.0, green 3.0, blue 3.0, white 3.1

From LED, in full.

Projects

See the LED in a project

Shown here on: ESP32-C3-DevKitM-1, Arduino Uno R3, Raspberry Pi Pico, STM32F411 Black Pill, ATtiny85, Arduino Nano, Arduino Leonardo, ESP32 DevKit V1, ESP8266 NodeMCU V1.0, Raspberry Pi Pico W, STM32 Blue Pill (F103), Arduino Uno R4 Minima, BBC micro:bit V2, Arduino Pro Mini, Arduino Micro, SparkFun Pro Micro, Wemos D1 mini, ESP-01S, Seeed XIAO ESP32-C3, ESP32-C3 SuperMini

Learn

Where it turns up in a lesson

In the twelve week course

In a learn article

Wire up the LED

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.