A Simple Timer
Let's create a very simple timer – an LED that stays ON for some time before turning OFF for good.
The concept behind this is as follows: by connecting a capacitor to the base of a transistor, as long as it is charging the base will receive enough current to allow the current to flow between the emitter and collector and ultimately light up an LED.
However, when the capacitor is fully charged, it will stop letting current flow to the base of the transistor. When the transistor stops receiving current at its base, it will automatically stop allowing the current to flow between its emitter and collector and will stop lighting the LED.
Still confused? Let's see how it works step-by-step.
Note: If you are using the alternative part which is KSP2222ABU, the Emitter and Collector pins are swapped, that is with the transistor flat part facing, the leftmost pin is Emitter, middle pin is Base and rightmost pin is Collector.