Arduino Transistor Amplification Tutorial!

I just finished making a tutorial on using basic transistors and a few other simple components to amplify the arduino digital output signal.

There are schematics out there to do it but I figured I would throw it into a nice video with lots of pictures so its easy to understand.

Tell me what you think!

Excellent work. That was a very informative video.

Interesting video. I'm a software engineer myself and not really familiar with the possibilities and limitations of hardware circuits. This kind of videos are really useful in understanding the use and behavior of basic components.

I have never before noticed any special circuits for inductive loads. This video leaves me with some questions about that. I understand that some components might generate an induction because of a magnetic field. But why does the diode solve the problem of overloading the output pin or the transistor?

Well done that was a good video.

But why does the diode solve the problem of overloading the output pin or the transistor?

Current flowing through a coil creates a magnetic field. When that current is stopped the field collapses. As the field collapses it cuts through the coil winding and induces (causes) a voltage to be generated. This voltage is in the opposite direction as the one that caused the field and it's size depends on how many turns the coil has and how fast the field is moving. The result is that a reverse voltage of several hundred volts can be generated. The diode simply shorts this out, the energy going into warming up the diode slightly.

Thanks!

I noticed here that Grumpy Mike says the general advice is to use a 1K resistor for switching:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1262172912/7

But the video shows a 10K.

Why the difference? Is the 10K needed to make the PWM example work, or is it just there to reduce the amount of current needed? And can I expect that your typical transistor will work reliably with that big of a resistor?

I think the point is... it's not "critical". As mentioned in the video, 1K or 10K have been used and the Arduino will supply current to the transistor through the selected resistor. The AMOUNT of current that reaches the transistor base pin needs to be enough to turn it "ON".

1K is just fine. 10K is also fine in this case but is probably close to a value where the transistor may "think" about turning "ON" and actually might not. So while the 10K is probably "safer", it might not work with other transistor choices.

I personally drive the 2N2222 base with a 1K in all my 5 Volt circuits. Always works.

Great video, it gave me some ideas for my current project :smiley: Thanks!

Why the difference? Is the 10K needed to make the PWM example work, or is it just there to reduce the amount of current needed?

With a 1K resistor and 5V, assuming a 0.7v Vbe drop you get:-
4.3 / 1000 = 4.3mA base current.

With a 10K resistor and 5V, assuming a 0.7v Vbe drop you get:-
4.3 / 10000 = 0.43mA base current.

Therefore for any given collector current you are relying on the gain of the transistor being greater than:-
collector current has to be at least base current times transistor gain

Too much base current is not too much of an issue, it can affect the turn off time of the transistor but not much else.

Too little current and the transistor does not turn fully on so the collector current is not as much as you are expecting and the transistor will dissipate a bit more heat.

The gain of a transistor is typically 100 to 300 for small signals, for power transistors this can be as low as 10.