# A NOT gate with gradual changes between state

I have a simple NOT gate circuit with the following arrangement.

LED D1 will light up by default. If I push SW1, the transistor Q1 will activates and D1 will be turned off. This NOT behaviour works just fine.

The problem is, I want D1 to turn off gradually (the gradation has to be noticeable by humans, so 1 or 2 seconds would probably enough). I put the capacitor C1 for that very reason. I thought by having C1 in that position, the activation of Q1 could be made gradual, because initially currents would be consumed by C1's charging.

It doesn't work. D1 still have an abrupt change of state from ON to OFF. I wonder if I did something wrong with the circuit design?

You have not given C1 a means to discharge well below the point where it turns on Q1. Therefore, it will quickly reach that point when a little current is dumped onto it thru R2.

Even if C1 was kept at 0 V before SW1 is closed, you still don't have enough of a time constant, and the transition will be fairly abrupt. (10 kΩ)(100 µF) = 1 s. However, this will trip when the base voltage gets to about 700 mV out of 6 V, which is about .12 time constants or 120 ms.

Here is a crude circuit that has a better topology for what you are trying to do. It's not a great way to do this, but I tried to use about the same parts.

By using the transistor as a emitter follower, the current thru the LED will vary less abruptly. However, this still doesn't take the logarithmic response of the human visual system into account.

C1 and R1 are the timing components to turn the LED on, and C1 and R3 for off. This means you can adjust R1 and R3 separately for different on and off responses. R2 is sized assuming D1 is a typical green LED with about 2.1 V drop when on, and a current rating of 20 mA.

• I'm yet to fully understand what's going on, but it works, thanks! – Andree Nov 28 '15 at 23:50

R2 and C1 do have a time constant of one second and that means the capacitor will reach approximately 63% of its charging voltage in one second. 63% of 6V is ~3.8 volts

However, to turn the transistor on requires about a 200mV change in base voltage. As a percentage of 3.8 volts that is about 5%.

Therefore, and this is an approximation, the duration of time that the capacitor is charging and activating the transistor is about 20 milli seconds.

You'd be better off using a MOSFET or a comparator.

• Hi Andy, can you explain why a MOSFET would be better in this case? – Andree Nov 28 '15 at 12:23
• A mosfet will have a much broader range of voltage between on and off AND, importantly the gate is high impedance and doesn't affect the RC rise time like a BJT does. – Andy aka Nov 28 '15 at 13:14