Pages: [1]   Go Down
Author Topic: 2N2222P usage on Load Switch  (Read 651 times)
0 Members and 1 Guest are viewing this topic.
South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 416
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have looked at the following example :

http://ruggedcircuits.com/html/circuit__11.html

As I understand it, this contains 2 transistors used to link the load current ( not the same V as the IC ) to the Load.

I need to use the 5V Arduino output to activate a 12V relay.

My question is, as the 2N2222 is a NPN transistor, can I not simply attach the 12V+ direct to the relay, and then use the NPN on the GND side of the relay, activated by the High Output from an Arduino pin ( using the built-in pull up resistor, and an in series resistor to reduce the pin output to the current required by the NPN ?

This would do away with the top part of the example ( the PNP transistor ).
Logged

Global Moderator
Online Online
Brattain Member
*****
Karma: 485
Posts: 18810
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am no electronics expert, but I should point out that the circuit you mentioned does not use any 2N2222 transistors. It uses two MOSFET transistors, whereas the 2N2222 is a BJT transistor. They work in different ways (the BJT is more "linear" than the MOSFET).

However in principle it is a good question - I would have thought that a suitable single MOSFET would be able to activate a relay.
Logged


0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
My question is, as the 2N2222 is a NPN transistor, can I not simply attach the 12V+ direct to the relay, and then use the NPN on the GND side of the relay, activated by the High Output from an Arduino pin ( using the built-in pull up resistor, and an in series resistor to reduce the pin output to the current required by the NPN ?

Yes (except that bit about the pull-up resistor), this is low-side switching as opposed to the p-channel high-side switching of the linked example.

However you will need a diode across the inductive load to prevent inductive spikes - have a look at other relay examples for how to do this.

You also need to check that for the relay in question the transistor is able to switch enough current, and choose a good value for the base resistor (large enough to avoid overloading the Arduino pin, small enough to drive the NPN into saturation).  Don't rely on the internal pull-ups they are very weak (20k to 50k), drive the pin as an output.
Logged

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

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

Look at this for driving a relay with a transistor:-
http://www.thebox.myzen.co.uk/Workshop/Motors_1.html
Logged

Erfurt, Germany
Offline Offline
Newbie
*
Karma: 1
Posts: 42
IPC Certified Interconnect Designer (C.I.D.), hustling around in electronics since 1971
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Right, and don't omit the diode! It protects your transistor from induced overvoltage.
Logged

2b || !2b
Shakespeare, Hamlet

Pages: [1]   Go Up
Jump to: