connecting transistors

Discussion in 'The Projects Forum' started by gerases, Nov 21, 2012.

  1. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Hi,

    I have a simple for you guys question. Take a look at this:

    http://examples.oreilly.com/9780596153755-files/mkel_04/mkel_04_035.pdf

    IC3 is a 4026 (CMOS decimal counter) and IC4 is a common cathode 7-segment digit display (a package of 3 by Kingsbright).

    The output from the 4026 enough to drive the digit segments but could be brighter. The author suggests a transistor.

    The question I have is basically where each leg of the transistor would go. I understand that the output of the 4026 would go to the base, but I can't figure out where to connect the collector and the emitter, since the load, in this case is 1 pin of the display. I know it's obvious to you, but I can't figure it out.

    For example, pin 13 of IC3 goes to pin 4 of IC4. How do I connect a transistor between those two?

    Thanks!
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,101
    3,036
    You typically use an NPN transistor to complete the path to ground for the "power" circuit. Its emitter is connected to ground and the collector to the low side of the load. As you said, signal to the base.

    Bah, ignore that. Your situation is a bit different. I think you need to use a PNP to switch the high side. But this will reverse the logic; the signal going low will turn ON the power to the load. This is easy enough to fix with another transistor or inverter if you need to.

    Since you will be using a lot of transistors, consider an array such as ULN2803. This is multiple transistors on a single IC. Saves a lot of hassle.
     
    Last edited: Nov 21, 2012
  3. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Hmm, sorry, don't quite get it. See, the collector and the emitter should be somehow connected to both the ground and the positive of the power supply as well as 1 pin. And that's what I have trouble imagining. Ignoring the PNP vs NPN issue, what would it look like?

    What does "switch the high side" mean? Does it mean to switch "on the rise of the voltage" instead of the "fall of the voltage"? But won't the transistor turn off when the current on the control pin is completely 0?

    Cool! Thanks for the tip, I was wondering about 40 or so transistors on the breadboard :)

    I'm looking at the datasheet for this bad boy. How would I connect 1 pin of the source and one pin of the
    destination using this?

    P.S. I think I get it: ground to 9, + to 10. Each output to pins C.0 - C.7 and each corresponding output pin goes to my input pins.
     
    Last edited: Nov 21, 2012
  4. wayneh

    Expert

    Sep 9, 2010
    12,101
    3,036
    The usual way to use a transistor as a switch is either a PNP between V+ and the load (high-side switch) or an NPN between the load and V- (low-side). The former turns on when the base voltage is pulled below V+ (minus 0.65V), the latter when the base voltage is pulled above V- (plus 0.65V).

    I believe what you need is to turn on the power high-side when your signal goes high. Neither "normal" configuration described above will do this. You need to reverse the logic, so that you apply a low voltage to the base of a PNP when your signal goes high. There are a lot ways to invert the logic, but I'm not sure what the best would be. A hex inverter IC comes to mind, but maybe someone will have a better idea.
     
    gerases likes this.
  5. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Use NPN transistors as emitter-followers if the supply voltage is high enough.
    Is IC4 the 7-segment display?
    Are resistors R4, R5 and R6 current-limiting resistors for each digit? Then the brightness of the digit will change when a different number of segments are lighted. Each SEGMENT should have its own current-limiting resistor.

    Your switch contacts will bounce each time the pushbutton is pushed so the counting will be erratic. You need a debounce circuit to feed the clock input of the counter.
     
    gerases likes this.
  6. KrisBlueNZ

    Member

    Oct 17, 2012
    111
    14
    Yeah, what Audioguru said. Exactly.

    A more detailed explanation is: use an NPN transistor e.g. BC547B or 2N3904 on each segment output. Connect the 4026 output to the base, connect the collector to the positive supply, and connect the emitter through a current-limiting resistor to the anode of the segment (with the common cathode of the display connected to ground).

    Sorry, I couldn't make much sense of the PDF. Looks like part of it was missing.
     
    gerases likes this.
  7. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Sorry for a late reply. Thanksgiving and all.

    Sweet, exactly what I needed. The PDF is indeed incomplete, it's the a portion of the schematic only.

    Yes.

    Yes.

    Right again, and the author talks about it, but he decided to simplify the circuit for test purposes.

    Yes, good catch. The final circuit replaces the switch with a 555 in astable mode.

    Can you explain in general when to use an emitter-follower configuration?
    Thanks, you guys!
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,101
    3,036
    I mentioned two "normal" transistor switch configurations earlier, an NPN as a low side or a PNP as a high side. An NPN emitter-follower retains the signal's logic sense using an NPN as a high-side switch. The only negative is that the base of the transistor must be driven up to very near the power supply voltage. That's sometimes a problem but otherwise an emitter-follower is a fine solution in a scenario like your's where you need to switch the power V+ instead of the V-.
     
  9. KrisBlueNZ

    Member

    Oct 17, 2012
    111
    14
    The emitter follower, or common collector, configuration is used when you want current gain but no voltage gain. If you apply a signal to the base, it is reproduced at the emitter with (almost) exactly the same amplitude (in terms of voltage).

    There is a DC voltage shift between the input and the output, equal to the base-emitter voltage of the transistor (around 0.7V for small-signal cases); the emitter voltage is lower than the base voltage by this amount. (For the NPN version.)

    An emitter follower circuit has a current gain equal to the current gain of the device, which is typically 100~300 for small-signal transistors and much less for power transistors. (Actually, current gain + 1, to be pedantic.) It has a relatively high input impedance (low input current) and a low output impedance (high output current).

    It is useful for driving low-impedance loads or acting as a unity-gain BUFFER.

    Here's a basic description of how it works. A bipolar transistor responds to base current, which flows when the base is brought positive (for the NPN case) relative to the emitter by the base-emitter junction forward voltage. When the base-emitter voltage difference reaches this voltage, base current starts to flow, and the transistor starts to turn ON, and conduct current in its collector-emitter path. Since its collector is connected to the positive supply rail, this causes the transistor to pull its emitter voltage up. As it does this, the base-emitter voltage decreases and the transistor tends to turn off. The transistor immediately reaches an equilibrium where the base current and the collector-emitter current are in proportion to the transistor's current gain, and the emitter voltage is equal to the base voltage minus the base-emitter forward voltage. As the base voltage is moved up and down, the emitter voltage FOLLOWS it, always with a difference equal to the base-emitter forward voltage. Hence the name "emitter follower".

    This description applies when the transistor is used as a linear device. In your application, the base is fed from a logic output, which is either high or low, so the emitter will be either high or low as well, minus the base-emitter voltage. But the important factor is that nearly all of the emitter current actually flows through the collector-emitter path, from the positive supply rail. The current that flows into the base, from the logic IC output, is tiny in comparison (because of the current gain of the transistor). All the base current does is provide enough bias to turn the transistor ON, so that it can supply the main load current through its collector-emitter path.

    So the emitter follower presents almost NO load to the device driving it, and can provide significant current to the load that it drives.

    There are equivalent configurations for MOSFETs and JFETs (source follower) and valves/tubes (cathode follower). These differ in terms of the DC voltage difference between the input and the output, but operate in the same way.

    An important feature of the emitter follower in this application is that it is non-inverting. That is, when the IC output goes high, the emitter goes high too, and lights the LED in the common-cathode display. If you wanted to use a common-emitter switch (the most common configuration) with this common-cathode display, you would have to add an extra stage of inversion, since you would have to use PNPs to drive the segments, and the 4026 outputs are active high (high turns a PNP common emitter switch OFF, not ON).
     
    Last edited: Nov 26, 2012
    gerases likes this.
  10. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Wow, thanks, KrisBlueNZ! Great explanation, thank you so much for the time.

    I don't know so much.

    Let me step back a bit.

    1. I need positive voltage for my segments.
    2. To supply positive voltage to my load through a transistor I have two options:

    a) a PNP transistor with an inverter because a PNP transistor turns on when the base-emitter voltage is low while I need the opposite.

    b) an NPN transistor with the load connected to the emitter where I could "collect" the needed positive voltage.

    Sweetness. Thanks!!!

    P.S.:

    What is the device driving the emitter in this case?
     
  11. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    One more question and Audioguru mentioned reminded me about it. Why do I need a separate current limiting resistor on each segment of the display rather than on the common cathode?

    Like I said in my post, the author talks about it, but I actually didn't understand why the difference would occur.
     
  12. KrisBlueNZ

    Member

    Oct 17, 2012
    111
    14
    No problem :)

    Nearly. I didn't explain that part very thoroughly.
    This option uses a PNP transistor in common emitter mode, working from the positive supply rail. That means the PNP's emitter is connected to the positive supply, and the collector feeds through a current limiting resistor to the anode of the display.

    A PNP transistor is biased ON when its base current is NEGATIVE (the opposite of an NPN), which happens when the base is more negative than the emitter. In this arrangement, the PNP will be biased ON when its base is pulled downwards towards 0V (with a current limiting resistor in series with the base), and will be turned OFF when the base voltage is equal to the positive supply voltage.

    That is the exact opposite of what you want. The 4026's outputs are active-high so you want the transistor to turn on and illuminate the LED when the 4026 output is high. The PNP will give you the opposite behaviour. So you need an inversion stage. You can use an inverting gate IC such as a 4069, 4049, 40106/4584 (all inverter gates) or a 4001 or 4011 or other gate IC that can invert. Or you could use a transistor. Either way is a hassle.

    That's right, but it's just a coincidence that the collector is named that way.

    The transistor itself drives its own emitter. When the base is brought positive, the transistor conducts current in its collector-emitter path, i.e. current flows from the positive supply rail, into the collector, and out the emitter.

    If you use a single current limiting resistor to set the LED segment current at (for example) 20 mA, that's fine if only one segment is lit, but if two segments are lit, that 20 mA is split two ways, and each segment will only light half as brightly as it should.

    Also slight variations in characteristics of the driver transistors and the segment LEDs could cause the current to be split unevenly. I won't go into details.

    But the main reason is that a single resistor limits the TOTAL current, which must be split between all the segments that are lit.
     
  13. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Sorry, I was punning. I should have indicated that in the message.

    Thanks one more time for the great explanation!
     
  14. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Silly question: can we use an NPN in this case and connect it as follows:

    emitter to ground, collector to common cathode, anode to +?
     
  15. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Then when the output of the counter IC goes positive it TURNS OFF the transistor and LED. Then the LEDs are DARK emitters instead of light emitters.
    Do you notice that a common-emitter transistor INVERTS the logic?
     
  16. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Dark emitters, heh? It's funny, i'll give it to you.

    I thought I needed an inverter with a PNP? You're saying an NPN with in the emitter-follower setup will work, but moving the LED on the collector won't? Why?
     
  17. KrisBlueNZ

    Member

    Oct 17, 2012
    111
    14
    Because you're using a common cathode display. With a common cathode display, you connect the commoned cathodes to 0V (negative rail) and drive the anodes individually with a positive current (from a positive voltage) to turn them ON.

    So you need a driver arrangement that switches the positive rail. This can either be an NPN emitter follower (which doesn't really "switch"; it just "follows" the logic-level output from the 4026 with a small voltage drop), or a PNP common-emitter driver with its emitter connected to the positive rail.

    If you had a single LED, you can (and often would) use an NPN in the common emitter configuration with the LED in the collector path. The connections would be: emitter to 0V; base driven from 4026 output via a base current current limiting resistor; positive supply rail to anode of LED; cathode of LED through an LED current limiting resistor to the collector.

    When the 4026 output goes high, current flows through the base current limiting resistor into the base, and the transistor conducts current in its collector-emitter circuit, illuminating the LED. The polarity is correct without any inversion.

    You could use that configuration if you had a common-anode display. But it uses two resistors per segment instead of just one for the emitter follower.
     
    gerases likes this.
  18. gerases

    Thread Starter Member

    Oct 29, 2012
    177
    2
    Kris, thanks for the explanation. A couple questions and please bear with me -- I'm a complete, but very curious, amateur:

    This is just theoretical discussion: if I were reckless enough and used the common-emitter arrangement with a commoned-cathode device, what would really change? Isn't a commoned-cathode LED display just a collection of LEDs joined at the cathode? The operation of the NPN transistor wouldn't change either. It would get biased (through the base) on a high impulse of the 4026 and it would let much more current to pass through a particular LED? I would just connect the collector of each transistor (for each segment) to the common cathode and the anode of each LED to the VCC. Will it not work at all?

    Got it. By the way, does it matter if the current limiting resistor of the LED is placed before or after the LED? I've seen it both ways and I'm wondering if it matters.
     
  19. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    A resistor in series with an LED is exactly the same as an LED in series with a transistor. They are in series so the current is the same.
     
  20. KrisBlueNZ

    Member

    Oct 17, 2012
    111
    14
    No problem. I'm happy to help because I know you want to learn. Many people on these forums (and more so on electronics point, where I mostly hang out) just want someone to design their circuit, or write their firmware, for them. But "teaching a man to fish" is rewarding, whereas "giving him a fish" isn't.

    No, it won't work at all. All the LEDs in the display have their cathodes connected together. If you connect all the anodes together, then all the LEDs are in parallel, so they'll ALL light at once!

    If you connect all the collectors together, then whenever ANY transistor turns ON, there will be a path to 0V and ALL the LEDs will light. You would lose the individual control of the segments.

    It will work the same either way, because components in series can be connected in any order, in the same way addition is associative (3+2 is the same as 2+3).

    But in practice there may be a reason for doing it the way I suggested - the LEDs may be on a separate board from the driver, and by connecting all the anodes to the positive supply rail, you have the option of connecting them all togther on the display board and having a single wire bringing the positive supply rail to the display board.

    If you do it the other way, you would need two wires from the control board to the display board for each LED, rather than one wire for each LED plus a single wire for the positive supply rail, or you would have to put the current limiting resistors on the display board (which you might do anyway).

    It's just a tidiness issue. There may not be a right way and a wrong way, but that doesn't mean there can't be a better way and a worse way, or a tidier way and a less tidy way :)
     
    gerases likes this.
Loading...