Hi All,
Sorry if this has been asked before but after a few weeks of research, ordering incorrect bits on ebay and blowing a few transistors I was hoping someone could help me out or point me in the right direction.
FYI : I am a total beginner when it comes to electronics so go easy.... please
Overview Of What Is Required : Switch the VIN pins power (using a transistor with the base connected to an analogue pin) to drive a small water pump on an arduino Uno. Power being supplied onboard via the barrel plug (1 amp, 9v).
My calculations (and here is where the problem lies no doubt). 1. Current required for pump
I figured the pump would need 0.28amps of current based on (2.5 watts/9v = 0.28 Amps). I could not find the datasheet of the pump so was unsure if this calculation is valid? 2. Resistance required for pump (R = 9V/0.28amp) = 32ohms 3. Transistor Calculations
As my NPN transistor can handle 0.6amps I would expect it to cope with the current draw from the pump.
Next I checked the current and resistance required on the base.
Ic / hfe = Ib
0.28amps / 300hfe = 0.000093amps
R = V/I
5300ohms = 5v (arduino analog pin) / 0.000093amps
So when I wire up the diagram following the guide and ensuring I add the relevant resistors in the circuit as soon as my analog pin sends voltage to the base the transistor blows. Would really appreciate some guidance on where I am going wrong, I have tried to research this but clearly I am missing something very fundamental.
Thanks for your time.
Dom
Moderator edit: ridiculously small font size corrected
This is a typically bad and irresponsible Instructable. The author didn't bother to include a resistor to limit the base current to the switching transistor. Even if the circuit works, it will eventually destroy the Arduino by drawing too much current from an output pin. It is good that you recognized the need for one, however see below.
There are two likely problems: one, either you are missing the protection diode across the motor terminals (which prevents voltage spikes from destroying the transistor), or it has been installed backward, or destroyed.
Two, the startup current for the pump can be anywhere from 5 to 10 times the free-running current, and that is destroying the switching transistor. You can estimate the startup current by measuring the resistance in ohms between the pump motor terminals and divide that into the power supply voltage. However that measurement is not necessarily reliable due to variable resistance of the brushes and commutator.
You cannot take the maximum value of hFE and use that to calculate a base resistor, as the hFE is much lower at high collector currents (see the transistor data sheet).
A better approach is to use a logic-level MOSFET transistor switch, capable of several amperes. There are plenty of web sites showing how this is done. Don't forget the protection diode across the motor terminals. You do not need an analog pin to control the switching transistor, use a digital one.
Finally, it is not a good idea to run a motor from the Arduino power supply. The motor injects noise and voltage spikes which can ruin the Arduino or cause it to malfunction.
Don't forget the VBE drop of ~ 0.7 V!
240 ohms/4.3 V = 18 mA, so you are OK.
Also, the pin output voltage will be less than 5.0V with that much current being drawn.
@fisheyes: sorry you had so much frustration, but there are a lot of really bad tutorials out there. This one describes how to use a MOSFET transistor to control a motor (including speed control with PWM), and looks OK to me: http://bildr.org/2012/03/rfp30n06le-arduino/