Transistor types

Grumpy_Mike:

5v triggering voltage

There is no such thing as a 5V triggering transistor.

There is if we include MOSFETs ...

OK...from all your answers comes up some new Q's:
1.) If transistors switched ate 0.7v,then in order to control it with arduino i just need to write to the base leg\pin HIGH value? or is too much 5v for the base to handle?
2.) What is the difference between NPN and PNP? searched Youtube and looked at some videos-couldn't find adequate explanation and the one on Wiki is a little bit complicated for a begginer like me
the one thing i do understand is the one of them is 'switched on'(=connecting the collector and emitter like a switch) when the voltage on the base is high and the second one is switched on when the voltage on the base is low

Did you look at:

1.) If transistors switched at 0.7v,then in order to control it with arduino i just need to write to the base leg\pin HIGH value? or is too much 5v for the base to handle?

npn like 2n2222
Yes. Arduino pin high to resistor 1000 ohms to base of npn transistor. Emitter grounded. Collector to load.

5v is not too much across the 1000 ohm resistor to base. Base is at about 0.8v.
Resistor has about 5.0 - 0.8 = 4.2 volts

2.) What is the difference between NPN and PNP?

npn has emitter grounded
pnp has emitter at 5 volts

npn base at 0mA for off
npn base at 1mA for on

pnp base at -0mA for off
pnp base at -1mA for on

npn collector has voltage above emitter
pnp collector has voltage below emitter

read the links

searched Youtube and looked at some videos-couldn't find adequate explanation and the one on Wiki is a little bit complicated for a begginer like me
the one thing i do understand is the one of them is 'switched on'(=connecting the collector and emitter like a switch) when the voltage on the base is high and the second one is switched on when the voltage on the base is low

Sorry for repeating the information in the last post but this might be a bit more palatable packaging of the facts.

1.) If transistors switched at 0.7v,then in order to control it with arduino i just need to write to the base leg\pin HIGH value? or is too much 5v for the base to handle?

A resistor between the pin and base will make it compatible. The resistor does not reduce the voltage as some beginners think, it limits the current which in turn causes a voltage to be dropped across the resistor. This is not the same thing.

2.) What is the difference between NPN and PNP?

A PNP is often called an upside down transistor. You use it to switch things on where you need a source of power, that is you switch the positive. This is called current sourcing.

By contrast an NPN transistor switches the negative, it connects the load to ground it provides a sink for the current. This is called current sinking.

Most of the time it doesn't matter if you control something with sinking or sourcing, but occasionally it does. So normally you would use an NPN but if you mush have current sourcing you use a PNP.

Kimkash, I cannot stress enough how important it will be to you to read up on those links that LarryD gave you. There are many kinds of transistors. People generally, but not always, mean Bipolar Transistor when they say Transistor. But it is bad form not to specify, it makes it more difficult for people to help you.

For instance, a MOSFET does not require a resistor between the Arduino and its Gate. However, MOSFETs have a large Gate capacitance so if you are trying to use the PWM Analog output of an Arduino to drive it, you may find it gets hotter than you'd thought as it takes time to turn on and off.

A bipolar transistor does require a current limiting resistor from the Arduino pin to the Base lead. You do need to take Beta (current gain) into account, especially when switching larger currents. Bipolar transistor gain goes down when saturated, so with a rated Beta of 100 you might find that you need 1/20th to 1/10th the current going into the Base.

polymorph:
For instance, a MOSFET does not require a resistor between the Arduino and its Gate.

Yes it does, and for the same reason as a BJT, ie. to stop more than 40mA coming out of the Arduino pin.

polymorph:
Bipolar transistor gain goes down when saturated,

No?

polymorph proposed this advice: "a MOSFET does not require a resistor between the Arduino and its Gate."
The following calculation was done to confirm or refute that advice:
2nF gate capacitance on MOSFET is common (2000pF)

Assume 3.6ns rise time for Arduino output

i = c dv/dt
i is current from Arduino = 2.8 amps

c = 2x10^-9 F
dv = 5 volts
dt = 3.6x10^-9 seconds rise time

rise/fall time 3.6ns for SPI pin Atmega328P data sheet page 321

i = (2x10^-9) x 5 / (3.6x10-9) = 2.8 amp

data sheet

https://www.sparkfun.com/datasheets/Components/SMD/ATMega328.pdf

You don't really think an Arduino can source 2.8A, do you?

Look in that PDF, Pg 340, 27.1.8 Pin Driver Strength. In that section, on Pg 341, see the graph Figure 27-24. I/O Pin Output Voltage vs. Source Current(VCC = 5 V). It only tells part of the story, but if you assume that output current sourcing is linear, then with 4.5V @ 18mA of source current, that would extrapolate to about 180mA max in the initial short-circuited state when an uncharged 2nF capacitor is connected and the output is set to High. Since this decays from 180mA (or whatever the short circuit current max is) to 0mA as the 2nF Gate capacitance charges, you'll get a much longer rise time.

This link seems to explain it:

I should also point out that while you -can- connect many MOSFET gates directly to an Arduino output, it would be a better idea to use a driver circuit. Because the maximum rated current output of an Arduino is 40mA at any one pin, and driving into a 2nF capacitance is going to cause charge and discharge pulses significantly higher than this. Your Arduino may keep working, but that doesn't mean it is a good idea or that it is not damaging it.

