PDA

View Full Version : probots 2A L298 based Motor Driver



gshubham96
12-27-2011, 04:40 PM
I am trying to run my motors with this motor driver board from probots (http://probots.co.in/index.php?main_page=product_info&cPath=54&products_id=197)
I operating the board with arduino. The supply voltage is 12v from an adapter. The code is as follows:

// --------------------------------------------------------------------------- Motors
int motor_left[] = {4, 5};
int motor_right[] = {9, 10};

// --------------------------------------------------------------------------- Setup
void setup() {
Serial.begin(9600);
digitalWrite(3, HIGH); // EN A
digitalWrite(8, HIGH); // EN B
// Setup motors
int i;
for(i = 0; i < 2; i++){
pinMode(motor_left[i], OUTPUT);
pinMode(motor_right[i], OUTPUT);
}

}

// --------------------------------------------------------------------------- Loop
void loop() {

drive_forward();
delay(1000);
motor_stop();
Serial.println("1");

drive_backward();
delay(1000);
motor_stop();
Serial.println("2");

turn_left();
delay(1000);
motor_stop();
Serial.println("3");

turn_right();
delay(1000);
motor_stop();
Serial.println("4");

motor_stop();
delay(1000);
motor_stop();
Serial.println("5");
}

// --------------------------------------------------------------------------- Drive

void motor_stop(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], LOW);

digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], LOW);
delay(25);
}

void drive_forward(){
digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);

digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);
}

void drive_backward(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], HIGH);

digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], HIGH);
}

void turn_left(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], HIGH);

digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);
}

void turn_right(){
digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);

digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], HIGH);
}


I am only getting 6-7V as output while the expected output was of 12 v.

Why is there a drop in voltage.

pratheek
12-27-2011, 11:34 PM
Make sure your power adapter can provide enough current for your motor.

Also, try increasing the delay time between your motor direction changes.

gshubham96
12-28-2011, 06:37 AM
I was worried about the same, the adapter provides 750 mAh .
the motor was not even connected to the board, I was measuring the voltage with a multimeter and that's all.
and how to know the current requirement of motor.

p.s. the motor was too bought from probots.

gshubham96
12-28-2011, 06:40 AM
I was worried about the same, the adapter provides 750 mAh .
the motor was not even connected to the board, I was measuring the voltage with a multimeter and that's all.
and how to know the current requirement of motor.

p.s. the motor was too bought from probots.

roopakjada
12-28-2011, 08:47 AM
mAh- milli Amps per hour -> used in defining battery capacity
mA - milli Amps -> current
:)
first check if the adapter is giving full 12V check if the Current Sensing pins are grounded if not used

gshubham96
12-28-2011, 03:54 PM
sorry..it's 700 ma

and the sense pins are grounded

gshubham96
12-30-2011, 04:35 PM
I managed to get 10V with motors and 12v without motor, so the prob was probably the current capacity of the adapter

sudarshan
12-30-2011, 05:45 PM
Try using a supply from a lead acid battery or other li-poly or li-ion battery.
they will give a constant supply. local adapters are not desigined to give regulated output at constant rates.
or you can try using smps
http://www.onlinetps.com/shop/index.php?main_page=product_info&cPath=14_61&products_id=388
or
http://www.onlinetps.com/shop/index.php?main_page=product_info&cPath=14_61&products_id=386

they gave a good supply