Why supply wires ring
Every wire is a little bit of inductor: about a microhenry for a lead a metre long. Usually that's nothing. But the circuit at the far end often has a ceramic capacitor across its supply, for decoupling, and a coil and a capacitor make a ringing circuit, with only the wire's tiny resistance to damp it.
Here the battery reaches the board down a long lead (the coiled red one), to a 10 µF ceramic and an LED with its resistor. The probe is at the board's end, at 2 V per square.
Press Run: that's the moment the battery is connected. It's in slow motion, ten thousand times slower than real time, so watch the scope.
Where does the extra 5 V come from, with only a 9 V battery?
- The lead's inductance keeps the current flowing into the capacitor after it reaches 9 V, overcharging it
- The capacitor makes voltage of its own
- The LED pushes back
Damp it
ζ = (R/2)√(C/L): the lead's resistance is fixed, but more capacitance raises ζ. Add a 470 µF electrolytic right beside the ceramic: + leg in column 20, − leg to the − rail. Then press Run again.
Supply wires ring:
- a lead's inductance and a decoupling capacitor form a series LC with very little resistance;
- a sudden connection, or a sudden change in load, makes it ring and overshoot, up to nearly twice the supply at the moment of connection;
- an electrolytic beside the ceramic damps it: its extra capacitance brings √(L/C) down to the wiring's resistance (and a real electrolytic's own resistance helps more).
On a real bench plugging a board with only ceramic capacitors into a live bench supply on long leads can spike its input to nearly twice the supply voltage: enough to kill a 12 V chip on a 9 V supply. That's why boards put an electrolytic where the power comes in, and why that warning is in so many regulator datasheets.