Transistor slows motor instead of turning it off I'm new to electrical engineering and I am currently trying to make a motor turn on for one second, turn off for one second, and repeat.

I'm using an Arduino Uno's digitalWrite() feature to activate a transistor, allowing the external 9V battery to turn on the motor.

Although everything is responding, instead of the motor turning on and off like I want it to, it spins fast for a second, then spins slower for a second. I would like the motor to stop completely, but cannot figure out how to do that.

Here's the schematic of my circuit:







simulate this circuit &ndash; Schematic created using CircuitLab

Code:

void setup(){    
  pinMode(9, OUTPUT);
}

void loop(){    
  digitalWrite(9, HIGH);    
  delay(1000);    
  digitalWrite(9, LOW);    
  delay(1000);    
}


Why isn't the motor completely turning off?
I can't make much sense of your diagram-  but this is the correct way to do it: 







simulate this circuit &ndash; Schematic created using CircuitLab

R1 is low enough that the base gets 10-15mA of drive, sufficient for a few hundred mA of motor current. D1 protects the transistor Q1 when it turns off (from the motor inductance). The emitter of the NPN transistor should be grounded and then the collector will either be near ground or at the 9V level depending on whether it is off or on. 

You may have damaged the transistor you are using (due to breaking it down in reverse across the E-B junction) so I would suggest proceeding with a new one. You didn't mention it, but it probably got quite warm.