# Basic Transistor Question?

Hey everybody!

OK so I am looking for a transistor capable of running a 12v 0.10a fan from an external power source, powered by the Arduino. I have a mixture of transistors but don't know if any are able to cope with the 12v/0.10a being carried through them. I have looked up the datasheets for a few of them but do not understand which bit it is that I am suppose to be checking, e.g. Collector-Emitter Voltage, Collector-Base Voltage or Emitter-Base Voltage?

Any help would be greatly appreciated, thanks!

Sam!

This seems like the ideal time to sit down and learn about transistors.

Start here: BJT H

Fortunately 0.1A is not that big so many devices will take this. The Ice (current: collector to emitter) is the
relevant parameter. You also need to know how much current the base needs to saturate the transistor on,
but a good guess would be 1/20th of the collector current, ie 5mA, so an 820 ohm base resistor would be

many BJT transistors will have a minimum hfe of 50. checking the max base current is a good idea as you can drive it that high and know you are in the most conductive condition although knowing roughtly what hfe the transistor has will allow you to be more conservative and save your arduino outputs

SamuelCB:
Hey everybody!

OK so I am looking for a transistor capable of running a 12v 0.10a fan from an external power source, powered by the Arduino. I have a mixture of transistors but don’t know if any are able to cope with the 12v/0.10a being carried through them. I have looked up the datasheets for a few of them but do not understand which bit it is that I am suppose to be checking, e.g. Collector-Emitter Voltage, Collector-Base Voltage or Emitter-Base Voltage?

Any help would be greatly appreciated, thanks!

Sam!

