Electronic – Inverting a push button

ledtransistors

I have a push button that by default is in 'ON' state and a LED attached to it. I want the LED to light up when the button is pushed down, instead of being on by default.

As far as I understood I need to use NPN transistor as a switch to accomplish this, but I still don't understand how.

Is there a way to make the transistor work inversely? For it to be in an 'OPEN' state – The LED is not glowing when electricity is applied to the base, and when I push the button, (base receives no electricity, but the gate opens)? Thank you.

Best Answer

I am assuming you have a schematic like below:

schematic

simulate this circuit – Schematic created using CircuitLab

In this case, when the switch is not pressed, the circuit is completed and the diode lights up. When you press the switch, SW1 opens and the LED turns off.

Yes, an inverting setup is the most common type of NPN single stage amplifier. It is called 'common-emitter'.

To reverse this using an NPN, you can do the following:

schematic

simulate this circuit The common-emitter configuration for an NPN BJT works by amplifying base->emitter current to collector->base current. The NPN BJT consists of a base->emitter diode. When this is turned on (the voltage across it is greater than about .6V), any current injected into the base will be amplified by the 'beta' of the transistor, typically ~100.

So for our circuit, when the switch is disconnected, the entire V1 is across the resistor R2 and the base->emitter diode of the NPN. This turns the diode on, to 0.7V. The rest of the voltage goes across the resistor R2. This creates a current, due to Ohm's law, of \$ I = V/R = (V1-0.7)/(R1) \$.

Let's assume V1 = 5V and R2 = 10k as in the circuit above. \$ I_b = (5-0.7)/(10000) = 4.3/10000 = .00043A = 0.43mA. \$

When the NC (normally-closed) switch is not pressed, there is voltage division between R2/R3. Voltage at the base is (500/10500)*V1; this is so low that Q1 is off and the LED gets no current. However, when you press the switch, the lower branch of the voltage divider is cut off and now you have the ~threshold voltage (about 0.7 V) at the base of the BJT. This leaves (V1 - 0.7V)/R2 current flowing into the base to be amplified through the LED.

For an NPN, it will typically amplify the base current by 'beta' unless it cannot anymore. One common reason for this is that the collector->emitter voltage becomes too low. This is called saturation, and the potential difference between collector and emitter when saturation occurs is called the 'saturation voltage'. It is typically 0.2V.

This is important because the NPN common emitter amplifier is often 'driven into saturation'. This means you give it more base current than it can amplify, which will force the circuit into a very predictable state. This is easy to used in design. In our example, assume the saturation voltage is 0.2V. Also, LEDs usually have a forward voltage of about 2.2V.
If this is the case:

\$ V1 = V_{R1} + V_{LED} + V_{sat} = 5V = V_{R1} + 2.2V + 0.2V => V_{R1} = 3.6V => I_{R1} = I_{LED} = 3.6V / R1 =~ 16.3mA \$

You can verify this is in saturation, because the base current of 0.43mA is only amplified ~37.7x (instead of normally much higher, ~100). 16.2mA is a reasonable amount to drive an LED with as well.

Switch Edits below: switch-configs

I would guess you have the DPST switch shown below. In this case you probably don't even need a transistor to get the desired switch action. You just need to figure out which part of the switch is normally connected and which is normally unconnected. You really only need these 2 terminals. See example circuit below:

schematic

simulate this circuit

Now when the switch is not pressed, the LED gets no current. When you push the switch it turns on. But, you might have fun with the NPN.