In this article we will comprehensively study a transistor relay driver circuit and learn how to design its configuration by calculating the parameters through formulas.
Importance of Relay
Relays are one of the most important components in electronic circuits. Especially in circuits where high power transfer or mains AC load switching is involved, relays play the major role in implementing the operations.
Here we will learn how to correctly operate a relay using a transistor and apply the design in electronic system for switching a connected load without issues.
For an in-depth study regarding how a relay works please read this article
A relay, as we all know is an electromechanical device which is used in the form of a switch.
It is responsible for switching an external load connected to its contacts in response to a relatively smaller electrical power applied across an associated coil.
Basically the coil is wound over an iron core, when a small DC is applied to the coil, it energizes and behaves like an electromagnet.
A spring loaded contact mechanism placed at a close proximity to the coil immediately responds and gets attracted toward the energized coil electromagnet force. In the course the contact connects one of its pair together and disconnects an complementary pair associated with it.
The reverse happens when the DC is switched OFF to the coil and the contacts return to its original position, connecting the previous set of complementary contacts and the cycle may be repeated as many times as possible.
An electronic circuit will normally need a relay driver using a transistor circuit stage in order to converter it’s low power DC switching output into a high power mains AC switching output.
However the low level signals from an electronic which may be derived from an IC stage or a low current transistor stage may be be pretty incapable of driving a relay directly. Because, a relay requires relatively higher currents which may be normally not available from an IC source or a low current transistor stage.
In order to overcome the above issue, a relay control stage becomes imperative for all electronic circuits which need this service.
A relay driver is nothing but an additional transistor stage attached with the relay which needs to be operated. The transistor is typically and solely employed for operating the relay in response to the commands received from the preceding control stage.
Circuit Diagram


Referring to the above circuit diagram we see that the configuration only involves a transistor, a base resistor and the relay with a flyback diode.
However there are a few complexities that need to be settled before the design could be used for the required functions:
Since the base drive voltage to transistor is the major source for controlling the relay operations, it needs to be perfectly calculated for optimal results.
The base resistor value id directly proportional to the current across the collector/emitter leads of the transistor or in other words, the relay coil current, which is the collector load of the transistor, becomes one of the main factors, and directly influences the value of the base resistor of the transistor.
Calculation Formula
The basic formula for calculating the base resistor of the transistor is given by the expression:
R = (Us - 0.6)hFE / Relay Coil Current,
- Where R = base resistor of the transistor,
- Us = Source or the trigger voltage to the base resistor,
- hFE = Forward current gain of the transistor,
The last expression which is the “relay current” may be found out by solving the following Ohm’s law:
I = Us/R, where I is the required relay current, Us is the supply voltage to the relay.
Practical Application
The relay coil resistance can be easily identified by using a multimeter.
Us will also be a known parameter.
Suppose the supply Us is = 12 V, the coil resistance is 400 Ohms, then
Relay current I = 12/400 = 0.03 or 30 mA.
Also the Hfe of any standard low signal transistor may be assumed to be around 150.
Applying the above values in the actual equation we get,
R = (Ub - 0.6) × Hfe ÷ Relay Current
R = (12 – 0.6)150/0.03
= 57,000 Ohms or 57 K, the closest value being 56 K.
The diode connected across the relay coil though is no way related with the above calculation, it still cannot be ignored.
The diode makes sure that the reverse EMF generated from the relay coil is shorted through it, and not dumped into the transistor. Without this diode, the back EMF would try to find a path through the collector emitter of the transistor and in the course damage the transistor permanently, within seconds.
Relay driver Circuit using PNP BJT
A transistor works best as a switch when it is connected with a common emitter configuration, meaning the emitter of the BJT must be always connected directly with "ground" line. Here the "ground" refers to the negative line for an NPN and the positive line for a PNP BJT.
If an NPN is used in the circuit, the load must be connected with the collector, which will allow it to be switched ON/OFF by switching its negative line ON/OFF. This is already explained in the above discussions.
If you wish to switch the positive line ON/OFF, in that case you will have to use a PNP BJT for driving the relay. Here the relay may be connected across the negative line of the supply and the collector of the PNP. Please see the figure below for the exact configuration.

However a PNP will need a negative trigger at its base for the triggering, so in case you wish to implement the system with a positive trigger then you may have to use a combination of both NPN and PNP BJTs as shown in the following figure:

