Transistor Switch Motor

I am building a toy and can not get a transistor switch to work using Uno. It only works when I remove the 330ohm pin resistor. It seems wrong to not have the resistor. Further, when it do get the switch to work and the motor runs, the voltage at the motor terminal drops from 3V to to about 1.4V. Is it ok to remove the resistor? Why does voltage drop so much? How can I keep the voltage higher?
**Note in diagram D10 goes to UNO pin 10. I have a vibration switch on UNO 5V and A4.

int sensorPin = 4;
int motorPin = 10;
int sensorValue = 0;
int ledPin = 13;

void setup() {
pinMode(motorPin, OUTPUT);
pinMode(sensorPin, INPUT);
digitalWrite(ledPin, LOW);
void loop() {
sensorValue = analogRead(sensorPin);
if (sensorValue>900)
{digitalWrite(motorPin, HIGH);
digitalWrite(ledPin, HIGH);
digitalWrite(motorPin, LOW);
digitalWrite(ledPin, LOW);}



Do some more work on your schematic.

Does yours look like this?


yes, that is a better diagram. I have a smaller resistor, but basically the same

150 ohm base resistor for any sort of high current load (more than 100mA). Don't try to power more than about 600mA with a single BJT as a switch, use a MOSFET.

BJTs as switches only have about 5 to 20 fold current gain, not the 200 or so for linear amplification.

In your drawing, you have the collector connected to the emitter connected to GND, which is wrong!

The base resistor value can be adjusted as needed, depends on the transistors gain and collector current needed.


From your picture I guess you have drawn connection from "motor -" to GND by mistake. If I understand it right you have connected motor to Emitter and GND to Collector of the transistor. It is wrong. You have the transistor connected in reverse. It still works as NPN transistor when Collector and Emitter are switched but its characteristics are worse - most importantly much lower breakdown voltage and much lower beta - it needs much higher Base current to let the same Collector current to pass. Try to switch Collector and Emitter, and DO NOT remove the base transistor unless you know what you are doing (for some transistor configurations it is not needed but this is not that case and in general it is safer to add one in all cases).

SOLVED. LarryD' s drawing was better, I did have the motor correctly connected to + and - to the transistor. I solved by changing to a MOSFET, which also solved the overheating of the transistor :). Thanks all for pointing me in the right direction.