Arduino Motor Driver Trouble

I am using a duinotech motordriver shield to make a drone. it is currently attached to an arduino uno r3 but I am struggling to make it work. I have cut it back to absolute bare bones, i have only plugged my motors into the m1 terminal, with a 4xAA battery pack attached at the power terminals. this is the code I am uploading, but no matter what I do or change, it will not run.

const int M1_IN1 = 12;
const int M1_IN2 = 13;
const int M1_ENA = 3;

void setup() {
  pinMode(M1_IN1, OUTPUT);
  pinMode(M1_IN2, OUTPUT);
  pinMode(M1_ENA, OUTPUT);


  digitalWrite(M1_IN1, HIGH);
  digitalWrite(M1_IN2, LOW);
  analogWrite(M1_ENA, 255);  
}

void loop() {

}

I am relatively new to this, so I'm struggling to understand what i am doing wrong, especially since the motor will run when directly connected to the battery pack itself

I should note that this is the motor shield I am using [

Duinotech Arduino Compatible Motor Servo Controller Module

](Redirect Notice)

The data sheet requires 16V for the motors:

Specifications

Arduino Modules

Required Supply Voltage

5.0V,16.0V

Hey, thanks for the reply. So what you're saying is there is not enough power being supplied to the motor shield? What source do you recommend using for a shield like this? should I just use more batteries?

Use a simpler motor driver. Which motor types are you using?

https://www.jaycar.com.au/hobby-motor-low-torque/p/YM2706. I have 4 of these (just testing with one in the M1 terminal at the moment). I did some research and saw that DC motors are better off with motor drivers, so I got mine from the same store. These are all the necessary specifications I could find:

Motor

Motor Nominal Voltage

3.0 V

No load current

0.28 A

No load RPM

12000.0 RPM

Shaft diameter

2.0 mm

Shaft length

25.0 mm

Max. efficiency current

0.69 A

Max efficiency RPM

8540.0 RPM

Maximum efficiency torque

2.97 g.cm

Motor Type

Hobby

Power Source Details

DC Voltage

1.5 V

Packaged Dimensions

Packaged Dimensions

7.2cm(Length) x 5.7cm(Width) x 2.3cm(Height)

@josh_r

It will probably be easier to use the old Adafruit motor shield library (V1)

In the library manager search for "Adafruit Motor Shield Library" and install it.

Do not use the V2 library.

Remove the jumper on the shield

Try the MotorTest.ino example. Connect your motor to the M4 terminals.

Power the Uno via USB connection.

Do not connect 16V to anything

doesn't it depend on the motors?

do you want 16V driving a 12V or 6V motor?

Hi @josh_r
Welcome to the forum.
For all to see the manual for the shield.
XC4472_manualMain_67871.pdf (247.4 KB)

This bit might be relevant;

  • 4-way H-bridge: The L293D chip provides 0.6A (peak 1.2A) current per bridge with thermal outage protection, 7V to 12V

Tom.... :smiley: :+1: :coffee: :australia:

It may be the maximum voltage, even if such an error should have been corrected over decades.

Modules with such outdated chips should not be used any more. Modern MOSFET drivers provide much better performance and wiring.

of what?

are you referring to the max voltage of the L293 which is 36V?

Of the module. It also may be the required voltage for 12V motors. The informal data sheet leaves much room for guessing :frowning:

looks like you should be supplying 3V, 2xAA batteries to the motor supply leads of the motor driver board.

another approach is to just connect a voltmeter to the motor output leads to see that there is voltage, that it can be varied and reversed

@josh_r
Still need help or do you have it working?

Yes! using the adafruit library finally got it working, thanks so much!

Have a nice day!