1

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:

schematic

simulate this circuit – 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?

migrated from electronics.stackexchange.com Jan 24 '16 at 21:21

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

  • 2
    is that REALLY exactly how you have the cct? – JonRB Jan 24 '16 at 21:06
  • At first glance: your base resistor is way too high allowing only a small amount of current to flow through the collector. – d3L Jan 24 '16 at 21:06
  • And you forgot your flyback diode... – d3L Jan 24 '16 at 21:08
  • 5
    Another arbitrary migration- this has no particular relevance to Arduino- it could be any micro. 8-( – Spehro Pefhany Jan 24 '16 at 21:22
  • 2
    This is an electronics question - although the word "Arduino" does happen to appear in it. – Nick Gammon Jan 25 '16 at 1:32
6

I can't make much sense of your diagram- but this is the correct way to do it:

schematic

simulate this circuit – 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.

  • My precious reputation :( – d3L Jan 24 '16 at 21:16
  • 1
    Have an upvote, my friend. – Spehro Pefhany Jan 24 '16 at 21:18
3

There are multiple things wrong with your drawn schematic:

  • The ground symbol is not wrong but really misleading.
  • You forgot to add a flyback diode.
  • You wired the load the wrong way: the load is placed between the collector and VCC, not between emitter and GND.
  • The base resistor is way too high.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.