Go Down

Topic: 2N2222P usage on Load Switch (Read 702 times) previous topic - next topic

DaveO

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 ).

Nick Gammon

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.
http://www.gammon.com.au/electronics

MarkT

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.
[ I won't respond to messages, use the forum please ]

Grumpy_Mike


Ulli

Right, and don't omit the diode! It protects your transistor from induced overvoltage.
2b || !2b
Shakespeare, Hamlet

Go Up