Home     Contact     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS     Terms of services     Privacy policy  
 Home      Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science   

24 February 2009
Author: Giorgos Lazaridis
Basic Transistor Circuits

Basic transistor relay driver, actuated on HIGH input (NPN)

Click to enlarge

The circuit on a breadboard

This circuit will drive a relay coil from a low power output, usually from an IC like 555 or a TTL/CMOS. It is used to switch high loads or loads that needs AC current to operate. The relay will be actuated when the input of the circuit goes high. The protection diode Dp is used to protect the transistor from the reverse current generated from the coil of the relay during the switch off time. The values for Rb and Qs vary accordingly. The way to calculate them is:

First we calculate the load current:

IL = VS / RL

Then we calculate the transistor hFE. It must be at least 5 times the load current IL divided by the maximum output current from the Input to the base of the transistor

hFE(min) > 5 X IL

Now you can choose the transistor Qs. You must select it according to it's Ic that must be greater than IL and it's current gain hFE.

Then you calculate the base resistor RB, If the input is taken from a component (possible an IC) that uses the same power supply as the transistor (that is Vs), then the form is:

RB = 0.2 X RL X hFE

Otherwise, if the component uses another power source (like VCC) then the form is:

5 X IL

The protective diode could be the 1N4001 or any general purpose diode.

An example:

The output from a 74LS series TTL IC is required to operate a relay with a 160 Ohm coil. The supply voltage is 12V for the transistor and 5V for the IC. The IC can supply a maximum current of 2mA.

IL = Vs / RL => IL = 12 / 160 = 75mA

The transistor must have an hFE greater than 5 X 75 / 2 => hFE > 187.5. So we choose a transistor with hFE = 200 and IC = 100mA.

Now for the RB resistor. Because the power supplies of transistor and IC are different, we use the second formula:

5 X IL

With the use of some basic maths, this will produce RB = 2666.6 Ohm. You choose the closest resistor possible to this value.

And here is the circuit in action!

Basic transistor relay driver, actuated on LOW input (PNP)

Click to enlarge

The circuit on a breadboard

This circuit will actuate the relay when the input goes to logic low. The theory of operation and the calculations are exactly as the previous circuit.

And here is the circuit in action!

Sensor switching transistor (Dark/Light activated sensor)

Dark activated sensor

Light activated sensor

The dark activated switch

The light activated switch

A transistor may be connected in a way that will switch on and off a load (RL) according to a sensor. In our example, the sensor is an LDR. The LDR is a resistor that will change it's resistance according to the light falling on the sensor. The left circuit will switch on the load when the LDR is in dark, and the right will switch on the load when light fall on the LDR.

The potentiometer RS will control the sensitivity of the automation. You should consider using a potentiometer 10Kohms. Also note the resistor on the left circuit labeled RP. This resistor is used to protect the transistor when the potentiometer is switched to low values. This RP should be from 1Kohm to 22Kohms. Select according to your LDR.

You should consider using low current loads using this circuit. There is a point that the transistor will not be either on or off. In this case, there is danger overheating the transistor if you have big loads like lamps and motors. In this case, you should use a second transistor connected as a driver.

And here are the circuits in action!

The dark activated relayThe light activated relay

The Darlington pair

The Darlington pair

The Darlington pair consists of two transistors connected as the drawing. This connection have the characteristic of very high current gain. Actually, the overall gain is:

hFE = hFE1 X hFE2

This results to gain more than 10000. It requires only a tiny base current change on the input of the Darlington pair in order to switch a load.

A Darlington pair will act exactly as a single transistor only with very high current gain. Also, because there must be at least 0.7volts in both base-emitter junctions, to switch on a pair like that will need at least 1.4volts.

Darlington pairs are available as complete packages but you can make up your own from two transistors. The first transistor can be a low power type, but normally the second transistor will need to be high power. The maximum collector current Ic(max) for the pair is the same as Ic(max) for the second transistor.

The Darlington pair connected as touch switch

