You NEVER use a little pot for low values/high currents. Instead you use a fixed resistor calculated to do the job with its size big enough so it survives.sorry one other thing i wanted to say, it would never have occured to me to work out what % of the pot was being used. its seeing info like this and real working out that makes threads like this real gem's ok i admit the OP drives a few mad but beginners like me take notes of this stuff is real good learning stuff thanks guy's
With a +9V supply I calculated a series base resistor of 160 ohms and it will dissipate 0.4w. A half-watt resistor will be very hot so use a 1W resistor.
A little pot is rated for about 0.5W for its entire resistive track, 0.25W for half of the track and 0.05W for one-tenth of its track. When the 20k pot is set to only 160 ohms then only 0.008 of its track (if it is possible to set it so low) must dissipate 0.4W which will destroy it.
This thread is getting confusing because Ritesh will use a PNP transistor (with a +5V supply then +5V into the series base resistor turns it off and 0V turns it on) and other people are talking about NPN transistors (with a +9V supply then +5V or +9V into the series base resistor turns it on and 0V turns it off).