Need a transistor for driving a relay?

Thread Starter

Dadu@

Joined Feb 4, 2022
155
Specification for DC supply
Voltage = 5V DC
Current = 20mA DC

Specification for 5V Relay
Trigger Voltage (Voltage across coil) = 5V DC
Trigger Current (Nominal current) = 70mA

I don't think I can activate realy with 5V, 20mA DC supply. I found that I need transistor to drive relay.

I don't understand how to find out what voltage, current rating transistor I need to drive realy
 

BobTPH

Joined Jun 5, 2013
8,996
A transistor will not increase the power from a supply. In order to activate a 5V relay requiring 70 mA relay you need 5V supply that can produce at least 70mA.

Perhaps you are using the words wrong. A supply is something like a battery or a wall wart. When you say you have a 5V 20 mA supply, is that what you are talking about, or are you talking about an output pin of a chip that can source 20 mA if current?

Bob
 

Marley

Joined Apr 4, 2016
502
As the voltage and current in this application are both small, pretty much any general purpose small-signal bipolar transistor or MOSFET will do the job.

But the method of selecting a transistor would be to consider the maximum voltage the transistor will experience when OFF and the maximum current it will have to carry when ON. In both cases, if possible have a large safety margin (at least 100%).
Another thing to consider is the expected power dissipation of the transistor. This will be its ON state current x the voltage drop across the transistor when carrying this current. As this is a switching application - the transistor is either fully ON or completely OFF you normally don't have to worry about what happens if the transistor is partially conducting: Power dissipation and SOA (Safe Operating Area).

So for you relay application:
Maximum current: 20mA
Maximum voltage: 5.7V (5V supply + the forward voltage of the back-EMF catching diode across the relay coil)
Power dissipation: P = I*V so 20mA x 0.65V (the ON-state voltage) = 13mW

So, looking at a 2N2222A (for example) the data sheet says:
VCEO (maximum collector - emitter voltage when transistor off) = 40V
Ic (maximum collector current = 0.6A (600mA)
Ptot (maximum power dissipation) = 0.5W
So basically, well capable of doing the job!

Another thing you need to consider is driving the base of the transistor.
Looking at the data sheet you can see that the DC current gain is specified as 75 at Ic = 10mA. This is a minimum figure, it will probably be higher.
But design for the minimum figure (that's why it's given). So for a collector current of 20mA, the base current needs to be at least 20mA/75 = 266μA (or .266mA). So provide a base resistor that supplies at least this current.

The data sheet linked says the transistor is obsolete - but still easily obtainable. Other similar types are BC548, etc.
 

Thread Starter

Dadu@

Joined Feb 4, 2022
155
Perhaps you are using the words wrong, are you talking about an output pin of a chip that can source 20 mA
yeah that's what i'm talking about, output pin of a chip that can source 20 mA

A transistor will not increase the power from a supply
If I am not wrong, we are using transistor because it is a current source device which will increase the current
 

SamR

Joined Mar 19, 2019
5,052
You are using a transistor as a switch. Applying a 5VDC signal to the transistor base/gate and switching ON the common-emitter/source-drain. The 2N7000 is a logic level switched MOSFET and the 2N2222 is a BJT commonly used for switching. Look at the PDF specs for the relay coil then compare them to the transistor PDF to ensure it will not be overloaded. Check current, voltage, and power ratings. If more power is needed, look at the TIPXX transistors.
 

Alec_t

Joined Sep 17, 2013
14,329
yeah that's what i'm talking about, output pin of a chip that can source 20 mA
It is not good practice to use any device at its maximum rating. Better to use no more than, say, 10-15 mA .
A bipolar junction transistor (bjt) with a collector current of 70mA driving the relay would need a base current of about 7mA to ensure it is switched on fully. Any common bjt with a collecor current rating of 100mA or more would suit your purpose.
 
Last edited:

vu2nan

Joined Sep 11, 2014
345
If I am not wrong, we are using transistor because it is a current source device which will increase the current
Hi Dadu,

The transistor is used to switch the relay across a 5V DC power source.

The base drive is 5/1000 = 5 mA.

With a DC current gain of 100 the collector current could be 500mA maximum.

In this case the collector current would be the relay coil current (70 mA).

1.png

Nandu.
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
28,696
The 2n7000, originally coined a 'FETlington' by Siliconix in the 80's was designed to replace transistor interface for logic and other LV circuitry.
It has been my first go-to since then.
(The price marked was the original!!).
 

Attachments

Thread Starter

Dadu@

Joined Feb 4, 2022
155
Where is the signal to turn on the relay coming from?
It's difficult to understand exactly what you are trying to do.
I wanted to understand the theoretical concept, so I assumed that the pin of the micro controller is supplying maximum 20 mA. I understand in this case microcontroller cannot activate the relay directly because the relay requires a lot of current and pin of micro can provides a maximum of 20 mA. I found that I need transistor to drive relay. I was trying to understand calculations to find suitable transistor to control relay
 

crutschow

Joined Mar 14, 2008
34,459
I was trying to understand calculations to find suitable transistor to control relay
The transistor just needs to meet your modest voltage requirements of 5V (say ≥10V) and current requirements of70mA (say ≥100mA).
This can be met by just about any small transistor such as the 2N7000 N-MOSFET or the 2N3904 BJT.

To fully turn-on the 2N7000 requires a gate-source voltage of 5V (it has only a tiny gate leakage current).

To full turn-on the BJT requires a base-current of 1/10th of the collector current, in this case that would be 7mA.
So you select a series base resistor to provide that current.
If the signal is 5V, then the resistor value would be (5V-0.7V) / 7mA ≈ 600Ω where 0.7V is the typical Vbe of a BJT.

Make sense?
 

Thread Starter

Dadu@

Joined Feb 4, 2022
155

MaxHeadRoom

Joined Jul 18, 2013
28,696
That board and opto isolation is for galvanically isolating two (or more) different systems, particularly where a 5v processor is used together with electrically 'noisy' equipment.
 
Top