Hello, I have a 3v motor wired to the emitter pin on a 2N4401 npn transistor but it is not getting enough current from the transistor to work, i was wondering if there was still a way to get the motor to run by giving it more power but still being able to use the npn transistor as a switch. i have a Ir Phototransistor hooked up to the base pin. The circuit works if i use an led in place of the motor for the emitter pin so i know it is fine, i just need more power.
I think the 'normal' wiring is to have the load (motor) wired between the collector and the power source. Also you will need to put a snubber diode across the motor to stop flyback current destroying the transistor. e.g. a 1n4001
The phototransistor may not be allowing enough current to flow through the base to enable enough current for the motor. Replace it with a, say, 10K potentiometer and try varying the speed with that. Make sure you don't go down to zero ohms on the base though. You may want to put a 1K resistor in series with the pot.
Typically you would use a PNP transistor for a High Side switch. It would also require a resistir between the positive supply and the base and an NPN transistor between the Base and ground.
An NPN transistor is used as a low side switch with the base driven straight from the Arduino.
A High Side PNP transistor needs the Base voltage to be approx 0.7 volts below the positive supply for the transistor to turn on. If the Base is at the same voltage as the posotive supply the transistor turns off. To drive this from an Arduino you would need a resistor from the positive supply to the base of your PNP transistor, and an NPN transistor between the output transistor base and ground, and the base of this NPN to your arduino.
A Low Side NPN switch needs it base approx 0.7 Volts above the negative side of the supply to turn on and at 0 volts when off.
A High Side NPN switch would have to have its base at a voltage approx 0.7 volt above the voltage at the input terminal to your load. As the load is a motor this voltage would be variable depending on the load and thus would make for a difficult situation to control accurately.
Fundamentally, a transistor acts as a current amplifier. The minimum current gain (hFE) for your transistor is about 100. That means if you want 500mA (emitter & collector), you need at least 5mA through the base. Make sure you age getting at least 5mA out of the phototransistor and into the base of the transistor.
And with a phototransitor, the transitor will not always be fully-on or fully-off (depending on the light-level). When the transistor is partially on, it will dissipate power (voltage across it, and current through it, at the same time). You need to make sure the transistor can dissipate the power (Watts or milliwatts) without burning-up when partially-on. (And of course, the transistor must be rated for whatever current is required by the motor.)