2 DC Motors Using Elegoo 2560

Hello,
I am trying to create a small simulation using 2 small DC motors with the Elegoo 2560 and accompanying 9V power supply connected to a breadboard. I can get one motor to work, however when I connect the second both start to hum (low voltage hum). I am also using an L293D so I am sure the problem is in the connections and code. I am new to all of this so any help would be great.

This is the code (Modified from the Elegoo Tutorial) I am using and the current setup.

//Working first motor
#define ENABLE 5
#define DIRA 3
#define DIRB 4

//Second Motor Test
#define ENABLE 8
#define DIRA 9
#define DIRB 10
int i;

void setup() {
//---set pin direction
pinMode(ENABLE,OUTPUT);
pinMode(DIRA,OUTPUT);
pinMode(DIRB,OUTPUT);
Serial.begin(9600);

}

void loop() {

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);
}

I'm sure the problem is the 9V block and L293D. Use a stronger power source, add 4V to the nominal motor voltage.

You also redefine ENABLE, DIRA and DIRB, so that you can control only one motor. Please show a circuit diagram.

Thanks for the quick reply! The original battery for both motors was only 3.6V (Came from a small boat). The goal is to control a boat and speed up or slow down a motor to turn.
How would I connect additional power if needed...sorry, I'm new to this. Thanks

Update
Both motors work when connected to a single 1.5V AA battery and the output voltage from the breadboard is 2.9V.

Connect the motor power source to the motor driver supply.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.