Twisted Transistor

Hello again everyone, I have returned with another head-scratcher.

I am trying to use my PN2222A transistor as a switch so a small liquid pump can run off an external (not from the Arduino) power source. My pump runs like a champ when hooked directly to it's external (6V 300mA) power supply, yet the transistor switch circuit will not pass any juice through when triggered. Sounds like a messed up circuit you say? That's what I thought... but when I disconnect the external supply and instead connect the 5V and GND from the Arduino to the circuit the transistor passes the signal right along no problem... So the circuit is working correctly when power from the arduino is used, but not when my external source is used.

I checked the data sheet for the PN2222A, and 6V 300mA is well within it's operating range. I also noticed that the little wiring diagram I was using had emitter and collector mixed up, so I fixed that in the circuit. I have also swapped transistors just in case the first one was acting funny... no dice.

Why will my transistor and circuit pass the Arduino's power through, but not my external source?

(picture of my little wiring diagram included, as well as the very simple test sketch I have been using to try to debug this problem)

In the picture below, the leads I am connecting to my external source are the ones labeled "to 5V" and "to GND", and I am using the capacitor as well.

Pumpdebug.ino (202 Bytes)

You may have not connected 0 Volts on the Arduino to 0 Volts of the external source.

So should I run a jumper from the arduino GND to the external source's GND?

When the Arduino sends a signal out on pin 9 it has to return to the Arduino 0 volts.
That's why it worked when the Arduino was supplying the power.

ok... I think a lightbulb just went off in my head about how a transistor works... So, the current from the base has to flow through the transistor as well, and thus needs a path "home" (to GND) just like the external source. As the "switch" current from the base moves through, it opens the door for the external current to move from the collector to the emitter, so to speak?

I think I get it now?

Thanks for your reply.. it was an "AHA!" moment for me

So, the current from the base has to flow through the transistor as well, and thus needs a path "home" (to GND) just like the external source.

As long as you have the emitter grounded, as you do in the diagram, then both base and collector
currents have some place to go.

The one thing is, despite what the d/s may say, a 2N2222 probably isn't really the best choice for
300 mA currents. If you don't have enough base drive to saturate the transistor, you can end up
with a hot blob of plastic.

Also, with a ckt like this you should definitely test it before ever hooking to the Arduino or anything
else. Just hook the base R [pin 9 point] to 5V, and the motor should wizz, and the 2222 should be
in saturation, with close to 0V on the collector.

Jim_Socks:
ok... I think a lightbulb just went off in my head about how a transistor works... So, the current from the base has to flow through the transistor as well, and thus needs a path "home" (to GND) just like the external source. As the "switch" current from the base moves through, it opens the door for the external current to move from the collector to the emitter, so to speak?

I think I get it now?

No.

Voltages are all relative. 5V is only 5V when you compare it to a known reference point. From a different reference point it might be 3V, or -1374V.

To make circuits work, every component needs a common reference point, ie. you tie all the grounds together.

2.2K is a rather high value to use in that circuit, it only provides about 2mA base drive, which won't saturate the PN2222A very well and the sort of current your motor is likely to need. I suggest you use 220 ohms or 470 ohms instead.