Built-in project · no microcontroller

LED I-V curve

A supply across a red LED and a 10 ohm sense resistor: sweep the supply and the LED’s real exponential current curve comes out, knee and all. There is no microcontroller in it: the simulator solves the 3 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.

Teaching? Assign it to your class in one click.

Intermediate About 15 minutes to build and run. Runs in your browser. Free, and no account needed.

The parts retail for about $5.15. On Mokxi they're free.

The circuit runs here once the page has loaded.

What you'll learn

  • An LED is a diode with a knee
  • Reading current as voltage across a sense resistor
  • A DC sweep from 1.0 V to 2.2 V
  • Why every LED needs a series resistor
  • Difficulty: Intermediate
  • Time: About 15 minutes
  • Parts: 4

How it works

A 2 V supply sits straight across a red LED and a 10 ohm sense resistor. There is no real current-limiting resistor, because the point is to see how the LED decides its own current.

Below the knee of the curve, an LED passes almost nothing. There, every extra 0.1 V multiplies the current. Past the knee the junction is wide open, and only resistance limits the current: the LED's own 12 ohms plus the 10 ohm resistor.

The meter reads the voltage across the 10 ohm resistor, so every 0.1 V is 10 mA through the LED. At the starting 2 V, about 20 mA flows and the meter reads about 0.2 V.

Parts list

4 parts, plus the jumper wires and a bench instrument. The parts retail for about $5.15; on Mokxi they're free, and so are the instruments.

Kits that can build it

This starter kit has every part in the circuit. Each kit's page lists what else it can build.

Wiring table

Every connection, pin by pin, read from the circuit itself. Each row joins the pin on the left to the pin on the right, by a jumper wire or a breadboard strip.

Part and pinConnects to
LED, red pin A2 V
Resistor, 10 Ω pin 2Ground
Multimeter pin COMGround
Resistor, 10 Ω pin 1LED, red pin C
Multimeter pin VLED, red pin C

The notes that come with it

There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.

sketch.ino
// An LED's I-V curve.
//
// A bench supply set to 2.0 V straight across a red LED and a 10 ohm sense
// resistor. No current-limiting resistor worth the name: the point is to
// see how the LED itself decides its current.
//
// An LED is a diode, and the engine models it as one: a Shockley junction
// with 12 ohm of bulk resistance (docs/help/parts/led.md). So its current is
// not a fixed "2 V drop". Well below the knee it passes almost nothing, and
// there every 0.1 V more multiplies the current. Past the knee the junction
// is wide open and what limits the current is resistance: the LED's own
// 12 ohm plus the 10 ohm sense resistor, so the curve straightens into a
// line of about 45 mA a volt.
//
// Draw the curve:
//
//   1. Analysis... in the more menu.
//   2. DC sweep: step vcc1's voltage from 1.0 V to 2.2 V in 0.02 V steps.
//   3. Watch the net between the LED and the sense resistor.
//
// The plot is the voltage across 10 ohm, so every 0.1 V on it is 10 mA
// through the LED. Download CSV for the LED's own current at every point.
// The x axis is the supply, which is the LED's voltage plus the little the
// sense resistor drops (0.2 V at 20 mA).
//
// At the 2.0 V the supply starts at, about 20 mA flows, which is the most a
// small LED is meant to carry, and the meter reads about 0.2 V. Click vcc1
// and try 2.5 V by hand: well over 30 mA, from half a volt more. That is
// why an LED always gets a series resistor.

Troubleshooting

The usual mistakes with this circuit, and the fix for each.

  • The LED seems fine at 2.5 V, so why add a resistor? This project
    Try it by hand. A little more voltage gives far more current, well over 30 mA from half a volt more. That is too much for a small LED.
  • The sweep plot shows voltage, not current. This project
    That is expected. The plot is the voltage across the 10 ohm resistor, so divide by 10 ohms to get amps.
  • The LED does not light, or it lights once and then dies. LED
    LEDs have polarity. The longer leg (anode) goes toward the positive side. Always add a series resistor, about 220 ohms to 1 k ohm on a 5 V pin.
  • A blue or white LED stays dark on 3.3 V. LED
    Blue and white LEDs drop about 3 V, so 3.3 V leaves almost nothing for the resistor. Use a 5 V supply, or a smaller resistor and a red or green LED.
  • The LED is dim, burns out, or the pin reads wrong because the resistor value is off. Resistor
    Read the color bands again. A 220 ohm to 330 ohm resistor suits a typical LED on 5 V. 10k is a common pull-up or pull-down value. Check with a multimeter if unsure.
  • A pull-up or pull-down resistor is missing, so the input floats and reads random values. Resistor
    Tie the input to 5 V or ground through about 10k. Or use INPUT_PULLUP and wire the switch to ground.
  • The reading is zero, negative or nonsense when measuring voltage. Multimeter
    Set the dial to volts first, then touch the probes across the part, in parallel. Red goes to the more positive point. A negative number just means the probes are swapped.
  • Measuring current gives zero or blows the meter's fuse. Multimeter
    Current must flow through the meter, so break the circuit and put the meter in series. Never put an amps setting straight across a supply. Start with the highest current range.

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.