Go Down

Topic: Making two DC geared motors run simultaneously (Read 118 times) previous topic - next topic

Narendra_Singh

Yesterday I wrote a simple program to run two DC geared motors using Arduino UNO, Adafruit motor shield v1 and powered them with a 12V power adaptor by keeping the jumper in place. First Motor moves slowly and second motor makes some noise, but don't turns even. And if I put two simple DC motors then both turns at the same speed. And to test my power source, If I connect the same geared motors in parallel outside of Arduino and shield then both runs quite fast. So guide me what I am missing.

Code: [Select]
#include <AFMotor.h>
AF_DCMotor f_motor(1); // Front motor connected to port 1
AF_DCMotor r_motor(2); // Rear motor connected to port 2

void setup(){
  Serial.begin(9600);
}

void loop(){
    f_motor.setSpeed(100);
    r_motor.setSpeed(100);
    f_motor.run(FORWARD);
    r_motor.run(FORWARD);
}

slipstick

Congratulations on using the code tags in your first post!

You have the motors set to run at less than half speed. Try using setSpeed(255).

Steve

Narendra_Singh

Thanks.

I already tried setting the setSpeed by two ways but no luck

Code: [Select]
for(int i=0; i<255;i++) {
    f_motor.setSpeed(i);
}
f_motor.run(FORWARD);


&

Code: [Select]
f_motor.setSpeed(255);

johnwasser

Maybe there is a bad connection in the power circuit.  Check the voltage across the two motors to see if it is anywhere near 12V.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

TomGeorge

Hi,
OPs pic.

If you are trying to power a RC cart motor with that motor controller?
That is your problem.

What is the rating of the motors?
What is the rating of the outdated motor controller?

Look up the specs/data and please post a link to them.

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up