The touch switch on a breadboard

Because a Darlington pair will respond to very small current changes, you can make a touch sensor switch like seen on the schematic left. The RP is a protective resistor, about 100Kohms, in case of short-circuiting the sensor plates.

And here is the circuit in action!

Astable Multivibrator circuit

Astable Multivibrator

An astable multivibrator

This circuit will perform an astable multivibrator circuit. It has two outputs, O1 and O2. When O1 is high, O2 is low. The frequency of oscillation is calculated by the following form:

FB = 1
0.693 X (R2C1 + R3C2)

The outputs changes as per the following timing chart:

And here is the circuit in action!

Monostable Multivibrator circuit

A monostable multivibrator

This circuit will perform a monostable multivibrator. When an input pulse occurs, the output goes high and remains high as per time constant of C1 and R2. While the output is high, the input pulses have no effect on the circuit. Also, If the input is triggered and kept high longer than the time constant of C1 and R2, the output will NOT stay high for longer than C1 R2 time constant. The time constant is:

T = 0.693 X C1R2

The exact timing chart is shown bellow:

And here is the circuit in action!

RS Flip Flop (RSFF)

RS Flip Flop

An RS Flip-Flop circuit

This circuit will act exactly as an RS flip flop. The two inputs works as set and reset, and the outputs work as Q and -Q.

The timing chart for this circuit is shown below:

And here is the circuit in action!

