2n2222 for relay switching

Thread Starter

Dritech

Joined Sep 21, 2011
901
Hi all,

I am using a 2n2222 transistor for switching a 5V 185mA 27ohms relay. I calculated that the base resistor should be 270ohms. Why am I getting approximately 3.2V at the relay terminal and not a value close to 5V? 3.2V are not enough for switching my relay.
Also, the 2n2222 transistor is getting quite hot.

Any help or suggestion would be highly appreciated.
 

MikeML

Joined Oct 2, 2009
5,444
With the transistor saturated, you should have a voltage at the collector of ~0.3V, meaning that the relay should get 5V-0.3V= 4.7V.



An logic-level NFET would be a better choice for a relay driver.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
11,056
Hi all,

I am using a 2n2222 transistor for switching a 5V 185mA 27ohms relay. I calculated that the base resistor should be 270ohms. Why am I getting approximately 3.2V at the relay terminal and not a value close to 5V? 3.2V are not enough for switching my relay.
Also, the 2n2222 transistor is getting quite hot.
Is the transistor connected as an emitter follower or a saturated switch?

ak
 

Papabravo

Joined Feb 24, 2006
21,228
Except the microprocessor cannot source 16 mA. It can probably only put the transistor into the linear range and that is why it is not turned on. What voltage is the processor putting out ahead of the 270 ohm base resistor?
 

Thread Starter

Dritech

Joined Sep 21, 2011
901
Note that when I changed the transistors to TIP122, the circuit worked (using same base resistor etc.). The problem is that I have a PCB design with the 2N2222 package so i cannot fit a TIP122.
 

absf

Joined Dec 29, 2010
1,968
TIP122 is an NPN darlington transistor. There are some darlington NPN in TO92 foot print eg. BC517. Just do a google search and see which one is easily available to you.

Did you try MOSFET? I think that should be the right choice for your job.

Allen
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
Thanks for the replies. The PIC18f I/O can supply up to 25mA.
Guess again. While it may be rated to put out such a current without damage it does not mean the output will stay at 5V when doing so.

Measure the PIC pin when doing this. Actually drawing the schematic and noting the voltage at every node is the best way to go.
 

shteii01

Joined Feb 19, 2010
4,644
After all the previous posts here on the subject, I am surprised why some still opt for a bi-polar for Pic or μp outputs?
Max.
My guess, based on my own education, is that we just follow our education. My curriculum spent a lot of time on BJT in lectures, homework and lab experiments. I had some instruction in FETs, but not anywhere as much as BJT and I don't remember doing any lab experiments with FETs.

And inexperienced people like me don't really know the pitfalls of uC. We read on paper that it will do: "5 volts and 25 mA" and we take it for complete truth. Many times I look at datasheets and I know that I don't know what most of the stuff in the tables actually mean.
 

MaxHeadRoom

Joined Jul 18, 2013
28,702
My guess, based on my own education, is that we just follow our education..
It probably influenced mine ;).
Having gone through the tube era, which is very close in concept to the FET I sort of had an affinity to it and the transconductance type of principle of a Mosfet.
Max.
 
Last edited:
Top