Arduino Uno R4 WiFi + Motor Shield L293D + DC Motor | Not working!

Hi everyone,
I need your help!
I'm new to Arduino: here is what I'm trying to do and the description of my problem, plus all relevant info.
I really appreciate any help with debugging.
Thanks

GOAL: Control a 12V dc motor with arduino uno, its motor shield L293D and an external power supply

PROBLEM: Once successfully compiled the sketch, nothing happens. The motor stands still, no sign of life.

HARDWARE in use:

  • Arduino Uno R4 WiFi
  • L293D Motor Shield
  • DC Motor 775 12-36V 3500-9000rpm (I have no data sheet, but motor spec reports the following: DC 12V, Electric Current 0.16A, 3500rpm)
  • Power Supply: 12V battery charger (the front reports: 12V, 2.5A arith, Min 25Ah)

WIRING:

  • L293D plugged on top of arduino Uno
  • Arduino Uno powered via USB-C with Laptop
  • Battery Charger connected to L293D Ext_Pwr slot; Jumper removed from the shield (in order to power the motor with the external supply)
  • DC motor connected to M1 slot
    see image attached

CODE:
I've installed the Adafruit V2 library and compiled the following sketch:

#include <Adafruit_MotorShield.h>

// Definizione dei pin della scheda L293D Shield
#define MOTOR_IN1 4
#define MOTOR_IN2 5

void setup() {
  // Impostazione dei pin come output
  pinMode(MOTOR_IN1, OUTPUT);
  pinMode(MOTOR_IN2, OUTPUT);
}

void loop() {
  // Fai girare il motore in avanti
  digitalWrite(MOTOR_IN1, HIGH);
  digitalWrite(MOTOR_IN2, LOW);
  delay(2000); // Aspetta 2 secondi

  // Fai fermare il motore
  digitalWrite(MOTOR_IN1, LOW);
  digitalWrite(MOTOR_IN2, LOW);
  delay(1000); // Aspetta 1 secondo

  // Fai girare il motore all'indietro
  digitalWrite(MOTOR_IN1, LOW);
  digitalWrite(MOTOR_IN2, HIGH);
  delay(2000); // Aspetta 2 secondi
}

WHAT HAPPENS and Hypothesis:

  1. If I connect the motor directly to the power supply it works just fine (so the motor works)
  2. The led on Arduino Uno is light up (when connected to laptop via usb)
  3. The led on the L293D shield lights up when I connect the external battery
  4. The sketch compiling is successful (no error)
    What could be the reason why the motor is not moving at all? Is it the code, the wiring or the Power Supply insufficient? (perhaps not all 12V get to the motor?)
    If you can suggest what check I can to to find the problem, I'll follow up. I have a multimeter but not sure how to use it in this case.

Thanks!

You have a v1 motor shield, which uses the AFMotor library, which will not compile on the R4.

Your Adafruit_Motorshield library, which does compile on the R4, will only work with a v2.x motor shield.

You will either need to use a v2.x motor shield with the R4, or an R3 and the AFMotor library.

Thanks for your reply!
Is the following shield compatible?

https://amzn.eu/d/518UqJK

Perhaps, given that I will need to run only 1 motor (in both directions), can I just use the l293d chip instead of a full shield? Is the following compatible with arduino r4?

https://amzn.eu/d/6XBLBkW

Thanks for your time, it’s quite difficult for me to find informations about board compatibility