# LED String (`ledString`)

> A string of LEDs in series, with strings in parallel, as the load of an LED driver.

![ledString](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/ledString.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/switches/ledString/)

**Group:** Switches · **Kind:** `{"kind":"ledString"}`

## When to use it

Use it as the load of a constant-current buck, boost or flyback LED driver, to see the LED current, its ripple and the string voltage. For a single indicator LED a Diode with vf is enough.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `a` | electrical | Anode of the string; current flows from a to k |
| `k` | electrical | Cathode of the string |

## Common parameters

- `ns`: LEDs in series in each string (Default: 1)
- `np`: Strings in parallel (Default: 1)
- `vth`: Threshold of one LED; its fit's forward voltage at zero current (Default: required)
- `rd`: Dynamic resistance of one LED; the slope of its fit (Default: required)
- `tcVf`: Temperature coefficient of one LED's forward voltage (Default: 0)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `ns` | — | 1 |  | LEDs in series in each string |
| `np` | — | 1 |  | Strings in parallel |
| `vth` | V | required |  | Threshold of one LED; its fit's forward voltage at zero current |
| `rd` | Ω | required |  | Dynamic resistance of one LED; the slope of its fit |
| `tcVf` | V/K | 0 |  | Temperature coefficient of one LED's forward voltage |
| `tj` | °C | 25 |  | LED junction temperature |
| `tref` | °C | 25 |  | Junction temperature the fit belongs to |
| `imax` | A | optional (off) |  | Largest current of one LED; a peak above it raises a warning |
| `thermal` | — | optional (off) |  | Thermal net of its junction; takes its heat and sets its temperature in place of tj |
| `wpe` | — | 0 |  | Light out per power in (wall-plug efficiency); this share does not heat the junction |

_Parameter descriptions are in English in both languages._

**Use for:** LED driver loads · Backlights · Luminaires

**Not for:** Single indicator LEDs → [`diode`](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/switches/diode/)

## Formulas

| Formula | Equation | Source |
|---|---|---|
| String voltage | V = ns·(vth + rd·I) | Sedra & Smith, Microelectronic Circuits, 7th ed. (2015), §4.3 (diode forward characteristic models) and §4.7 (light-emitting diodes) |
| Series resistor | R = (Vs − V)/I | Sedra & Smith, Microelectronic Circuits, 7th ed. (2015), §4.7 (light-emitting diodes) |
| Resistor dissipation | P = (Vs − V)·I | Sedra & Smith, Microelectronic Circuits, 7th ed. (2015), §4.7 |

## Quick check

Inputs:

- `ns`: LEDs in series = 10 —, `ns`
- `vth`: Threshold of one LED = 2.7 V, `vth`
- `rd`: Dynamic resistance of one LED = 600m Ω, `rd`
- `iled`: Current of one string = 100m A
- `vs`: Supply voltage = 36 V

Outputs:

- `vstring`: String voltage = `ns*(vth + rd*iled)` V
- `rser`: Series resistor = `(vs - vstring)/iled` Ω
- `pres`: Resistor dissipation = `(vs - vstring)*iled` W

## Model logic

- The array is one piecewise-linear diode: it turns on above ns·vth (shifted by ns·tcVf·(tj - tref)) and then has slope resistance ns·rd/np.
- Below the threshold it blocks through a fixed 100 Mohm, and the knee at very low current is not modelled.
- vth and rd have no defaults and must be set; tcVf defaults to 0, so the voltage does not change with tj.
- With thermal set, the power less the wpe share heats that net and its temperature replaces tj; a current above imax per LED raises a warning.

## Model

Each LED is a straight line through its forward curve: vf = vth + rd·i + tcVf·(tj − tref). The array is ns of them in series and np strings in parallel, so it conducts above ns·vth with a slope of ns·rd/np, and blocks below that. It simulates as a piecewise-linear diode. The knee at very low current is not modelled. With thermal naming a thermal net, the string's power less its light (wpe) heats that net, and the threshold follows the net's temperature in place of tj; without it tj is a fixed value. A warning appears when the current of one LED goes above imax.

## Common mistakes

- An LED string straight across a voltage source has nothing to set its current. Drive it from a current-controlled converter or put a resistor in series.
- The fit holds over the current range its two points came from. Deep analog dimming far below that range needs points read at the low current.

## Datasheet and sources

Read two points of the typical forward voltage versus forward current curve in the working range, for example at half and at full rated current. rd is the voltage difference over the current difference, and vth is the first voltage minus rd times the first current. tcVf comes from the relative forward voltage versus junction temperature curve (negative). tref is the temperature of the forward curve, usually 25 °C or 85 °C. imax is the maximum DC forward current. wpe is the radiant flux over the electrical power at the working point (the wall-plug efficiency); leave it at 0 to count all power as heat, the safe side. There are no defaults: enter the values of your LED.

## Example

Open the example with the command `file.openExample` and the name `demo:ledString`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
