Arduino Uno ESP32 clone compatibility with motor shield

Hello
I got the Arduino Uno and the Arduino Motor Shield Rev3 for my project, and the code from the docs of motor shield worked perfectly, though because I needed BLE functionality I got ESP32 NodeMCU Wemos D1 R32 that is in theory compatible with Uno. All of the pins fit and I adjusted the pins of the sketch to those of the new board and it just doesn't work. None of the lights for motors light up on the shield and I'm wondering if it's just because those boards aren't compatible with each other. Could it be any other issue?

Code:

int directionPinA = 19;
int pwmPinA = 25;
int brakePinA = 13;

int directionPinB = 18;
int pwmPinB = 23;
int brakePinB = 12;

void setup() {
  pinMode(directionPinA, OUTPUT);
  pinMode(pwmPinA, OUTPUT);
  pinMode(brakePinA, OUTPUT);
  pinMode(directionPinB, OUTPUT);
  pinMode(pwmPinB, OUTPUT);
  pinMode(brakePinB, OUTPUT);

  Serial.begin(9600);
}

void loop() {
  Serial.println("Forward");
  forward();
}


void forward() {

  digitalWrite(directionPinA, LOW);
  digitalWrite(directionPinB, LOW);

  digitalWrite(brakePinA, LOW);
  digitalWrite(brakePinB, LOW);

  //set work duty for the motor
  analogWrite(pwmPinA, 500);
  analogWrite(pwmPinB, 500);
}

Pinout I used of the ESP32 WEMOS D1 UNO R32:

An ESP32 runs on 3.3V

an Arduino Uno runs on 5V.

You will have to post a picture of the motorshield and the datasheet of exactly that motorshield
because they deviate from version to version.

On an ESP32 the function for pwm is different than on Arduino Unos
this might be a reason.

Does the manufacturer of the

provide demo-codes?

You should post a link to the ESP32 as well

best regards Stefan

An ESP32 runs on 3.3V
an Arduino Uno runs on 5V.
Yeah

I know, that's exactly why instead of reusing esp32-cam with serial I just got this one. Also, the IOREF pin on this board is 5V, so doesn't this mean that this one runs on 5V?

I got the Rev3 revision of motor shield from arduino store and here are its schematics from the store page (81,3 KB)

When it comes to the manufacturer there's not really much info (I can't even find listings of it outside aliexpress and some small dropshipping stores), only on the listing there's a link to a hackster page with some basic code for built-in led and serial which works without issues.

On an ESP32 the function for pwm is different than on Arduino Unos
this might be a reason.

Sounds likely. Considering it's not some original board and it has a few quirks I think I'll refund this one and go back to looking for alternatives to make uno wireless without making the project too complicated.

Thanks for the help!

The way to go is googling with suitable keywords
pattern
arduino
in this case
https://www.google.com/search?as_q=arduino+ESP32+PWM
which finds

And with this democode you can give it a try

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