Stupid transistor question!
I'm hoping that someone can verify that I actually know what I'm talking about.
I went to Radioshack and thinking I had the right ones, bought 15 PNP transistors. When I got home and checked the What's A Microcontroller handbook, I was dismayed to find that the ones used were NPN. I have read through the datasheets of the NPN transistor used in the WAM book (a 2N3904) and the ones I bought (2N3906) and I think I understand the difference but I'm hoping that someone here that understands electrical engineer can translate to english and confirm or deny my thinkings. (FYI: Computer Geek and EE geek are very different! :P )
An NPN transistor is typically used to control ground, like this:
A Load is connected between Vcc and the collector
the Emitter is connected to GND
the load will activate only when the Base goes high, providing the load with a path for the electrons heading to GND.
A voltmeter will register Vcc when connected between Vcc and the collector while the base is high. When the base is low, the voltmeter registers no voltage.
A PNP transistor works opposite, being used to control Vcc.
The load is connected between GND and the Emitter
The Collector is connected to Vcc
The load will activate only when the base goes low (ground maybe?) providing the load with an emitter that is now positive.
A voltmeter will register Vcc when connected between the load and the emitter. When the base is high, the voltmeter registers no voltage.
Is this correct or should I really take the transistors back and swap for some NPN ones? The idea for these is to use the BS2 to control relays that typically use 20mA. The transistors I have says that it will dissipate 300mW. (Does this mean that the load for the transistor can not exceed 300mW or that the transistor uses 300mW?)
Thanks for your help translating engineer to english!!
Added:
A lot of additional datasheets taht I have looked at mention bias. I tried Googling Bias but I get things about speakers and amps, not transistors. Either that or google hates me. What is bias and what do I need to know about it to work with transistors?
Thank you all again!
Post Edited (firestorm.v1) : 5/20/2007 4:50:36 AM GMT
I went to Radioshack and thinking I had the right ones, bought 15 PNP transistors. When I got home and checked the What's A Microcontroller handbook, I was dismayed to find that the ones used were NPN. I have read through the datasheets of the NPN transistor used in the WAM book (a 2N3904) and the ones I bought (2N3906) and I think I understand the difference but I'm hoping that someone here that understands electrical engineer can translate to english and confirm or deny my thinkings. (FYI: Computer Geek and EE geek are very different! :P )
An NPN transistor is typically used to control ground, like this:
A Load is connected between Vcc and the collector
the Emitter is connected to GND
the load will activate only when the Base goes high, providing the load with a path for the electrons heading to GND.
A voltmeter will register Vcc when connected between Vcc and the collector while the base is high. When the base is low, the voltmeter registers no voltage.
A PNP transistor works opposite, being used to control Vcc.
The load is connected between GND and the Emitter
The Collector is connected to Vcc
The load will activate only when the base goes low (ground maybe?) providing the load with an emitter that is now positive.
A voltmeter will register Vcc when connected between the load and the emitter. When the base is high, the voltmeter registers no voltage.
Is this correct or should I really take the transistors back and swap for some NPN ones? The idea for these is to use the BS2 to control relays that typically use 20mA. The transistors I have says that it will dissipate 300mW. (Does this mean that the load for the transistor can not exceed 300mW or that the transistor uses 300mW?)
Thanks for your help translating engineer to english!!
Added:
A lot of additional datasheets taht I have looked at mention bias. I tried Googling Bias but I get things about speakers and amps, not transistors. Either that or google hates me. What is bias and what do I need to know about it to work with transistors?
Thank you all again!
Post Edited (firestorm.v1) : 5/20/2007 4:50:36 AM GMT
Comments
on 5 volts, then either NPN or PNP transistors will work.
However, if the relays require 12 volts, then you are better off
using NPN transistors. This is because you can connect the Stamp
output pin to the base of and NPN (using a series resistor to limit
the Stamp output current). Then tie the emitter of the NPN to
ground. Connect one end of the relay to the collector of the NPN
and the other end to whatever supply voltage the relay needs.
Current flow in NPN devices is from collector to emitter. That's
why you connect the emitter to ground.
In PNP devices the current flow is just the opposite, from emitter
to collector.
Your description of an NPN is okay, but the PNP description is
backwards. It should read:
"The load is connected between GND and the Collector.
The Emitter is connected to Vcc."
When operating transistors as switches, you can ignore bias issues.
They only come into play if the transistor is used as an amplifier.
For more info on biasing, try googling "transistor bias"
With regard to the power dissipation part of your question, the
300 mw rating applies only to the transistor itself and not the load.
Hope this begins to answer your question.
phil
Post Edited (phil kenny) : 5/20/2007 5:27:16 AM GMT
Then, later on - I wanted to use a comparator so that my thermostat might control a relay.· It took me a while to discover that the LM339's output's strongest force was when it was at ground potential, as its positive potential was weakened by any pull-up resistor that must be supplied there...· .· Here was a perfect use for the "upsidedown" PNP transistors that I had never used before.
· (oops! - I used "open collector" in the drawing...· perhaps I meant "open drain" --- what actually happens is that when the LM339's output is not being pulled to ground... it floats to wherever the output circuitry takes it to...)
>>> Firestorm:· if what you are controling uses the same five volts as the stamp you are using to control it with --- you may certainly use those PNP transistors.· They would·conduct when current flows - when the stamp provides a·zero (0 volts) at the base, and would·not conduct when the stamp provides a one (5 volts).· what the transistor does (in the case of a relay) is allows you to control a large current with a very small one.
Post Edited (tommy) : 5/21/2007 8:17:40 AM GMT
After reading about the PNP transistors, I didn't want to be locked into a single Vcc so I went ahead and went to Radioshack and swapped them out with some NPN transistors. As I figure, it's easier to switch GND then it is Vcc, especially if Vcc is a different voltage than the BS2.
So now for more questions:
1: I am thinking of controlling a relay with the 2n3904 transistor. This is more of a question of datasheet interpretation than connecting the device. The datasheet says the transistor has the following characteristics:
VCEO Collector-Emitter Voltage 40 V
VCBO Collector-Base Voltage 60 V
VEBO Emitter-Base Voltage 6.0 V
IC Collector Current - Continuous 200 mA
If I am reading this correctly, the load from Vcc to collector is the Ic and that is the total amount of current (amps) that can go through the transistor. I have a 20mA relay so I am well within spec (by a factor of 10.)
The VEBO means that the voltage should be a positive voltage (Vcc) but no more than 6V (the BS2's regulator will work fine).
The VCEO is the voltage going through the transistor to GND and it can not exceed 40V. (I'm only working with a 5VDC relay, so this isn't an issue).
2: On page 264 of the WAM book, the schematic and next circuits show two 100K resistors between the IO pin and the transistor. What is the purpose of these resistors?
Again, thank you very much for your time and help. This is ensuring I don't blow up my BS2 experimenting with it.. [noparse]:)[/noparse]