Pages: [1]   Go Down
Author Topic: 2N2222 transistor as a switch  (Read 6175 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you can't see this image I've attached it.
I’ve used a 2n2222 Transistor, an Arduino Uno, a 12 volt power supply, a 12 volt relay and a multi-meter. On the figure, C represents the collector side of the transistor and E represents the emitter side, R represents the 12 volt relay and M represents the Multi-meter. The base is connected with a 330Ohm resistor or a 10K resistor (I’ve tried both). In principle the relay should be turned on whenever the PWM from the Arduino is high, but it is not turning on or off for whatever the signal is. I should have get 12 volts – 0.7 volts = 11.3 volts at the relay side, but instead I’m getting around 4.6 volts. What did I do wrong? Shouldn’t the drop of the transistor be 0.7 volt?



* Untitled.png (3.84 KB, 460x220 - viewed 926 times.)
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your simply applying an NPN transistor improperly. You should wire it up as a 'low side switch' with the emitter grounded, the collector to the motor and motor to +12vdc. A reverse wired diode across the motor terminals is a good idea also.

Lefty

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why not? This transistor is just a switch, right? You should have get around 11.3v after being transferred through the transistor.
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11694
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No a transistor is not a switch - it switches, but its not that simple (MOSFETs are conceptually a bit more like
switches incidentally).

For an NPN transistor to conduct the base voltage has to be above the emitter voltage.  The Arduino can
only generate 5V, so the emitter in your circuit has to be less than 5V (about 0.6 to 0.7V below in practice).

The circuit configuration you have is called an emitter-follower, and it not used for switching, its used for
buffering analog signals typically.

You need a "common-emitter" configuration.  emitter to ground, collector to load, base via resistor to
Arduino - many examples all over this and other sites - so long as there is enough current through
the base resistor it rises 0.7V above the emitter and allows conduction.

For a transistor to be a switch it needs to go from hard-off to hard-on under control - hard-on is called
"saturated" and requires more base current than you might naively suppose (if the transistor has a gain
of 100, saturation might require the base current to be > 1/20th of collector current).  In saturation the
collector voltage falls to very close to ground (below the base voltage in fact).
Logged

[ I won't respond to messages, use the forum please ]

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why not? This transistor is just a switch, right? You should have get around 11.3v after being transferred through the transistor.

Just trying to tell you how you can make it work. Using a NPN transistor in a high side switch requires a base voltage too high to safely wire directly to a arduino 5vdc output pin unless you use a two transistor circuit.

http://www.rason.org/Projects/transwit/transwit.htm

Lefty

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok thanks for the response guys. What I'm trying to make here is an H-bridge using only 4 2n2222 transistors. After googling, I found that the collector side of the two transistors should be connected directly to the +12v source and each of their emitters to each side of the motor as shown in the following website http://electronics.stackexchange.com/questions/7235/motor-driver-using-only-a-2n2222-transistor, you are saying that in order for the above circuit to work the base voltage should be as high as the motor needs to rotate. Anyways check it out and tell me what u think.
Logged

Inland Empire, California, US
Offline Offline
Sr. Member
****
Karma: 6
Posts: 279
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You really should use a PNP transistor for high side switching as NPN are for low side. The information in that website is not quite accurate. While that is general idea for an H-Bridge, you need PNPs between the positive supply and the load.
« Last Edit: March 07, 2013, 01:55:25 am by seanz2003 » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can always use an other two 2N2222s to get the base voltage on the top pair of transistors up to 12V. Otherwise that circuit will not work.
There is a lot of that sort of miss information about.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could u suggest me some PNPs suitable for this job?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://forum.allaboutcircuits.com/showthread.php?t=22555
You still need driver transistors though if you are using a 12V supply.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem solved! I’ve used two 12 volt relays, four 2N2222 NPN transistors, and an Arduino of course. I’ve connected the circuit as shown below. There seems to be one problem though, when I connect a small 6v dc motor it works fine, but when I connect a motor (a typical car window opener), the transistors will get hot and the motor won’t turn on. I suspect the transistors aren’t designed to carry that much current so I need a higher rating transistors (Correct me if I’m wrong). Could you list a higher power (Voltage and Current) rating transistors which can equivalently replace 2N2222s. Thank you all!


* Untitled2.png (14.08 KB, 694x506 - viewed 438 times.)
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not sure I understand that schematic it doesn't use conventional symbols.

Quote
I suspect the transistors aren’t designed to carry that much current so I need a higher rating transistors
They are not, only about 600mA which is nothing for a motor of that size.

Quote
Could you list a higher power (Voltage and Current) rating transistors which can equivalently replace 2N2222s
I would not be surprised if there were not thousands of these. In fact with this current then a transistor is not the best solution and you need a logic level FET. It depends on where you live what is available in your location. Find a suppler and look for an n-channel logic level FET.
Logged

Pages: [1]   Go Up
Jump to: