Thursday, March 18, 2010

Transistorized...

Aah, the transistor. Where would we be without it? For starters, I wouldn't be sitting on the couch writing this post. The computer would be a bit too big and expensive for that, what with all the vacuum tubes it would take to make it work. As it is there's far more processing power in my laptop than there was on the Apollo space capsule that put men on the moon, thanks to the transistor.

But what is a transistor, exactly? A transistor is a semiconductor that allows a low current to control a much higher current. (I'm not going to go into what exactly a transistor is, 'cause it's boring.)

I'm going to limit this post to basic bi-polar junction transistors, although the basics apply across many other types of transistors as well. Transistors can be used to amplify current, or be used as a switch. For the circuits I'll be building for my haunt the transistors will be primarily used as switches, so that's what I'll focus on here.

There are two types of bpj transistors - PNP & NPN. This refers to the polarity of the junctions in the transistors, and determines how they are connected and used.



Transistors have three connections - the base, emitter, and collector. In a NPN transistor, a small amount of current applied to the base allows a larger current to flow from the collector to the emitter and on to ground.



Power is connected to the load, and the negative connection of the load connects to the collector of the transistor. A small current applied to the base allows the current to flow from the collector through the emitter and on to ground, completing the circuit.

In the above diagram you'll notice a couple of resistors. The resistor between the base and the trigger source is vital to the longevity of the transistor. The connection between the base and the emitter has very low resistance, and when power is applied to the base the connection is close to a short circuit. This would cause what's called "thermal overrun" (a fancy way of saying the transistor would get really hot).

OK, great. So we need a resistor, but how do we know what resistor to use? Too much resistance and the transistor won't reach saturation and pass the full amount of current needed, too little resistance and too much current passes through the transistor and it burns up. Never fear, there's a way to figure it out, & all it takes is a little math (you know, the stuff we learned in school that we never thought we'd need to know...)

When you look at the specifications of a transistor, you'll see DC collector current and hFE. The DC collector current is the highest sustained current that the transistor can handle, and the hFE is the forward current gain (not sure why they call it hFE, but if they called it fcg we haunters might confuse it with a flying crank ghost.) To figure out what value resistor we need, we have to figure out how much current the base requires for the transistor to reach saturation. This is simply the DC collector current divided by the hFE. So for example, if we have a DC collector current of 5 amps and a hFE of 1000, the base current would be .005 amps, or 5 milliamps. To ensure saturation it's a good idea to increase this a bit, so we'll multiply the base current by 1.2 in our final calculation. To find our resistor value we go back to Ohm's law - V/I = R. Assuming we're dealing with a 12 volt circuit, our calculation would be 12/(5 / 1000 * 1.2) = 2000, or 2K ohms.

The other resistor in the circuit isn't critical, but can help if you have erratic switching. In the case of the NPN circuit the resistor is considered a pull-down resistor. It's job is to hold the base low when no trigger voltage is present. The value of this resistor isn't critical, but should be significantly higher than the base resistor. A good rule of thumb is to multiply the base resistor's value by 10 for the pull-down resistor's value.



A PNP transistor is similar to the NPN, but instead of applying current to the base to trigger current flow, you apply ground.



In this case power is applied to the emitter, and when the base is grounded current passes through to the collector and into the load.

The resistor calculations are the same, but in this case the second resistor's job is to hold the base high when the transistor isn't triggered (called a pull-up resistor in this case).

Transistors are very versatile - you'll be hearing about them a lot in the future. Unless of course you get sick of my ramblings and quit reading...

7 comments:

  1. Sorry I missed this post! I don't know how that could have happened. I always look forward to these!

    Great post, really helpful information. I am really looking forward to more of your detailed posts. I think this is a great resource for the home haunter!!

    Cheers!

    ReplyDelete
  2. What factors are involved to determine whether you should use NPN vs PNP?

    ReplyDelete
  3. Wow Rob, I'm really sorry I missed your comment.
    The decision to use a PNP or NPN really depends on the circuit you're using it in, and how you need to activate that circuit. Easiest way to remember it is to look at the middle letter - if you're triggering your circuit with a positive voltage you'd use an nPn, but if you're using a ground (negative) to trigger it, you'd use a pNp.

    ReplyDelete
  4. Is the pull-up/pull-down resistor in series or parallel with the base resistor when calculating the base current?
    I understand that it doesn't matter if the base resistor is much larger, but want to understand the effect.
    Thanks!

    ReplyDelete
  5. The pull up/down resistors are in parallel with the transistor, not base resistor. As long as you don't go with too low a value with the pull up/down resistor - say 10K or so - you shouldn't need to consider it's value at all in your calculations for the base resistor. You also don't want to go too high, either. If you go above 100K or so you could end up with a weird capacitance effect that can slow down the switching. I gave a rule of thumb at 10 times the value of the base resistor, but for most simple switching circuits I'll just throw in a 47K resistor and not worry about it. Remember too that a pull up/down resistor isn't always necessary. Unless your circuit is such that something might be damaged if it miss fires, I'd say try it without the pull up/down resistor first & add it later if needed.

    ReplyDelete
  6. Great post, thanks for the information! I like you blog and bestowed upon you the "Liebster Blog Award". Have a nice evening.

    ReplyDelete
  7. Thanks! I don't post here as often as I'd like, but I do try to add something every now and then.

    ReplyDelete