NPN Transistor As Switch For Vin Pin

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 :astonished:

I am following this guide http://www.instructables.com/id/Automatically-water-your-small-indoor-plant-using-/?ALLSTEPS

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).

Water pump http://www.ebay.co.uk/itm/Mini-micro-waterpump-3v-to-9-6v-model-rc-boat-water-pump-FAST-DESPATCH/121425001384?_trksid=p2047675.c100011.m1850&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D20140107083358%26meid%3D085a16f246a34082bca6ce1728419252%26pid%3D100011%26prg%3D20140107083358%26rk%3D1%26rkt%3D10%26sd%3D121410210330

3V to 9.6V
2.5W

Transistors 2N2222 http://www.ebay.co.uk/itm/290760364509?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
DC Collector Current:600mA
DC Current Gain hFE:300

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.

http://m.instructables.com/id/Automatically-water-your-small-indoor-plant-using-/?ALLSTEPS

Needs banning....

The transistor will suck up max current from the Arduino via it's base ... I'm amazed the Arduino is not dead from excessive current draw..

Stick a 1k resistor between base of the transistor and the pin out from arduino.

cjdelphi:
Needs banning....

I'll get my ban-stick. ]:smiley:

Stick a 1k resistor between base of the transistor and the pin out from arduino.

I like to use 240? if I'm too lazy to figure the correct value. 21mA @ 5V. Hm, guess I should go up one value.

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/

Many thanks for all the very helpful replies, appreciated.

Cheers,
Dom