This will describe a simple circuit for allowing a 9 v. battery to power an LED, and then fade out once the pushbutton is released. Something very similar was requested in a question on the forums somewhere. I hope this is useful as a prototype, or in inspiring ideas on how to use this set up.
Step 1: Parts
Here is an inventory of the parts I used:
Q1: most any SS (small signal) NPN transistor will do here.
C1: 100-330 uF electrolytic polarized capacitor
D1: I used a Rainbow flashing LED (so this circuit will flash), if a regular LED is used, it will not flash.
R1: a 10k resistor (carbon, 1/4 w is fine).
For R1, I used a 1 K resistor in series with a 10K potentiometer, for adjustment purposes.
PB: a normally open (N/O) push button switch
Misc.: wire, pc board (or prototype board), 9 v battery snap (and battery), desired case design