Relative pages
  • 555 timer basic circuits
  • How to make a light / dark activated switch - 3 different circuits under the microscope
  • Learn about the semiconductor packages
  • The transistor theory of operation
  • The SCR (Silicon Control Rectifiers) theory
  • The TRIAC theory
  • Dr.Calculus: Checking transistor functionality

  • Comments


      Email (shall not be published)


    Notify me of new posts via email

    Write your comments below:
    BEFORE you post a comment:You are welcome to comment for corrections and suggestions on this page. But if you have questions please use the forum instead to post it. Thank you.


  • At 21 June 2014, 19:32:20 user Ron wrote:   [reply @ Ron]
    • I can only see the resistor values for the input on the monostable.I am going to use 10K from another monostable circuit I looked up.Shouldn't that work.Thanks

  • At 7 May 2014, 8:49:38 user JUSTIN C DAS wrote:   [reply @ JUSTIN C DAS]
    • @Giorgos Lazaridis
      thank u sir

  • At 7 May 2014, 7:35:45 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @JUSTIN C DAS Ok you start with the formula
      hFE=5x(IL/Iin). Replace currents with resistors. Since they both use the same voltage:
      IL/Iin = (V/RL)/(V/Rb) = Rb/RL

      So, the formula is now hFE=5x(Rb/RL) =>
      5xRb = hFExRL =>
      Rb = (1/5) x hFE x RL =>
      Rb = 0.2 x hFE x RL

  • At 28 April 2014, 13:27:46 user JUSTIN C DAS wrote:   [reply @ JUSTIN C DAS]
    • Sir how this formula is formed "RB = 0.2 X RL X hFE"

  • At 28 March 2013, 10:26:37 user Luke wrote:   [reply @ Luke]
    • Hi I was wondering if you could help. I need a latch or flip flop circuit with one push button, but two outputs (bit like your monostable).

      When power is applied the default state should be everything unlatched. Then pressed once, provides output to "1" for a small time period (1 sec). When pressed again should provie an ouput to "2" for a small time period.

      Do you know how to acheive this?


  • At 16 September 2012, 15:20:37 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @John they are 2n2222 but other simple npn transistor should work also.

  • At 14 September 2012, 5:47:01 user John wrote:   [reply @ John]
    • Hello,

      Can you please tell me what type of transistors you use for the RS Flip Flop (RSFF). I tryed multiple general purpose transistors but its not working very well.


  • At 25 May 2012, 23:02:10 user Wael wrote:   [reply @ Wael]
    • Thnx alot for these circuits, but i was wondering what resistors and transistors shall I use for the monostable multivibrator circuit, i need my output to be 6v in order to operate a 6V relay.

  • At 22 March 2012, 7:28:14 user steven wrote:   [reply @ steven]
    • so helpful.thanks a lot

  • At 20 December 2011, 6:25:30 user Kammenos wrote:   [reply @ Kammenos]
    • @jack CE is biased according to the connection type (common emitter/base/collector). As for the ce-diode i'm not sure what you mean, i suppose you mean the resistance? It is a characteristic provided by the manufaturer.

  • At 18 December 2011, 8:39:59 user jack wrote:   [reply @ jack]
    • how do you define collector to emitter diode????
      c to e can not be fwd or rev biased ???

  • At 27 November 2011, 7:26:21 user EsseEmmeErre wrote:   [reply @ EsseEmmeErre]
    • Lord Year 2011, November 27, Sunday

      Hi to all you, here is EsseEmmeErre from Italy! :)
      Thanks for the two outputs astable circuit; I have tested myself but the red and green leds I have used, with a 9V supply, always remain on; I have used two NPN 2N1722 and for the transistor collectors two 56k resistors; maybe these are wrong? :|
      Greetings from Italy, visit my sites:
      xoomer.virgilio.it/aregat - www.esseemmeerre.altervista.org

  • At 27 June 2011, 11:27:03 user Kammenos wrote:   [reply @ Kammenos]
    • @Fung i'm trying to understand your question with no success. Please subscribe to the forum (http://pcbheaven.com/forum/) to post irrelevant questions. There you can upload a photo or a schematic to help us understand. Moreover, there are more people to share opinions.

  • At 24 June 2011, 4:31:05 user Fung wrote:   [reply @ Fung]
    • That transistor is BC328, it drives 6 same segments from different size of displays, such as all the segment B's. 4 displays are large (2.3") which have 4 LEDs in series in each segment; while the remaining 2 are small displays (0.5"), only 1 LED is included in each segment.

      Since it is not possible to drive large displays and make them bright by using 5V, I think that there exist changes of collector voltage when driving different displays. I measured the voltage at a segment of a large display is about 12V, while only about 3.5V at small display.

      Would the collector voltage change to 12V when it is driving large displays and turn to 5V to when driving small displays? Is it possible to do so? Or the collector voltage just keeps on the same level?

  • At 23 June 2011, 19:22:51 user Kammenos wrote:   [reply @ Kammenos]
    • @Fung you get less voltage than expected right? Depending on the transistor, you may get 5 volts.

  • At 23 June 2011, 4:49:29 user Fung wrote:   [reply @ Fung]
    • When a PNP transistor in a circuit is connected to different levels of voltages, ie 12V to the emitter, while 5V (from PIC) to the base via a 470 ohms resistor, what is the voltage at the collector?

      This question relates to a circuit that I am worrying, it is used to drive MUX LED 7-segment displays.

  • At 10 April 2011, 20:58:17 user cryopyro wrote:   [reply @ cryopyro]
    • I got really confused, i figured out my problem. q's 2 & 3 were accidently asked.

  • At 4 March 2011, 6:38:54 user Kammenos wrote:   [reply @ Kammenos]
    • 1)f is frequency
      you are referring to what?

  • At 3 March 2011, 21:44:40 user cryopyro wrote:   [reply @ cryopyro]
    • questions:
      1)what does f represent? i think frequency, but is it?

      2)what should the resistors be if the center ones are 100k?

      3)is there even a difference that should be between the resistors, or are they the same?

  • At 17 February 2011, 7:24:35 user Fung wrote:   [reply @ Fung]
    • I wonder that amplifying circuit examples will be available for buzzers or PIEZO sounders for reference.

  • At 8 December 2010, 19:10:37 user Kammenos wrote:   [reply @ Kammenos]
    • Hi Niko,
      Please excuse me, but i have run completely out of free time these days. I plan to write theories about digital circuits, but right now i have to finish the coffee maker. But tell me something, have you read the theory of 555 timer? In there i explain how the oscillator works. You may get an idea how in general the capacitor-timed oscillators work.

  • At 8 December 2010, 13:22:16 user Nikos wrote:   [reply @ Nikos]
    • Can u explain the Astable Multivibrator circuit and the Monostable Multivibrator circuit further more?
      I would be grateful if you could explain it in greek. I'm new at electronics and I'm trying to understand as much as i can :/

  • At 18 November 2010, 21:52:30 user Kammenos wrote:   [reply @ Kammenos]
    • You need to get a relay with voltage (coil) the same as your power supply. For example, if you use 5 volts, then your relay must also be 5 volts, otherwise it will not work. Also, prefer low current coil relays, no more than 100 mA.

  • At 18 November 2010, 21:32:16 user Hasnat Saeed wrote:   [reply @ Hasnat Saeed]
    • Thanks that was very useful.Even though my knowledge about electronics is very little I was able to successfully implement all of the ciruits shown here.I am not through with the "relay" you've used.What are the specific values of it that can help me getit from the market?.thank you

  • At 13 October 2010, 10:58:36 user Remus wrote:   [reply @ Remus]
    • I see the values of resistors, but I don`t know if this values are good for 12V suply, output and input.

  • At 5 October 2010, 16:59:23 user Kammenos wrote:   [reply @ Kammenos]
    • Remus, click on the image and the circuit will maximize. You will see then the values of the resistors. For transistors, i have test it with the 2N2222 but i suppose that you can use other NPN as well.

  • At 5 October 2010, 10:59:34 user Remus wrote:   [reply @ Remus]
    • Can you tell me how to calculate the values for resistors from the RS-Flip-Flop circuit, and what tranzistor to use. I need VS, R,S to be 12V, also outputs Q1,Q2 to be 12V or very close.

  • At 9 August 2010, 9:15:00 user Kammenos wrote:   [reply @ Kammenos]
    • I really don't know what i was thinking when i was writing this example. I did many mistakes. Sorry... I corrected it. Thanks for noticing.

  • At 8 August 2010, 21:54:59 user Scott wrote:   [reply @ Scott]
    • I don't understand how RB=1300 ohms in the first example. I have tried the formula but never come up with 1300. Please help me understand. Thanks, Scott

  • At 11 July 2010, 20:32:15 user Kammenos wrote:   [reply @ Kammenos]
    • Thanks Denis!

  • At 11 July 2010, 20:25:05 user Denis wrote:   [reply @ Denis]
    • Hi,
      Thank you for the explanations, it helped me a lot.

      But I think you have mistype in the very first example:

      IL = Vs / RL => IL = 12 / 140 = 75mA as far as I can see the problems description the relay resistance is 160 not 140... but the answer is right :)

  • At 29 June 2010, 20:29:05 user Antonio Merenda wrote:   [reply @ Antonio Merenda]
    • complimenti per i circuiti

  • At 28 April 2010, 3:27:06 user dorin wrote:   [reply @ dorin]
    • can you show me some flip flop circuit to be able to use only one push buton to turn on and off please I would be very grateful to you, the switch to act like : one push on one push off from the same push button but with transistors not c.i.

  • At 18 April 2010, 16:36:39 user Jacko wrote:   [reply @ Jacko]
    • Circuits are very useful!

  • At 14 April 2010, 12:02:43 user A.D. Sundaravel wrote:   [reply @ A.D. Sundaravel]
    • The above circuits are very usefull for easy calculation of selection of components. Thank you.

  • At 17 March 2010, 2:10:13 user Gibs Kange wrote:   [reply @ Gibs Kange]
    • Very helpful and handy information.Provided the needed assistance. Thanks alot for the info. Highly recommended.

      N Mapun

    reddit this Reddit this

     HOT in heaven!

    NEW in heaven!

    New Theory: AC electric motor working principle

     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS   

    Site design: Giorgos Lazaridis
    © Copyright 2008
    Please read the Terms of services and the Privacy policy