Hello,
My dc motor is not working, I don't why. I checked the connections and everything is fine. Did I broke my dc motor?
Hello,
My dc motor is not working, I don't why. I checked the connections and everything is fine. Did I broke my dc motor?
More detail needed
Are you using an Arduino to control the motor ?
What type of motor is it ?
How is the motor powered ?
I am using an Arduino uno to control the motor. the motor came in elegoo the most complete starter kit. I am using an power supply connected to breadboard and the power supply came also in the kit.
I am using an Arduino uno to control the motor. the motor came in elegoo the most complete starter kit. I am using an power supply connected to breadboard and the power supply came also in the kit.
Is there a device between the Arduino and the motor or are they connected directly ?
Please post a link to the starter kit
OK
Please post a schematic of your project showing how the components are connected. A 'photo of a hand drawn circuit is good enough. Also post the sketch that you are running. using code tags when you do
#define ENABLE 5
#define DIRA 3
#define DIRB 4
int i;
void setup() {
//---set pin direction
pinMode(ENABLE,OUTPUT);
pinMode(DIRA,OUTPUT);
pinMode(DIRB,OUTPUT);
Serial.begin(9600);
}
void loop() {
//---back and forth example
Serial.println("One way, then reverse");
digitalWrite(ENABLE,HIGH); // enable on
for (i=0;i<5;i++) {
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(500);
digitalWrite(DIRA,LOW); //reverse
digitalWrite(DIRB,HIGH);
delay(500);
}
digitalWrite(ENABLE,LOW); // disable
delay(2000);
Serial.println("fast Slow example");
//---fast/slow stop example
digitalWrite(ENABLE,HIGH); //enable on
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(3000);
digitalWrite(ENABLE,LOW); //slow stop
delay(1000);
digitalWrite(ENABLE,HIGH); //enable on
digitalWrite(DIRA,LOW); //one way
digitalWrite(DIRB,HIGH);
delay(3000);
digitalWrite(DIRA,LOW); //fast stop
delay(2000);
Serial.println("PWM full then slow");
//---PWM example, full speed then slow
analogWrite(ENABLE,255); //enable on
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(2000);
analogWrite(ENABLE,180); //half speed
delay(2000);
analogWrite(ENABLE,128); //half speed
delay(2000);
analogWrite(ENABLE,50); //half speed
delay(2000);
analogWrite(ENABLE,128); //half speed
delay(2000);
analogWrite(ENABLE,180); //half speed
delay(2000);
analogWrite(ENABLE,255); //half speed
delay(2000);
digitalWrite(ENABLE,LOW); //all done
delay(10000);
}
@UKHeliBob did you see the circuit and the code?
I did
Start by testing whether the motor works when connected directly to the power supply. If it does then the motor is OK.
If so then connect the motor to the L293D and set the state of the chip inputs using jumpers to make the motor run in either direction. If it works then the driver is OK
If so then you need to make sure that the code is doing what you think. Start with a simple sketch to make the motor move at full speed in either direction with print statements telling you what it is doing
Also, those long bradboards MAY have a break in the power rails half way along, check with you meter, or an LED with resistor.
thanks for your reply. I am new to arduino. How do I connect directly to power supply? ![]()
I checked it and everything is fine
The power supply provides power to the breadboard power rails so you can connect the motor directly to those rails to test it.
Are you sure that the power supply is providing power to the breadboard ? I see jumper pins in your picture that seem to indicate that you can select 5V or 3.3V to be passed to the breadboard. Which do you have selected ?
I am using 5V.
thanks my motor is working. Now how do I check the l2930 driver?
and one thing, I acciedently dropped my l2930. Is this the reason?
If you have multimeter then check that there is 5V on the breadboard power rails and if so connect the motor directly to them. Does it run ? If you don't have a multimeter (buy one now !) then connect the motor regardless. Does it run ?
yes my motor runs fine.
Connect the motor and power to it and use jumpers to provide the inputs from 5V and GND as required