Hello,
I’m using the VNH5019 Motor Driver Carrier (Pololu - VNH5019 Motor Driver Carrier) to control a 12v motor with an ESP32. I have followed the wiring directions shown on the driver’s page. When all connections are done, the driver’s LED turns on. However, as soon as I connect the motor, the LED turns off. I am using a 12 volt DC power supply for the motor.
The test code i’m using is as follows:
#define MOTOR_IN1 21
#define MOTOR_IN2 12
#define PWMPIN 4
#define frequency 40000 //490
#define resolutionbit 8
int speed = 255;
void setup() {
Serial.begin(115200);
Serial.println("VNH5019");
Serial.println("**************************************");
pinMode(MOTOR_IN1, OUTPUT);
pinMode(MOTOR_IN2, OUTPUT);
ledcAttachPin(PWMPIN, 0); // assign the speed control PWM pin to a channel
ledcSetup(0, frequency, resolutionbit);
}
void loop() {
digitalWrite(MOTOR_IN1, HIGH);
digitalWrite(MOTOR_IN2, LOW);
ledcWrite(0,speed);
delay(1);
}
Lastly, I noticed that when the motor is not connected, the voltage coming out of the motor pins is 5.16 volts which is about the same as what is being fed to the ESP32. shouldn’t that voltage be 12v or close to it?
Any help would be appreciated.
Thank you.