Cant figure out why my motor isnt working.

Hey guys, so recently ive been working on my rc car and i just hooked up the circuit for the rear 12v dc motor. Im using an L293d h bridge to control the speed and direction and used this site http://itp.nyu.edu/physcomp/Labs/DCMotorControl for the circuit diagrams. I tested it out and it worked twice running the same code. Then I went to sleep and woke up the next day seeing that it is no longer working. I cant figure out what happened. Please help!!!

Heres the code:

  const int motor1Pin = 3;    // H-bridge leg 1 (pin 2, 1A)
  const int motor2Pin = 4;    // H-bridge leg 2 (pin 7, 2A)
  const int enablePin = 9;    // H-bridge enable pin
  
    void setup() {

    // set all the other pins you're using as outputs:
    pinMode(motor1Pin, OUTPUT); 
    pinMode(motor2Pin, OUTPUT); 
    pinMode(enablePin, OUTPUT);


    // set enablePin high so that motor can turn on:
    digitalWrite(enablePin, HIGH); 
    
    digitalWrite(enablePin,HIGH); //enable on
    digitalWrite(motor1Pin,HIGH); //one way
    digitalWrite(motor2Pin,LOW);
    delay(1000);
    
    digitalWrite(enablePin,LOW); //slow stop
    delay(3000);
    
    digitalWrite(enablePin,HIGH); //enable on
    digitalWrite(motor1Pin,HIGH); //one way
    digitalWrite(motor2Pin,LOW);
    delay(1000);
    
    digitalWrite(motor1Pin,LOW); //fast stop
    delay(3000);
  }
  
  void loop() {
    
}

Here are some pics of the circuit. It may be a little tough to match cause of the wire mess. Sorry about that :frowning:

thanks for the help!

P.S

Positive lead for battery is green, negative is white. sorry for the confusion with all the colors. Also, theres a green jumper at the end of the breadboard that is connected to ground on the arduino, it just doesnt show the other end. AND, Im using a 9v battery. Do you think i broke the h-bridge? I know that the motor itself is perfectly fine because i plugged it in directly to a 9v battery and it worked.

Those images are much too large to view as a whole; cannot comprehend the circuit as only a small portion of the circuit is viewable at any time. Please repost with a width of around 800 pixels. - Scotty

What current does the motor take? if its more than about 0.6A then you won't have
joy with an L293D.

if the dc motor drew out too much current and blew out the h-bridge, what are some solutions? Im reading around to look for a reliable solution but im just not sure how much current this motor uses. Are there any other h bridges that you guys recommend that can handle high current? What else could I do?

You need to get out your multimeter and start trouble shooting your circuits. Look for bad connections or possibly bad breadboard points.

banditojosh1997:
if the dc motor drew out too much current and blew out the h-bridge, what are some solutions? Im reading around to look for a reliable solution but im just not sure how much current this motor uses. Are there any other h bridges that you guys recommend that can handle high current? What else could I do?

Yes, but first you need to find out how much current your motor takes.

Then perhaps look at the selection of drivers from Pololu. Or even some RC ESCs
designed for the motor in the first place!