Transistor questions
firestorm.v1
Posts: 94
I'm really a newbie when it comes to the world of TTL and power requirements. What I am trying to understand is how a transistor works. I understand that there is a base, collector and emitter as shown in the "What's a Microcontroller" manual but what confuses me is the wiring of the device.
From what I can tell, the emitter is always connected to ground, the base is the "trigger" and the collector goes ground when voltage is applied to the base (i.e. a light connected to the collector and GND will not light, but a light connected to the collector and +5V or +12v will light assuming that I have not exceeded the power limits of the transistor)
I am reading the datasheet for the included 2n 3904 transistor at www.fairchildsemi.com/ds/2N%2F2N3904.pdf and just to verify that I'm reading this correctly, I can pull a maximum of 40VDC and 200mA through the transistor's Collector/Emitter pins as long as the voltage I put through the base to the emitter does not exceed 6VDC. Is this correct? If that's the case then I can run the basic stamp off of a 5V power supply and as long as the 5V and the 12V have a common ground, I can use the transistor to switch ground coming from a 12v power supply?
On page #265 of the "What's a Microcontroller" book there are two 100K resistors between the base and the IO pin on the Bs2. What is the purpose of these pins?
According to the chapter 9, first activity (on p263-265) of the WAM book, the voltage that goes into the base, affects how much voltage goes through the collector-emitter. Is there a formula for this ratio? Looking at the datasheet the base's max voltage is 6VDC, and the collector/emitter is 40VDC so obviously it's not a simple 1::1 ratio. Any hints on where I can find this ratio?
The transistor used in the book is an NPN transistor, What are the effects of a PNP transistor?
Thank you for helping me understand.. [noparse]:)[/noparse]
From what I can tell, the emitter is always connected to ground, the base is the "trigger" and the collector goes ground when voltage is applied to the base (i.e. a light connected to the collector and GND will not light, but a light connected to the collector and +5V or +12v will light assuming that I have not exceeded the power limits of the transistor)
I am reading the datasheet for the included 2n 3904 transistor at www.fairchildsemi.com/ds/2N%2F2N3904.pdf and just to verify that I'm reading this correctly, I can pull a maximum of 40VDC and 200mA through the transistor's Collector/Emitter pins as long as the voltage I put through the base to the emitter does not exceed 6VDC. Is this correct? If that's the case then I can run the basic stamp off of a 5V power supply and as long as the 5V and the 12V have a common ground, I can use the transistor to switch ground coming from a 12v power supply?
On page #265 of the "What's a Microcontroller" book there are two 100K resistors between the base and the IO pin on the Bs2. What is the purpose of these pins?
According to the chapter 9, first activity (on p263-265) of the WAM book, the voltage that goes into the base, affects how much voltage goes through the collector-emitter. Is there a formula for this ratio? Looking at the datasheet the base's max voltage is 6VDC, and the collector/emitter is 40VDC so obviously it's not a simple 1::1 ratio. Any hints on where I can find this ratio?
The transistor used in the book is an NPN transistor, What are the effects of a PNP transistor?
Thank you for helping me understand.. [noparse]:)[/noparse]
Comments
The 100K resistors in series with the transistor bases are used to limit the base current to prevent the transistor from being destroyed or the I/O pin circuitry from being damaged. Functionally, the base-emitter junction is just a forward-conducting diode and has no inherent limit to the amount of current than can flow (it's a low resistance). Most CMOS outputs are very happy with currents up to 10-20ma and, with a 5V supply, a 220 to 470 ohm resistor works just fine. For most uses, you don't need that much base current, so a higher resistor saves on power (100K gives about 50ua).
The gain of a transistor is specified as hFE and is a ratio of currents rather than voltage. For an hFE of 10, a current into (or out of) the base of 10ma results in a collector current of 100ma. This is actually not very useful since, for most transistors used for switching like the 2N3904, it is specified as a minimum gain and, as you can see from the datasheet, varies somewhat with current and supply voltage.
A PNP transistor is the inverse (polarity-wise) of an NPN transistor. The emitter gets connected to a positive supply, the collector switches to the positive "ground", and the direction of the current that causes conduction is reversed. For practical purposes, a PNP switching transistor is usually used to connect something to the positive supply rather than ground, and is activated by connecting the base to logic zero.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
To make sure I understand, the BS2 doesn't do anything current-wise when connected to the base except to connect it to Vdd. The two resistors draw the current through the base lead on the transistor which in turn allows a proportinate amount of current through the collector down into the emitter, on to Vss.
Now, my next question.
How do I figure out how many mA that a resistor pulls? I would assume that if I connected 300some resistors to a pin of the Bs2 and Vdd then brought hthe pin low I'd blow it.. :P I know that the bs2 pins have a sink/source rating in mA but darned if I can't find it. I'm messing with transistors and things now and I don't want to exceed the power limitations of the hardware. [noparse]:)[/noparse]
Thanks again for the info!
This is very very basic. Keep in mind that an I/O pin doesn't get switched exactly to 5V or 0V for a logic high or low. For I/O currents up to maybe 20ma and a 5V power supply, the high voltage is about 4.3V and the low voltage is about 0.6V. For example: You want to have 10ma go through an LED when the I/O pin goes high. The high voltage is about 4.3V, the voltage drop across the LED is about 1.7V leaving 2.6V to drop across the resistor. At 10ma (0.01A), the resistor should be: R = 2.6 / 0.01 or 260 ohms. The closest standard value is 270 ohms. There you go.
How do I find out the voltages that various components use? You mentioned an LED dropping 1.7v. Is there a way I can test this using a voltmeter without damaging the component? One of the projects I may be designing is a switch array that Chris Savage posted in another forum, using RCTIME to create a switch resistor network using push buttons in order to conserve IO pins.
That will help greatly, now if I didn't suck so bad at math, I'd have something.. :P
I think you need to get a book on basic electronics and maybe one on algebra.
These will help you be better understand component data sheets.
There are several people on this form to help you understand the basics.
Good luck,
radiodiver
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Chris Savage: When the pin goes high by the BS2 doesn't that connect it to Vdd?. The resistors in the Bs2 and the two resistors give the transistor the current draw that the transistor is looking for, correct? I had tried initially to find transistor tutorials, but my search wasn't as fruitful. I'll try it again.
I feel really stupid but I have forgotten what current is... :P I know that current is amps and some other basic information, but I am not confident that I know enough to start messing with transistors.
Thank everyone for your patience. I really appreciate it.