LED resistor
- series resistorΩ
- supply voltageV
- LED forward voltage; red about 2 V, green 2.1 V, blue and white about 3 VV
- LED currentA
Applies: One LED or a series string; subtract every LED's .
Design rules
The sizing equations and rules of thumb for each building block, with their limits.
Applies: One LED or a series string; subtract every LED's .
E12 resistors are 100, 120, 150, 180, 220, 270, 330, 390, 470, 560, 680 and 820 Ω, and the same digits at 10× and 1/10×. For a current maximum, round R up and check it 5 % low (). For a current minimum, round R down and check it 5 % high.
Applies: Keep it under half the rating. 0603 is 1/10 W, 0805 1/8 W, 1206 1/4 W, on a board at 70 °C or cooler.
Parallel LEDs each need their own resistor; with a shared one, the lowest- LED takes most of the current. A series string can share one if the supply is well above the sum of the values.
A 3.3 V output acts like 3.3 V in series with about 25 Ω (25–40 Ω on real parts). Count it in the loop and keep each pin under about 20 mA. The load sets the current, not the pin.
Absolute maximum is the damage line; never design to it. Design inside the recommended operating conditions. A typical 3.3 V MCU runs VDD 3.0–3.6 V (absolute max 4.0 V), 20 mA per pin (absolute max 25 mA) and 80 mA for all pins (absolute max 120 mA).
Only min and max are guaranteed. For an LED current maximum use the min ; for a current minimum use the max ; for supply budgets use the max IDD. Label typical-based numbers as estimates.
"VOH ≥ VDD − 0.4 V at IOH = 8 mA" says nothing about 15 mA; read the graph. A worst-case pin at 85 °C acts like 3.3 V behind about 50 Ω. Footnotes are conditions too.
Applies: Resistors that keep full power to 70 °C and reach zero at 155 °C. Half the rating is left near 112 °C.
Pinouts belong to the part number, not the package. In a top view, pins count counter-clockwise from the pin 1 mark; bottom views are mirrored.
VDD operating range, VIN absolute max (VDD + 0.3 V on standard pins, more on FT pins), VIH and VIL, IDD max, and the application circuit.
Careful: A 5 V CMOS input needs VIH = 3.5 V, more than a 3.3 V output gives; 74HCT needs only 2.0 V.
A CMOS input is about 10 pF with under 1 µA of leakage. With no path to a rail it floats, picks up mains hum and draws extra current in sleep. This unit's MCU reads 0 at or below 0.99 V and 1 at or above 2.31 V; internal pull-ups are 30–50 kΩ.
Applies: Keep V at or above 2.31 V, so 1 µA allows up to 990 kΩ. Pressed, it wastes ; 4.7–100 kΩ covers most buttons and 10 kΩ is a common default.
Applies: 40 kΩ with a 3 m cable (1 nF) gives 40 µs. With a long cable, fast edge or noisy neighbor, add 4.7–10 kΩ outside.
Applies: Longer than the bounce, under about 20 ms. 10 kΩ and 1 µF reach 2.0 V in 9.3 ms. Follow it with a Schmitt input (up at 2.0 V, down at 1.2 V).
Applies: Between the connector and the pin. Keep it well under the pull-up; a TVS takes the kilovolts.
Careful: The built-in clamps are for handling (about 1.3 A), not an 8 kV zap (about 30 A).
Applies: Fast current edges. A 10 cm wire at 10 mA/ns drops 1.0 V.
Applies: The cap sits at the pin. 0.4 nC from 100 nF is 4 mV.
Careful: The same cap at the far end of a wire does nothing for spikes.
The spike loop runs cap → VDD pin → core → ground → cap, about 1 nH per mm including the ground leg. Put the cap next to the pin with a via in its ground pad. At 10 mA/ns a 2 mm loop costs about 27 mV and a 30 mm loop about 0.23 V.
Applies: Above it a cap acts as its ESL. Use 100 nF in a small package at each pin and 10 µF bulk nearby.
X5R and X7R ceramics lose capacitance with DC voltage. This unit's 10 µF 6.3 V X5R 0603 holds 7.5 µF at 2 V, 5.5 µF at 3.3 V and 4 µF at 5 V. Datasheet minimums mean effective capacitance at the working voltage. C0G doesn't derate but stops near 0.1 µF.
Plugging into ceramic-only input caps is a step into an LC, overshooting toward twice the step. Damp it with a bulk electrolytic whose ESR is near , or rate the input parts for twice the step.
Applies: 1 oz copper; 2 oz halves it. A 100 mm × 0.5 mm trace is 0.1 Ω. Copper gains about 0.4 % per °C.
A heavy load's return current lifts every ground it shares copper with, by plus on fast edges. Give each heavy load its own return and join them only at the supply connector.
At DC it splits by resistance; on fast edges it runs in the copper right under the trace. A slot under a fast trace forces a detour of about 1 nH per mm. Slow signals can cross a slot.
Applies: 0.5–3 oz copper, up to 35 A, rises of 10–100 °C. A first estimate; it ignores nearby planes.
| Current | Width |
|---|---|
| 1 A | 0.30 mm |
| 2 A | 0.78 mm |
| 3 A | 1.37 mm |
Applies: Fully on. From 3.3 V, read the 2.5 V line; the AO3400 is 48 mΩ there.
Careful: The 2N7000 and IRF540N stay partly on at 3.3 V and overheat.
Put 100–470 Ω in series with the gate; its peak is . Add 10–100 kΩ from gate to source so the load stays off while the pin is undriven.
Applies: With no clamp it goes into the MOSFET in avalanche. Put a diode across the coil, stripe to +; drain peak ≈ supply + diode + clamp, and a higher clamp releases faster.
Applies: At rest, with no back-EMF. Size the switch, fuse and wiring for it, and give the motor its own wires.
An N-MOSFET on top with a 3.3 V gate leaves its load about 2 V. Use a P-MOSFET, source on the rail, with a small NPN or N-MOSFET pulling the gate down and 10 kΩ holding it off. Keep |Vgs| inside its rating.
Turn-off lags while the gate discharges (about 150 ns for an IRLZ44N with 100 Ω). Leave dead time longer than the delay, or put a diode across each gate resistor, anode at the gate.
A series diode costs ; at 1 A a 1N4007 drops 0.93 V and an SS34 0.42 V. A P-MOSFET with drain to the connector, source to the load and gate to ground costs about 10 mΩ. Add a 12 V gate zener on 24 V or surge-prone inputs.
Hold current is the most it promises to carry; trip current the least that's promised to trip it; between them nothing is promised. The label is the hold current, and it falls as the board warms.
Careful: A PTC is far too slow for a 1 ms surge.
Applies: The TVS at the connector, on a short pad with a via. Contact ESD peaks at 3.75 A per kV.
A pin's clamp diode feeds VDD whenever the pin is more than about 0.6 V above it. A series resistor limits it; keep well under the bit time. Buffers with Ioff block it.
Applies: An empty capacitor. A soft-start P-MOSFET with a gate capacitor limits it; the cap fills at .
Applies: Both must be ≥ 0, and the driver's supply under the input's absolute max.
Input max is 3.6 V for a standard MCU pin (5.5 V on FT pins) and 5.5 V for 74HC and 74HCT.
| Family | High, VOH / VIH | Low, VOL / VIL |
|---|---|---|
| 3.3 V MCU | 2.9 V / 2.31 V | 0.4 V / 0.99 V |
| 74HC at 5 V | 4.4 V / 3.5 V | 0.1 V / 1.5 V |
| 74HCT at 5 V | 4.4 V / 2.0 V | 0.1 V / 0.8 V |
Applies: One way, 5 V down to 3.3 V; 10–90 % takes 2.2τ. Fine for a UART, not for MHz clocks unless the resistors are small.
Gate to the low supply, source to the low side, drain to the high side, a pull-up on each side. The MOSFET passes lows only; each high comes from its own pull-up.
Applies: Rise limits are 1000 ns (standard), 300 ns (fast) and 120 ns (Fm+). At 3.3 V, 200 pF and fast mode the window is 967 Ω to 1.77 kΩ.
Careful: At 400 pF the window closes; cut capacitance, slow down or use Fm+ parts.
Applies: A high-resistance divider into an ADC. Leakage moves the pin by , so keep the divider current about 100× it.
Peak is every load that can be on at once; it sizes the regulator (rated at least 1.25× the peak) and the battery. Average is each load times its on fraction; it sets battery life.
Applies: Check dropout at the lowest input, heat at the highest input and hottest box, and Iq if it sleeps. Limit about 125 °C.
Applies: Light-load mode (PFM) cuts the fixed loss at mA loads, at the cost of ripple; force PWM on noise-sensitive boards.
Input cap → VIN → switch → diode or low-side switch → ground carries the jumping current; budget 1 nH per mm. Put the input cap and diode against the IC, with at least 10 µF in and 22 µF out.
Asleep, every path from battery to ground counts. Switch or enlarge dividers, pull lines the way they rest, drive LEDs from a pin, and pick a µA-Iq regulator.
Use T-junctions, never 4-way points. Net labels join by exact text, so 3V3 and +3V3 are different nets. Supplies at the top, grounds pointing down, signals left to right.
| Pass | Question |
|---|---|
| Power in | Polarity protected? What does it cost? |
| Rails | Regulator sized for the peak? A small cap at every VDD pin? |
| Reset state | What does each load do while its pin is an input? |
| Pull-ups | Inside the rise-time and sink-current window? |
| Loads | LED resistors, flyback diodes the right way round? |
| Ratings | Derated for the worst case? |
Capacitor rating at least 1.5× the working voltage (2× for tantalum); resistor power at most 50 % of rating; current at most 70–80 %. Design to the operating range, never to absolute max.
Inspect; measure ohms from each rail to GND unpowered; power from a bench supply with the current limit a little above the expected draw; check each rail; blink; then one peripheral at a time.
Careful: Current pinned at the limit with volts near zero is a short.
Unfried · getunfried.com/formulas/design