Problems running a DC 6 - 15v motor with L293D H bridge


hello,

i've built machine runs dc 6 - 15 volt motor http://uk.rs-online.com/web/p/dc-geared-motors/0420596/ forward 45 seconds in reverse same period. i've added in stop between each transition.

i'm using l293d h bridge facilitate forward , reverse. i've attached diagram of wiring. code i'm using

int enablepin = 11;
int input1pin = 10;
int input2pin = 9;
int potpin = 0;


boolean polarity = true;

void setup() {
  // put setup code here, run once:
 
  pinmode(enablepin, output);
  pinmode(input1pin, output);
  pinmode(input2pin, output);

}

void loop() {
 
  int speed = analogread(potpin) / 4;
   
       polarity = true;
       setmotor(speed, polarity);
       delay(46000); //43 seconds
       
       analogwrite(11, low);
       delay(1000);
       analogwrite(11, high);

   
      polarity = false;
      setmotor(speed, polarity);
      delay(43000); //43 seconds
     
      analogwrite(11, low);
      delay(1000);
      analogwrite(11, high);

}   
 

/*
* sets motor speed , polarity
*/
void setmotor(int speed, boolean polarity) {
 analogwrite(enablepin, speed);
 digitalwrite(input1pin, polarity);
 digitalwrite(input2pin, ! polarity);
 
}

initially ran has since stopped running consistently. run 2 periods of 45 seconds slow significantly, stop. i've tried new motor same thing. small motor 6/9v came starter kit runs fine has insufficient torque machine have constructed. i'm wondering if there insufficient current going motor? wondered if maybe need power motor separately arduino board? if there simple way of doing this?

i should mention had motor running forward , reverse without stopping. thought had damaged motor, since trying new motor found not case. have damaged board instead?

i'm relatively new electronics , first project using arduino board. apologise not using terminology.

i'd appreciate given, machine piece of artwork intend exhibit @ end of week!!!

sarah

in fact small 6/9v motor having problems. believe there wrong board?


Arduino Forum > Using Arduino > Motors, Mechanics, and Power (Moderator: fabioc84) > Problems running a DC 6 - 15v motor with L293D H bridge


arduino

Comments