Regulate 12 V down to 5 V: a schematic puzzle
A three-pin regulator and two small capacitors give a steady 5 V from a rough 12 V.
The LM7805 is a valve with a thermostat: it opens just enough to hold its output at 5.0 V, no matter whether the input is 8 V or 20 V, and it does so by burning the difference as heat. At 100 mA that is 7 V × 0.1 A = 0.7 W, warm but fine without a heatsink. The 330 nF on the input keeps the regulator from oscillating when the source is more than a few centimetres of wire away; the 100 nF on the output makes it answer fast load changes. The LED draws (5 − 2) ÷ 470 ≈ 6 mA, just enough to be seen.
330 nF input capacitor: A small local reservoir right at the IN pin. The datasheet asks for it whenever the regulator sits far from the main supply capacitor; without it the long wire can make the regulator sing.
LM7805 regulator: The valve with the thermostat. It compares its output with an internal reference and adjusts a pass transistor continuously, holding 5 V within a few percent from no load up to 1 A if it can shed the heat.
100 nF output capacitor: Covers the first microsecond after a load change, before the regulator’s feedback loop has caught up. Small, cheap, and placed as close to the pin as possible.
470 Ω resistor: Sets the indicator current: (5 V − 2 V) ÷ 470 Ω ≈ 6 mA. Dimmer than the first puzzle on purpose; a power LED only needs to be seen.
Power LED: Shows the 5 V rail is alive. Anode toward the resistor, cathode to ground.