# Behaviour of capacitor discharging through a transistor's base

I have the following circuit which attempts to turn on and off LED in a gradual manner (instead of having abrupt change between states).

So when I press S1, LED1 will light up gradually, thanks to C1's charging. My eye can observe a 1 second period till the LED fully light up. This works as expected. However, If I release S1 afterwards, LED1 will gradually turn off, but it take very long, like 30 seconds or so till the light completely vanishes.

So C1 discharges really slow, and I don't understand this behaviour. I thought C1's discharging process should be fairly fast, since there is only a 220ohm resistance (plus the diodes' resistance) between its two poles? Can someone explain to me what's happening here?

Your analysis is flawed. If there was a 220ohm discharge process this would also be present when charging BUT clearly this isn't the case by your own acceptance of what is going on. You said: -

This works as expected.

When you open circuit the switch there is a very weak (by comparison) discharge of C1 by the 220 ohm multiplied by the hFE of the transistor so, 220 ohm becomes more like 22k or much greater (transistor dependent).

If you want it to discharge at approximately the same rate try using a 2 position switch where one position connects to a 10k pull-up resistor (as per your circuit) and the other position connects to a 10k pull down resistor.

• Hi Andy, thanks for your explanation and pointing out hFE. I haven't consider about the hFE of the transistor, so as you elaborated, my assumption about the overall resistance of the circuit is false. Although I haven't tried your suggestion, my confusion has been cleared, sort of. Commented Nov 29, 2015 at 5:01

Or just put a 3k R from the junction of the switch and the 10k to GND -- you can use the switch you have. For faster discharge add a diode across the 10k (opposite polarity to the NPN's B-E diode).

• Won't this resistor prevent the capacitor from fully charging to the supply voltage? It seems to me you are creating a voltage divider that will only allow the capacitor to charge to about 1.5V...the LED will never light up. Commented Apr 9, 2020 at 13:56
• @ElliotAlderson He said to put the 3k on the switch side of the 10k. It will be directly connected to the supply when the switch is closed so the 3k has no effect on the (charging) time constant or final cap voltage. Commented Apr 9, 2020 at 14:41