Maker Pro
Maker Pro

Help using NPN transistors as a switch

__Bogdan

Oct 15, 2021
6
Joined
Oct 15, 2021
Messages
6
I have 2n2222 TO92 transistors and Im trying to use one as a switch. I draw this thing to explain using a free online sketch tool so it won't be professional and I also didn't use conventional symbols, I draw the exact situation I have since I saw diagrams and I couldn't follow them. I am very new to electronics, sorry if it looks like a 5 year old kid drawing:
2021_10_15_0m5_Kleki.png
 

ramussons

Jun 10, 2014
462
Joined
Jun 10, 2014
Messages
462
The "-" of 5 VDC get connected to the "-" of the 12 VDC.
BUT the present setup will give you a burnt LED, and a damaged Transistor. Hopefully, your DC power supplies will be safe.

The right way:
Common the -ve of both the voltage ( 5 and 12 Volts) "transformers". Make sure that they are NOT just transformers but "boxes" with the output voltages marked as 5 Volts DC and 12 Volts DC.

Connect the LED in series with a 1 Kilo Ohm resistor between the + 12 V and the Transistor C. Make sure that the longer lead of the LED (the +ve) is towards the 12 volts power supply.

Connect the + of the 5 volts through a 10 Kilo Ohm resistor to the B of the transistor.

The E of the transistor is common to both the "-" of the power supplies.

The resistors are required to limit the current to protect the LED and the Transistor.
 

__Bogdan

Oct 15, 2021
6
Joined
Oct 15, 2021
Messages
6
Yes, the boxes are marked as Output 12V DC and 5V DC. But why do I have to use a resistor, my led needs 12V DC to be lit, that's what is said on the package 12 V DC LED.
The led looks like a light bulb:
s-l640.jpg

It is for lamps.

And why do I have to connect resistor to the 5 V? because on the datasheet, the Vbe is 5V and the Vce is maximum 30V
 
Last edited:

ramussons

Jun 10, 2014
462
Joined
Jun 10, 2014
Messages
462
Your sketch mentions a LED and it looks like one. Such LED's drop 1 to 3 volts, and hence a current limit is necessary.

The data sheet mentions 5 volts and 30 volts. But there are conditions specified. data has to be read in full.

If your 12 volts LED lamp can work directly across 12 volts, then, yes, you don't need a resistor in series with it. But the resistor to the base is a must.

The last figure seems to be a 110 volts LED bulb. It requires 110 Volts AC and cannot be switched ON / OFF using a transistor.
It needs a 400 Volts TRIAC and you being a beginner, I will not advise you to do anything with mains.

Use a simple LED like this
upload_2021-10-15_17-2-56.jpeg
 
Last edited:

__Bogdan

Oct 15, 2021
6
Joined
Oct 15, 2021
Messages
6
I will use a simple LED. I have a bunch of theese:
led-5mm-rosu-transparent.jpg

The maximum forward voltage is 2V. How many ohms should the resistor have to drop from 12V to 2V?
The thing I don't understand is this:
Let's ignore the led and focus just on the transistor.
If I connect the + 12 V to the - 12 V, it creates a short circuit and ruin the entire thing. If I connect the + of 12V to collector and the - of 12V to the emitter, and leave the base unplugged the electricity shouldn't pass from the collector to the emitter to create the short circuit because base is unplugged, but it does, the electricity passes from the collector to the emitter even if the base is unplugged. Isn't that the point of the transistor? Anyway I think I did something wrong.
 
Last edited:

AnalogKid

Jun 10, 2015
2,884
Joined
Jun 10, 2015
Messages
2,884
Because there is no current-limiting resistor in series between the base and the 5 V source, you have blown the transistor.

ak
 

Audioguru

Sep 24, 2016
3,656
Joined
Sep 24, 2016
Messages
3,656
On the other forum, the 2N2222 transistors marked "331" are fakes.
 

__Bogdan

Oct 15, 2021
6
Joined
Oct 15, 2021
Messages
6
I solved it. I used another power source of 24V and I use a potentiometer to lower the voltage
 
Top