If you have any specific query regarding the above concept, please feel free to express them through the comments for getting quick replies.
Power Saver Relay Driver
Normally, the supply voltage for a operating a relay is dimensioned to ensure that the relay is pulled-in optimally. However, the required retaining voltage is typically much lower.
This is usually not even half the pull-in voltage. As a result the majority of relays can work without problems even at this reduced voltage, but only when it is ensured that at the initial activation voltage adequately high for the pull-in.
The circuit presented below may be ideal for relays specified to work with 100 mA or lower, and at supply voltage below 25 V. By using this circuit two advantages are assured: first of all the relay functions using substantially low current; at 50 % less than the rated supply voltage, and current reduced to around 1/4 of the actual rating of the relay! Secondly, relays with higher voltage rating could be used with lower supply ranges. (For instance a 9 V relay that is required to operate with 5 V from a TTL supply).


The circuit can be seen wired to a supply voltage capable of holding the relay perfectly. During the time S1 is open, C1 gets charged via R2 upto the supply voltage. R1 is coupled to the + terminal and T1 remains switched OFF. The moment S1 is presed, the T1 base gets connected to supply common through R1, so that it switches ON and drives the relay.
The positive terminal of C1 connects to the common ground through the switch S1. Considering that this capacitor initially had been charged to the supply voltage its -terminal at this point becomes negative. The voltage across the relay coil therefore reaches two times more than the supply voltage, and this pull in the relay. Switch S1 could be, certainly, be substituted with a any general purpose transistor which can be switched on or off as required.
Hello Sir, please Sir I was to repair an four plate induction cooker.The power supply uses a relay which switches on the Neutral connection to a diode ic ac terminal pin.The other pin of the diode ic gets direct contact to the Live of the mains.
However,the relay is not switching,and after careful examination,I saw two transistors 3F(BC857)and 4F(BC860) .Both transistors are wired in series with their collector pins connected to the relay coils independently. I measured the supply voltage to the base of the transistors to the emitter and measured 14Volts.However,the collector voltages measured very less about 6volts.
I thought to replace the two transistors 3F and 4F but they are not common within my locality or nearby Electronics stores.Please Sir, I needed a schematics comprising of similar but employing the use of simple transistors to switch on the relay.
Hello Lawal,
You can use any ordinary BJT for driving a relay. The only thing that matters is the current and the voltage rating of the transistor which must be correctly rated to handle the relay coil current. I have explained the formula in the above article, you can use it to determine the suitable transistor for your relay. For this you will have to first find out the coil resistance of the relay.
Regarding the series configuration, are the transistors configured in the following manner?
https://www.homemade-circuits.com/wp-content/uploads/2022/09/4.jpg
Please Sir, the two transistors were not configured in that manner,after I checked several times using continuity test,I found out that,the transistor labelled 3F(PNP),has a 47k smd resistor connected across it’s base and the emitter.
The emitter is connected to a voltage supply of 14.2 voltage output from the ferrite core transformer transformer.
The base is connected further to R23 which is more of a shiny dot conductor on the motherboard .
The emitter is further extended through connection to C64 which also look like a shiny points on the motherboard possibly smd capacitor.
The collector of this transistor is connected to one of the relay coils terminal.
2.The second transistor 1F (NPN), also has 10K resistor connected across it’s base and emitter.The emitter is connected to the ground of the voltage supply 14.2V output from the ferrite core transformer.So in this case, when I measured the voltage across the two emitters, (PNP and NPN), I recorded 14.2V.
The base of the 1F transistor is further connected to 2.2K smd resistor and the other terminal connected further to the third pin of a microcontroller R5F2127.
The collector of 1F is connected to one of the other relay coils terminal.
The induction cooker has four burners , and it has two separate identical Motherboard each with two coils from heating.
The whole section is operated digitally.
Hi Lawal,
I think it is better to remove the transistors from the board and then check it with a meter. Without seeing the schematic it can be difficult to understand the layout of the transistor configuration.
Hi swagatham ji namaskar your simple Quadcopter circuit and how to design simple Quadcopter using aluminium extrusion pipes has been my Bhagavad Geetha i almost read it daily for the wonderful explanation with pics is really great great for hobbyist like me thank you ji
Raghu k
DSP tamilnadu police service
9344477986
Thank you Raghu Rao, I am glad you liked the post on quadcopter. I appreciate your kind words very much. All the best to you.
Нello you have a very good post about relay management
my question to you is:
I am doing a project to control coils of pneumatic distributors which need to be controlled is energy saving.
The parameters are as follows 3.5 A ; 24 volts;
The idea is that the distributor plunger will move at 24 volts for 4.5 m/s. then I need a holding voltage of 4 to 7 volts (5 volts) or 1/4 of nominal.
I figured out how your relay circuit works. it is suitable for the coil also.
How should I connect the coil and how will I get a trip time of about 5 m/s. and there should be immediate on/off without time hold ( real time control).
Проблема ми е бързодействието.
Thank you for reading and liking this post.
Any type of solenoid coil with proper ohm rating can be used with a transistor diver just like a relay, it will work.
To get a brief switch ON time of 5 ms you can add a capacitor in series with the base resistor as depicted in the following diagram:
https://www.homemade-circuits.com/wp-content/uploads/2023/04/momentary-switch-ON-driver-circuit-for-solenoid-coil.jpg
You can adjust the value of the capacitor to get the precise 5 ms trip time on the coil
Many thanks I will create the scheme and return a reply.
what transistor do you recommend to use because of 24 volts and what resistors.
thanks for your assistance
No problem!
You can try TIP122 transistor, and try the resistor as given in the diagram. The capacitor value can be changed to suit the delay requirement.
Please delete my comment below, I connected relay side to emitterin stead of collector. So your explanation is correct.
This means we have to READ an understand completely, before proceeding.This means also your explanation wil be saved to my favourites!
Thanks!!
No problem Johan, I understand! I have deleted your previous comment!
I like your site.
I really liked the old 2N2222A and the 2N2907 TO-18s, that should date me as an
EE retired as of 2017. The IMMC ( Integrated Mission Management Computers ) flying in the Global Hawk UAVs are my Babies The PCB designs were complex at 2.5GHZ PCIe gen_2 speeds ! magic
The PV MOSFET drivers (IXYS FDA217 AND SIMILAR) can provide output isolation for low speed , high power AC/DC applications.
Also reed relays are great for many applications.
Thank you for your valuable feedback, much appreciated!
Always check that all parts, active and passive are not dissipating more than they are rated. Your finger
will be OK at 100milli watts more or less. If you have to get your finger off, it is too hot to be reliable.
It is Tym Sir, I forgot for a photo proof, here it is; https://ibb.co/0KMNMzd
Hi Tym, sorry, that link is not opening, if possible please try some other image hosting site.
Here is another link I tested and OK;
https://www.homemade-circuits.com/wp-content/uploads/2022/09/operating-12V-relay-with-5-V.jpg
but the first link works for me, I tested clicking it in the above comment, just a feedback Sir.
Yes it is working now….and the connections look OK to me.
Hi Sir, I tried power saver driver circuit. I used an SS8550, and an ON/OFF switch for S1, and a 2.7K (from my storage) for R2 instead of 3.3K and I think it is not a problem, and the rest are the same as in above picture. But it did not work with 5V. I tried changing R1 to 15K picked from my storage but the relay still doesn’t pull in.
I used adjustable voltage power supply and noted that the relay starts to make clicking sounds at around 5.4V but doesn’t pull in (yes, I always wait some seconds for capacitor to be charged before turning ON the switch). It starts to pull in at around 6.35V but with a weak click sound, and also has a delay of about 2 seconds between switching OFF and ON. The voltage at the relay coil(400 ohms) is 5.55V under operation.
6.35V supply is about 53% of a 12V relay that is close to your description of 50%. But it does not work with 5V. I think something is wrong with the circuit picture.
Thank you Tym for trying this circuit. Actually this circuit was contributed by another person, it is not my design, so I am not 100% sure about the working of the design.
You can try increasing the C1 value to 100uF and check the response. The circuit is supposed to initiate only when the switch “S” is pressed after applying the 5 V supply.
However even at 6.35V, it is not bad, since normally it would have required at least 10V to activate the relay.
If I use 100uf capacitor, can the capacitor and circuit be harmed by turning the switch on and shorting to ground?
The capacitor is connected to the resistors and the relay coil so it cannot harm anything in the circuit.
What I understand is the charged capacitor(about 6V) is shorted to ground when I turn the switch ON, there is only a 1N4148 between the capacitor minus pin and ground line, I had read somewhere that capacitors should be discharged by proper resistance/resistor, so my question is this instant discharging method safe for capacitor for this amount of voltage?
I hope you understand my writing.
Sorry for my poor broken English Sir.
A capacitor will not get damaged if its terminals are shorted unless you do it too rapidly. It can get damaged instantly only in one condition, if the charging voltage across it exceeds the maximum rating printed on its body. For example if the printed value on the capacitor 25 V then if this voltage is exceeded, then the capacitor might start leaking or might explode..
Moreover, your capacitor is getting the charging voltage through a resistor so the stored current content is less.
Thank you for the lesson and clarification.
Hi Sir, I tried changing capacitor values. First, 100uf, minimum pulled-in voltage is around 5.64V, charging delay time (initial charging time for capacitor before Switch ON) is above 3 seconds. I noticed there is also a delay of about 1 second for relay cut-off after Switch OFF.
Then 220uf (but it is above 190uf according to my DMM capacitance meter), minimum pulled-in voltage is around 5.17V, charging delay time is about 4 seconds, cut off delay time is about 2 seconds.
Finally, 330uf (I couldn’t check it because it is beyond my DMM maximum scale), minimum pulled-in voltage is around 5.01V, charging delay time is about 5 seconds, cut off delay time is above 2 seconds.
So the facts with this circuit are some delay at initial or every time after the Switch is OFF and also has some delay for the relay to be cut off.
Good observations Tym, appreciate it. I hope the readers will find the information useful.
“… transistor works best as a switch when it is connected with a common emitter configuration, meaning the emitter of the BJT must be always connected directly with “ground” line.”
Oversimplification, especially when having high impedance triggering source we need to drive the relay or any low impedance load and common collector is a perfect solution.
Greetings!
I would like to build the last circuit, looks very promising for my project. Tho, i was wondering, i don’t see any diodes parallel to the relay coil. I see another in series to the ground, isn’t that a problem?
Thank you for your kind answer in advance!
Hi, in the last circuit the C1 and the diode probably will not allow the back emf to harm the transistor, it is safe according to me..
Great then, thank you for your kind and quick answer! ^^
Thank you, my pleasure
Hi, I have a relay of 24VDC.-.-.- for coil voltage.And I want to design it’s power without using a TX?From 220v AC.
Hi, You can build a transformerless power supply using a 0.33uF/400V capacitor, a bridge rectifier, and a 1000uF/50V filter capacitor to power the 24V relay.
Sir could you tell me what the use of diode is in the power saver relay driver circuit?
The diode along with the capacitor helps to form a voltage doubler circuit.
Two thoughts. First I see no throw back diode to protect the transistor when switch is opened.
Second is the assumption that running a relay at lower voltage is ok. First a typical 12 volt relay will usually pull in at around 6-7 volts and dropout at 3-4 volts. So using 5 volts does not allow much for variations that occur with wide temperature changes. You should also be aware that
relay contacts current carrying capacity are affected by the force pressing them together which in
this case is being reduced substancially. If switching currents of a milliamp or less and depending on the contact materail you can risk loss of contact over time and environmental changes. Better choice is to use a magnetic latching relay. Your approach would be fine when driving a solenoid.
Thanks for the useful feedback!
Hello sir i tried to simulate the power saver relay driver circuit with the ame parameters but it doesn’t seem to work. The relay doesn’t switch side could you please tell me what could be wrong?
Hello Muzzam, the circuit has only a few parts, so it would be a better idea to build it practically and check how it performs.
Thank you for your quick response. I am new to electronics. I have few questions if you would answer i would be highly grateful.
1) have you build the power saver relay practically yourself did it work? (I don’t mean to be rude).
2) have u used the same values for the components as shown in diagram.
3) what is the name of the transistor used?
4) what does the (+)on the battery signify and what is that o at the bottom do i have to keep it open?
I have not built it practically, but it was referred from a top reputed electronic magazine, so it will definitely work
ok sir could you tell me the name of that magazine?
And, also can i post the picture of my simulation somewhere so that you could check where i could have made an error
sorry I don’t use simulators, I always believe in building practically and testing
Good