using arduino to control a 12V pump - grounded even when transistor is off

Hi guys. I am pretty new in the arduino world and I need some help with a project. I am building a way to control a 12v pump using arduino. The sketch is working really fine but I am having problems with the transistor. The issue is really simple and I could not figure out what is going on. So, I have pin A3 (its an arduino nano board) connected to a 220ohms resistor and then to the base of a 2n 2222 transistor. The negative wire coming from the motor I am connecting to the collector pin and the negative pin coming from the ground I am connecting to the emitter. The problem is: when I connect the motor, it starts to spin. The current is flowing through the transistor even when it is off (or should be). I disconnected the pin coming from the arduino and the current is still flowing, which means that the transistor is allowing the current to pass trough it without current being applied to the base. I tested the transistor and it is not damaged, I have other 100 and I tried with others and still having the same issue. What am I missing here?

Btw, When the transistor is "off" the current passing through it is around 6v but when it is turned on the current raises to 12V.

Thanks for your help

[u]Here is a driver circuit[/u]. (It shows a solenoid, but it's good for a motor too.)

You wiring description sounds right but it would be helpful to see a schematic (a scanned hand-drawn schematic is fine).


Maybe you've mis-identified the collector, emitter, and base?

You need the diode to protect the transistor from high back-EMF voltage. If you have a diode in your circuit, make sure it's not reversed. (If the diode is reversed the motor won't turn off.)

How did you test the transistor? The symptoms you're describing indicate a blown transistor (assuming it's wired correctly).

What's the current rating on the pump motor? The 2N2222 is rated for 800mA maximum, and I assume you need a heatsink if you push it to the max.

Attached the schematic of my project. I tested how many amps this motor can drain and I found 420mamps. I tested the transistors using the diode test function on my tester and I connect the positive of the tester to the base pin and connected the negative to the collector (the value was around 0.670) and then I connected to the emitter (around 0.678). I don't know why my transistors are allowing current through them.

SOLVED

I found out that I was following the schematic for the 2n 2222A with has the emitter and collector switched comparing with the 2222 that I have.
Thanks for your help !

leandrodias:
SOLVED

I found out that I was following the schematic for the 2n 2222A with has the emitter and collector switched comparing with the 2222 that I have.
Thanks for your help !

Don't feel bad. Years ago we made a product that used 2N2222 and the buyer bought 1,000 of the 2N2222A thinking they were improved version! Ii gave away hundreds of the "A" version, being sure to tell that they were NOT 2N2222.

Paul