Powering my DC motors with a wall adapter, and they are still moving slowly?

Hi there, After a while of reading, testing, more reading, more testing, and replacing my Adafruit motor controller to an H-Bridge L293D, I´m finally going somewhere with my first project: a tiny car controlled by bluetooth. I´ve carefully followed these instructions (http://hardwarefun.com/tutorials/controlling-speed-of-dc-motors-using-arduino), and the robot is actually moving. My roblem is that the movement isn´t fast, and it´s more like a baby doing there first steps, more like a shy robot that moves a bit, then another bit. And when I reset it, it takes a while to start moving again... I´ve powered the arduino (Mega 2560) directely to the wall, so, it should have all the power it needs.

I thought the issue could be due to the construction of the bot, some problem with the wheels, but if I connect a simple 9v battery to the motors, without using the arduino, it goes really fast! What could be happening? Thanks for your help and insight!! Rosamunda

This is the code I´m using:

#define E1 4  // Enable Pin for motor 1
#define E2 5  // Enable Pin for motor 2

#define I1 3  // Control pin 1 for motor 1
#define I2 2  // Control pin 2 for motor 1
#define I3 6  // Control pin 1 for motor 2
#define I4 7  // Control pin 2 for motor 2

void setup() {

    pinMode(E1, OUTPUT);
    pinMode(E2, OUTPUT);

    pinMode(I1, OUTPUT);
    pinMode(I2, OUTPUT);
    pinMode(I3, OUTPUT);
    pinMode(I4, OUTPUT);
}

void loop() {
  
    analogWrite(E1, 255);  
    analogWrite(E2, 255); // Run in full speed

    digitalWrite(E1, HIGH);
    digitalWrite(E2, HIGH);

    digitalWrite(I1, HIGH);
    digitalWrite(I2, LOW);
    digitalWrite(I3, HIGH);
    digitalWrite(I4, LOW);

    delay(3000);

    // change direction

    digitalWrite(E1, LOW);
    digitalWrite(E2, LOW);

    delay(200);
    
    analogWrite(E1, 255);  
    digitalWrite(E2, 255); // Run in full speed
    digitalWrite(E1, HIGH);
    digitalWrite(E2, HIGH);

    digitalWrite(I1, LOW);
    digitalWrite(I2, HIGH);
    digitalWrite(I3, LOW);
    digitalWrite(I4, HIGH);

    delay(10000);
}

And this is how I´ve made the connections (the only difference is that I´m not using a 9v battery, but I´m connecting the arduino to the wall with an adapter):

I´m not using a 9v battery

Are you using the adaptor to power the motors or the Arduino?

What is the output rating on the wall regulator?

Check also the voltage drop on your 293. A MOSFET H-bridge might be better, or even a single-ended MOSFET (for speed control) and miniature DPDT relay (for direction control).

Thanks for your replies! The wall adapter is ok (I´ve asked about it before buying it in other post here, at the forums :) It is connected to the arduino... where should it be connected? I´ve tried connecting the arduino using the USB cable AND the wall adaptor, and only the wall adaptor... the result is the same... I even try adding to the two of them a 9v battery connected to the Vin pin... and the result is always the same... I don´t have a voltimeter where I am right now, but I don´t think the voltage drop could be that much when I add the battery and the wall adapter to the USB port. These are 4.5/6v DC motors.

It is connected to the arduino

If it is connected to +5V you will be drawing more current from the Arduino than it can handle. You need to connect it to an external power supply with it's ground connected to the Arduino GND (0V).

Rosamunda: Thanks for your replies! The wall adapter is ok (I´ve asked about it before buying it in other post here, at the forums :)

You say its OK but have you measured the voltage accros the adaptor whilst using it?

It is connected to the arduino... where should it be connected?

Has your wall adaptor the correct plug and polarity?

I´ve tried connecting the arduino using the USB cable AND the wall adaptor, and only the wall adaptor... the result is the same... I even try adding to the two of them a 9v battery connected to the Vin pin... and the result is always the same... I don´t have a voltimeter where I am right now, but I don´t think the voltage drop could be that much when I add the battery and the wall adapter to the USB port. These are 4.5/6v DC motors.

Get yourself asap a voltage meter, if you cant see anything how could you solve/see the solution.

Harry