Electronic – Behaviour of capacitor discharging through a transistor’s base

capacitorcircuit-designtransistors

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

enter image description here

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?

Best Answer

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.