OK, a few things to know is what to look for in a transistor. The transistor has to carry at least 0.1 amperes, so you look for Ic to be at least 0.1 amperes (or more - usually at least 2 to 5 times more.

When the transistor it turned off, there will be a voltage between the collector and emitter (called Vceo). Of course, Vceo will be 12 volts, so you look for a spec higher than that.

Next thing is current gain. You want the transistor to be fully turned on by the Arduino output pin while not exceeding the specs of the ATMEGA chip for output current. So, let’s choose a conservative number… say 5 milliamps. That is, I want the Arduino pin to have to put out no more than 0.005 amperes to turn the fan on.

The fan needs 100 milliamps, and we want to control that with 5 milliamps, so the current gain (Hfe) has to be at least 100 / 5 or 20.

So, now let’s pick a common switching transistor (the 2N2222) and look at the data sheet.

Vceo = 40 volts (more than enough - need 12 minimum)
Ic = 1.0A (more than enough - need only 0.1)
Hfe = 100 minimum (5 times better than we need)

So, it looks like the 2N2222 will do the job. Now, look at the circuit diagram attached.

We need to figure out one more thing… what resistor to use. The Arduino is going to put out 5.0 volts when the pin is turned on.

From the transistor data sheet, we see that the Base/Emitter saturation voltage Vbe(sat) is 1.2 volts. This spec is with a base current of 15 milliamps. We won’t be pushing it that hard (we are only looking for 5 milliamps), so we can guesstimate that the voltage will be about 1.0 volts. So, what drops across the resistor is 5.0 volts from the port minus 1.0 volts across the base-emitter junction or 4.0 volts.

Use Ohms law: R = 4 / 0.005, R = 800 ohms. Since it’s not critical, we’ll pick a standard value close to 800 ohms… how about 1000 ohms (1K)?

So the base resistor is a 1K, the transistor is a 2N2222 and the circuit is as you see in the diagram. Hope this helps.

(edit to add): Obviously, the Arduino goes in place of the “5 volt battery” in the diagram.

Not to over complicate things, but let's not forget to add a snubber diode across the fan to prevent back EMF from damaging the transistor.

Mitch

Hi everybody,

Thanks for all your replies, they have all been so helpful, especially yours krupski!

As for the snubber diode mentioned by you midon, the diode will be going from the positive connection to the negative connection on my fan, correct? I have scanned through that wiki link you posted but I am a bit useless at learning from large blocks of text! Can you recommend a specific diode for this job?

Thanks again, Sam!

You want a diode that can handle the load current and at least twice the supply voltage. The diode needs to go in parallel with the load BACK TO FRONT so that normally it does not conduct.

For a small fan a 1N4007 is plenty and they are very cheap as they are very widely used

The snubber diode would go across the collector and emitter in the opposite polarity of the current flow of the fan when it is on. This is because the fan coils may generate a voltage spike of the opposite polarity when the field collapses (fan power removed) and it is still spinning.

So the diode needs a breakdown voltage higher than the expected voltage (so higher than 12V.) The idea is that backwards polarity current will flow through the diode instead of the transistor. Really, just about any diode would work. Your current and voltage are not very high. Well, don't use a small signal diode, but a run-of-the-mill 1N4001-007 should work just fine.

I have also seen these directly across the motor leads as well. I am a bit embarassed to admit that I don't know what the difference there is. But either would work. I suppose that across the motor directly would use the current generated by the coil to brake the motor (basically shorting the leads together.)

putting the diode across the transistor is not the best way as it just protects the transistor. If you put it across the load it will destroy any reverse currents.

The reverse currents are created any time an inductive load is turned off, this applies to the turn of period if a pwm drive too. With the diode in parallel with the load the unwanted reverse current will flow through the diode so the load acts as the generator of unwanted spikes and the diode is a short circuit to these so it ends there and then (the current will keep circulating in the local circuit of the diode and motor until it dissipates). If you put the diode across the transistor the negative spikes are still free to roam.

sparkylabs:
putting the diode across the transistor is not the best way as it just protects the transistor. If you put it across the load it will destroy any reverse currents.

The reverse currents are created any time an inductive load is turned off, this applies to the turn of period if a pwm drive too. With the diode in parallel with the load the unwanted reverse current will flow through the diode so the load acts as the generator of unwanted spikes and the diode is a short circuit to these so it ends there and then (the current will keep circulating in the local circuit of the diode and motor until it dissipates). If you put the diode across the transistor the negative spikes are still free to roam.

I would say the current isn't reverse, its in the same direction (within the inductor), because inductors resist change in current.

The destructive voltage spike that is reverse, the inductor's field energy will go into forcing its current to continue flowing
by generating whatever voltage is necessary. With a diode in place that voltage is about 0.7V which is far less destructive than
say 1000V...

back emf diodes also called snubbers go on the load. If you don't believe me just google around there are plenty of explanations about it.

Similarly many circuits have a reversed diode in parallel with their power input should another device in the system that has been poorly designed be kicking out nasty negative voltage. The current will go in the same direction as the voltage by the way.

Retroplayer:
I have also seen these directly across the motor leads as well. I am a bit embarassed to admit that I don't know what the difference there is. But either would work. I suppose that across the motor directly would use the current generated by the coil to brake the motor (basically shorting the leads together.)

A "snubber diode" across a DC motor will not act like a brake because the EMF generated by the unpowered but still turning motor is in the same polarity as the power supply. Only inductive spikes caused by the magnetic field collapsing upon power removal are in the reverse direction (and therefore forward bias the diode and "snub" the spike).

You have just contradicted yourself. No matter what the load any inductive load will produce a voltage spike with reverse polarity when power is removed. be it a simple power on, power off, or the off periods of a PWM drive. The diode provides a shortcircuit path for the destructive voltage.

I have run test for my work place and shocked them with osciloscope graphs of -400v spikes running around the system because of lack of diodes

Clear as mud!

Well maybe you people who think "programming skills" + "arduino" = electronics should go and read some electronics theory.

What happens when the back emf kicks off and you have put the diode across the transistor instead ? go on think about it. What will happen is your saving the transistor and giving a negative spike a path to now run across the power rails of the whole circuit. This is part of good practice to put a diode on the supply, just in case someone did something stupid.

If you don't know electronics go read a book ! doing electronics wrong blows stuff up, unlike getting software wrong. If you like I can put up when i am home an oscilloscope screen shot that clearly shows the voltage on the load and positive and then when power is pulled shoot straight down from +24V to -400 and then slowly rise back to 0V, Or you can go get an education!

Sparky,

I happen to be an electrical engineer for a major aerospace company. So I guess if you lack confidence in my education, perhaps you should avoid flying.

Having a bad day, are we?

Honestly... it doesn't make a flipping difference, really. Back EMF gets shunted to ground with the diode. It follows the path of least resistance and the diode provides that. That super scary 400 VOLTS!!!!!! you are so eager to show us has practically no current capacity to it at all to it. It is just absorped by ground within femtoseconds. I can one up you and show you 1000V!!!! by walking across a carpet!!! But very doubtful I will blow a BJT by touching it. Why? Because it has practically NO current to it at all, not even close to enough to breakdown the junction in a BJT. FETs on the other hand... and even that is actually more theory and suspicion than even actually proven.

The danger is all in the voltage itself and the way semiconductors are formed. A high enough potential across the collector to emitter MAY be enough to breakdown the junctions and the transistor self-destructs. MUCH more likely with a FET than a BJT. In fact, do you have any idea how many thousands of everyday products that you use that do NOT even have a diode in the circuit? Yet they keep on clammering away, happily. Imagine that!

It CAN damage a transistor, and it is good practice to have a diode whichever way you choose to install it. But it is not even close to being as dramatic as you are making it. If one were to run a 12V motor (especially just a fan) and not even put a diode in there, I doubt they would ever even have trouble.

You go read a book, Sparky.

BTW, you may want to start writing some nasty letters to IC manufacturers, because they have been putting clamping diodes across the transistors for decades. Like these guys, for example:

Or these flipping idiots:
http://pdf1.alldatasheet.com/datasheet-pdf/view/202145/TI/UN2003A.html

Stupid, manufacturers! Don’t they know any better!!!

Must be a bunch of stupid programmers. lol

sparkylabs:
You have just contradicted yourself. No matter what the load any inductive load will produce a voltage spike with reverse polarity when power is removed. be it a simple power on, power off, or the off periods of a PWM drive. The diode provides a shortcircuit path for the destructive voltage.

I have run test for my work place and shocked them with osciloscope graphs of -400v spikes running around the system because of lack of diodes