Building a Transistor Switch Circuit
Use a weak control signal to switch a stronger load on and off — the basic building block behind relay drivers, motor control, and more.
You'll need: an NPN transistor (a 2N2222 or similar general-purpose type), a base resistor (try 1kΩ), an LED with its own current-limiting resistor as the "load," a supply, and a low-voltage control signal (even a second small battery or a microcontroller pin later on).
A transistor used as a switch lets a small current into its base control a much larger current flowing between its collector and emitter. Wire your LED-and-resistor load between the supply and the collector, the emitter to ground, and your control signal through the base resistor into the base.
The base resistor isn't optional — the transistor's base-emitter junction behaves almost like a diode, with very little resistance of its own, so a base connected directly to a voltage source without a resistor will draw excessive current and can destroy the transistor. A 1kΩ base resistor is a safe starting point for small-signal switching like this.
With no control signal, the transistor stays off and the load stays dark. Apply even a small voltage to the base (through its resistor) and the transistor turns fully on, lighting the LED — the same principle scales up to switching motors, relays, and other loads far larger than a microcontroller pin could handle directly.