DC motor troubleshooting

Hello ! Yesterday i bought a dc motor and i tried to do a project with him.I made the circuit,the sketch and then it worked.Today i try to turn it and it's not working.What's the problem? the sketch: const int motorPin = 9; const int ledPin = 13; void setup () { pinMode(motorPin, OUTPUT); }

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

the circuit: http://tinypic.com/view.php?pic=2cp9wz7&s=8#.U_sKI8V_usg

Sorry for my english!!!

Hi, Please use code tags.. See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Thanks Tom........ :)

Hi, where are you getting power for the motor, if it is the 5V on the Arduino, then STOP.

The motor needs a supply independent to the 5V in the controller, the controller cannot supply the current that the motor would need.
You need to post a circuit diagram, in CAD or a picture of a hand drawn circuit?

Thanks …Tom… :slight_smile:

And please make a drawing of how everything is connected and post a photo of the drawing. It is almost impossible to understand wiring connections from photographs of the actual connections.

How are you providing power for your motor? It should NOT come from the Arduino 5v pin. It cannot supply enough current and the Arduino might be overloaded and damaged. It also usually causes the Arduino to reset with all sorts of strange consequences.

@TomGeorge - beat me to it ...

You can use the Arduino command analogWrite(pin, value) to generate a PWM signal to control the speed of the motor, but note that only some pins support PWM.

...R

Hi, Robin2, "missed it by that much"

Tom... :) :)

http://tinypic.com/r/vifx5l/8 <— circuit
http://tinypic.com/r/290zsqd/8 Sketch

Hi, try this using code tags .

const int motorPin = 9;
const int ledPin = 13;
void setup () {
  pinMode(motorPin, OUTPUT);
}

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

Use Additional Options to attach pic of the circuit. Which is very bad, it shows wrong way of supplying current to the motor, and could as Robin2 says damage your arduino.

Tom.... :)

Read. http://forum.arduino.cc/index.php/topic,148850.0.html

thanks ;) ;) ;)