Vacuum Pump

I’m trying to control a 12V vacuum pump using an Arduino (with a diode and a 22N2 transistor).

I tried to wire it like in the image below, and my transistor started smoking.

Attached are photos of my setup.

What should I do differently?

Also, might the transistor still work? How can I test it?

IMG_1529.JPG

IMG_1530.JPG

IMG_1531.JPG

assuming the transistor can handle the current you need a resistor in the base.

Try 470 ohms.

Your photo does not look like a 22n2 , thats a big thyristor.

Why an analogue pin.
Connect to a digital pin, or a digital pin with PWM capability if you should need that.
A 100n ceramic cap across the motor terminals could kill RF.

That motor looks like it could draw more than 500mA.
If you're using a 2N2222, go for a 220ohm base resistor.

I would get someting beefier to switch the motor.
A logic fet is ideal.
Leo..

Wawa:
Why an analogue pin.

An analogue pin is a digital pin. All pins default to digital I/O. The only difference is that the analogue pins also function as analogue inputs.
As long as they're initialised correctly, 'pinMode(A0, OUTPUT);', all is well. (Unless, as you say, he wants PWM.)

^ Know that, but you usually have a limited amout of analogue pins....

I got the idea that OP though he had to use an analogue pin for reasons unknown.
Leo..

Assuming you meant 2N2222, that is rated a maximum of 1.0 A (I didn't think it was that high) according to the Fairchild Data Sheet and is an NPN transistor. Bipolar transistors can be viewed sort of as a pair of diodes with one of them being a diode from the base to the emitter - that means that typically the drop from the base to the emitter is 0.7v and the control of the transistor is determined by the current into the base, not the voltage. That is why the other posters have indicated you need a base resistor so the Arduino is feeding a controlled current into the base to turn the transistor on. You don't indicate how much current the vacuum pump takes, but I suspect it is more than the max (especially starting) 1.0A listed for that transistor. My preference would have been to use a logic level FET such as my current favorite (since I have a bunch of them) IRL520 - rated for 9A and 100V.

Wawa:
^ Know that,

I thought you must have. That's what surprised me.

but you usually have a limited amout of analogue pins....

True, but that only matters if they're being used.

I got the idea that OP though he had to use an analogue pin for reasons unknown.
Leo..

Fair point - it doesn't hurt to point it out, and he might actually want PWM and think that an analogue pin can do that.

I think that the real issue is probably that transistor and the current consumption of the vacuum pump.
(I've never heard of a 22N2 transistor.)
@Brayd, what is the vacuum pump's current rating? And can you clarify the transistor type? 2n2222 maybe? After the smoke, it's probably dead anyway. As Wawa points out, a logic-level MOSFET is better suited to the purpose.
gpsmikey just covered most of this bit, but I'll post anyway rather than waste perfectly good typing. :smiley:

gpsmikey:
My preference would have been to use a logic level FET such as my current favorite (since I have a bunch of them) IRL520 - rated for 9A and 100V.

Your "current favourite" wouldn't be mine, unless I had to switch something high voltage/low current.
Leo..

Here you go... http://www.pighixxx.com/test/portfolio-items/connect-a-dc-motor/?portfolioID=610