Source: https://mokxi.com/learn/led-iv-curve-simulator
Updated: 2026-10-05

Learn

# An LED’s I-V curve, simulated

Intermediate

Written by the Mokxi team, updated October 5, 2026

Start building free Open the editor

Or see every lesson.

- 261 parts on the bench
- 31 boards running now
- 1.00x real time, on every board

Click to open it in the editor

A 2.0 V supply across a red LED and a 10 ohm sense resistor. Press Run and the meter reads about 0.2 V: 20 mA through the LED.

An LED is not a lamp with a fixed "2 V drop". It is a diode, and a diode’s current climbs exponentially with the voltage across it. Below its knee it passes almost nothing; just past it, a little more voltage passes a lot more current. That curve is why an LED always gets a series resistor, and seeing it drawn once explains a whole class of burned-out LEDs.

The circuit above is a supply set to 2.0 V across a red LED and a 10 ohm sense resistor, with a multimeter across the sense resistor. The voltage on 10 ohm is the current times ten, so 0.1 V on the meter is 10 mA through the LED. At 2.0 V the meter reads about 0.2 V, which is 20 mA, the most a small indicator LED is meant to carry.

Now draw the whole curve. Open Analysis in the editor’s more menu and use the DC sweep: step the supply’s voltage from 1.0 V to 2.2 V in 0.02 V steps and watch the net between the LED and the sense resistor. Each point is solved fresh, and the plot traces the current against the supply. Download CSV and you get the LED’s own current at every point too.

Read the plot in two parts. Up to about 1.5 V the current is tiny but exponential: every 0.1 V more multiplies it, which on a linear axis looks like nothing and then a sudden bend. Past the knee the junction is wide open, and what limits the current is plain resistance, the LED’s own 12 ohm of bulk resistance plus the 10 ohm sense resistor, so the curve straightens into a line of about 45 mA per volt. That is the real shape: a Shockley junction with series resistance, the same model a datasheet curve is fitted to.

Then try it by hand. Click the supply and set 2.5 V. Half a volt more than the 2.0 V that gave 20 mA now pushes over 30 mA. With no resistor in the way, a few hundred millivolts decide between a glow and a dead LED, which is why the resistor is not optional.

Swap the LED’s color in the properties panel and sweep again. A blue LED’s knee sits far higher than a red one’s, because its forward voltage is higher.

## Questions

How is the LED modeled?

As a Shockley diode with 12 ohm of bulk resistance, solved for the current it actually passes, so its forward voltage depends on the current and on its color rather than being a fixed number.

Can I export the I-V data?

Yes. The DC sweep has a Download CSV button with every net’s voltage and every analog part’s current at each point, at full precision.

Related

## Keep going

Picking a Resistor for an LED NPN Transistor Switch Simulator Voltage Divider Simulator With a Real Meter How an LED behaves in the simulator Every analog circuit Sweeps and frequency response, in the docs Mokxi and Wokwi, compared The project page, with the full sketch Intermediate

## Build this for real

Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.

Start building free Open the editor
