basic transistor question

I know there are additional details I'm leaving out (resistors and diodes), I just want to know if I have the right general idea about this. Using a NPN transistor, I would connect my 9v supply to one motor lead, then the other lead to the collector. When +5 is applied from the Arduino to the base, both the base and collector current flow to ground through the emitter. Is this the correct principle?

Is this the correct principle?

Basically correct. What you are describing is using a NPN transistor as a 'low side' switch. There are of course other uses and configurations for transistors including as AC amplifiers. As you said there are base series resistors required and of course properly sizing the voltage and current ratings of the transistor for the voltage and currents being used.

Lefty

Yes...mostly. You also have to ensure the 9V ground is connected to the Arduino ground.

You also absolutely need a resistor between the Arduino and the transistor base.

--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

Thank you, almost all of the tutorial I've looked at for use as a switch, used the 5v from the arduino. I just wanted confirmation i can use it for switching higher voltages. Thanks again.

a_m_922:
Thank you, almost all of the tutorial I've looked at for use as a switch, used the 5v from the arduino. I just wanted confirmation i can use it for switching higher voltages. Thanks again.

Yes, but when working with transistor is best not to think 'voltage' (other then staying below maximum allowed levels) but rather think 'current'. A transistor is a current amplifier, it in effect allows the base/emitter current to control a much larger collector/emitter current. The fact that an arduino uses 5vdc output pins has little bearing on the transistor as long as the series base resistor limits the proper base current. It's much like a simple LED, one can work at nearly any voltage value as long as it's series current limiting resistor is sized correctly for the recommended led current.

Lefty

Perhaps my understanding is wrong. I want to use a shift register to control 8 npn transistors each of which will switch a group of 6 leds. Since each led is about 2 volts, I want to use a 12v supply. would I use a series resistor with each group of leds or control the current with the transistor by limiting the base current?

Making up numbers here so bear with me. If I used a series resistor to limit my LEDs to 10mA, but apply a large enough base current to allow more than 10mA from collector to emitter, it would still only be 10mA due to the resistor. Yes, no? Looks like I have more studying to do, still waiting for the moment it "clicks" and makes sense.

a_m_922:
Perhaps my understanding is wrong. I want to use a shift register to control 8 npn transistors each of which will switch a group of 6 leds. Since each led is about 2 volts, I want to use a 12v supply. would I use a series resistor with each group of leds
Yes

or control the current with the transistor by limiting the base current?

No, you want enough base current to insure that the transistor is saturated full on, but the amount of actual collector current flowing will be determined by the proper sizing of each LED's series resistor. A transistor cannot 'force' more current to flow then the external attached circuit will allow. The transistor is trying to acting like a mechanical switch, zero ohms when saturated on and open circuit when base current is turned off.

Making up numbers here so bear with me. If I used a series resistor to limit my LEDs to 10mA, but apply a large enough base current to allow more than 10mA from collector to emitter, it would still only be 10mA due to the resistor. Yes, no? Looks like I have more studying to do, still waiting for the moment it "clicks" and makes sense.

Yes, collector current is controlled by the voltage and resistance of the external circuit, the transistor just allows that much current to flow on through the collector emitter junction.

retrolefty:

a_m_922:
Perhaps my understanding is wrong. I want to use a shift register to control 8 npn transistors each of which will switch a group of 6 leds. Since each led is about 2 volts, I want to use a 12v supply. would I use a series resistor with each group of leds
Yes

or control the current with the transistor by limiting the base current?

No, you want enough base current to insure that the transistor is saturated full on, but the amount of actual collector current flowing will be determined by the proper sizing of each LED's series resistor. A transistor cannot 'force' more current to flow then the external attached circuit will allow. The transistor is trying to acting like a mechanical switch, zero ohms when saturated on and open circuit when base current is turned off.

Making up numbers here so bear with me. If I used a series resistor to limit my LEDs to 10mA, but apply a large enough base current to allow more than 10mA from collector to emitter, it would still only be 10mA due to the resistor. Yes, no? Looks like I have more studying to do, still waiting for the moment it "clicks" and makes sense.

Yes, collector current is controlled by the voltage and resistance of the external circuit, the transistor just allows that much current to flow on through the collector emitter junction.

Ooh, maybe I'm closer than i thought. I originally planned on starting with the LED circuits, pick the transistor rated for the voltage and current, then size the base resistor to achieve saturation. Thanks for the affirmation and clarification.

Personally, I've found that I'd rather use MOSFET ("N-channel enhancement mode") transistors for on/off circuits, and use bipolar ("NPN") transistors for analog amplification circuits only.
The reason is that the NPN transistors need a certain current through them to drive current in the switched circuit. The MOSFETs just need a voltage, that charges a super-tiny capacitor on the gate, and then they conduct just like a switch. Also, the resistance in a power MOSFET is typically lower than that of a NPN transistor.
Look at the BS170 for an "all around" part for < 500 mA, and perhaps the NTD5867 for a high-power alternative that is still easily switchable using the Arduino 5V out.
You might still want a 220 ohm resistor between Arduino and MOSFET gate to prevent over-current while switching on, just to be safe, but there will only be any real current flowing there during the moment it's being turned on (or back off).

NPN transistor,or N-channel Mosfet.
LEDs can be several in a string as you said also.