We seem to be illustrating my point nicely: Read those links that LarryD posted. There is a lot more to know about transistors than can be imparted in a few posts on a forum.

Grumpy_Mike:

polymorph:
Bipolar transistor gain goes down when saturated,

No?

Perhaps more accurately stated:

If you require 100mA with an NPN bipolar transistor as a saturated switch, with a rated Beta of 100, it would be unwise to drive the Base with only 1mA of current. Beta varies with time, temperature, and from transistor to transistor. So I would always overdrive the transistor a bit.

Again, this goes back to my point that the original poster really needs to check out LarryD's links.

Thank you all for the comments and help,i found what i needed and those links are very helpful for the future!

fungus:

polymorph:
For instance, a MOSFET does not require a resistor between the Arduino and its Gate.

Yes it does, and for the same reason as a BJT, ie. to stop more than 40mA coming out of the Arduino pin.

Not always. Mostly in high frequency situations (such as PWM, but not limited to this) and only usually with those MOSFETS that have fairly high capacitance gates. For most situations where you just want switch on and off a device now and then, there is usually no need for a gate resistor.

For instance, the gate capacitance of a 2N7000 is 20pf. If an AVR could not drive 20pf without using a current limiting resistor they wouldn't be very useful, would they? The internal resistance of the output circuit of an AVR would be enough to limit the average current into 20pf to under 40ma under almost any imaginable application.

Something like a FQP50N06 might be a whole different story. With a gate capacitance of about 1200pf you would possibly need a resistor for PWM or other such continuous medium to high frequency applications. But even it should not require a gate resistor for occasional on/off operation, like turning a relay, motor, solenoid or lamp fully on or off when required. Taking a look at the specs of the AVR, and given that the output resistance of the AVR is about 25 ohms (at 5V) then the time to charge the gate of the FQP50N06 would be about 30ns. So, the current would likely never exceed and average of over 40ma for the 30ns. I guess this could be tested by actually measuring the current into the gate at various frequencies.

One thing I did notice in the ATmega328 specsheet that seems a bit odd. they quote the clock period correctly at 50ns when running at 20mHz, but say that the clock rise an falls times are 500ns each. Wouldn't that mean the max clock frequency would be 1mHz? Odd. Must be an error.

BillO:
For instance, the gate capacitance of a 2N7000 is 20pf. If an AVR could not drive 20pf without using a current limiting resistor they wouldn't be very useful, would they?

No, but that's a 2N7000 is a tiny little MOSFET that can't even handle the same current as an average BJT. TO220 size logic-level MOSFETs (the kind most breadboarding people will use) have a capacitance more in the region of 2uF.

As a rule of thumb, in a publicly readable forum where we have no idea what MOSFETs people are going to use, can we pretend that MOSFETs need a current limiting resistor?

AmbiLobe:
Assume 3.6ns rise time for Arduino output

Not a good idea. I'd be loath to assume the SPI outputs are typical as these pins are designed for general SPI compatibility . Look at the spec for the 2-pin interface. They are likely more typical (20+ ns).

I wish the Atmel datasheets were a bit more forthcoming with this sort of thing. For instance, they say that the output current of any I/O pin should not exceed 40ma, but they tell us little else about this. Is this the continuous rating? What about 10us pulse? or a 50ns pulse? Seeing as the damage likely done by heat build up, what are the other conditions (temperature, voltage, etc...)?

fungus:
No, but that's a 2N7000 is a tiny little MOSFET that can't even handle the same current as an average BJT. TO220 size logic-level MOSFETs (the kind most breadboarding people will use) have a capacitance more in the region of 2uF.

As a rule of thumb, in a publicly readable forum where we have no idea what MOSFETs people are going to use, can we pretend that MOSFETs need a current limiting resistor?

2uF? Not likely, maybe 2nF.

There are all sorts of MOSFETs available, yeah, the IRL540 has a gate capacitance in excess of 2nF, but in my personal estimation the IRL540 is pretty easy to beat in the spec department for most of the projects the Arduino is likely to be used for. Like the FQP50N06. There are even better still. Also, the 2N7000 is plenty useful. It seems ridiculous to use an IRL540 to switch a 120 ma load when a 2N7000 will do it for hugely less money and take up way less space, but I digress.

I do see your point, but I think it is better to get folks used to reading spec sheets and using a little common sense about their designs, no?

I see it all the time on the internet. People learn simple rules of thumb and go around wielding them like swords of truth. Like the fable that to properly drive a BJT into saturation you need IBE=ICE/10. I may be one of a few, but I do believe that it's better to use the right device for the job and try to get the most you can out of it. After all, driving thumb tacks with sledge hammers might indeed work most of the time, but not always, and it's probably never even close to ideal.

So, yes, I think we should tell people in a publicly readable forum that MOSFETs do not always need gate resistors, because that is correct.

BillO:
2uF? Not likely, maybe 2nF.

(looks in box...)

IRL540 - 2.2uF
HUF76137P3 - 2.1uF
RFP30N06LE - 1.3uF (very low for a logic-level MOSFET)

etc.

(shakes head...)

Sorry, but I think there is a problem with your math. When is 2,200pF = 2.2uF?

1uF =10-6F
1nF = 10-9F
1pF = 10-12F

1000pF = 1nF = 0.001uF

I agree with BillO. Rules of Thumb are only useful in a very narrow range of circumstances, and the basic principles still need to be understood so that you know where and when they can be applied.

Which goes back to: Read LarryD's links.