Help! ESP32 burnt by Motor Drive Module.
Posted: Sun Apr 07, 2019 10:31 am
Hi, my dev board is MH-ET ESP32 Mini Kit.
I got issues by using PWM driving 2 N20 Motors(1:50, 6V).
I've found that sometimes my robot reboot when the motor start or change its direction.
So I make a simple programme to reproduce the error. Something like Blink Example, change 2 N20 Motor direction in full power.
I used L9110s Dual Moter Drive Module and the code was something like this:
During the Motor switching directions, I also used I2C to get a MPU6050's Z angle and SPI to get a PS2 controller pad's input.(which
is needed by my robot project), I used Serial.print() to debug them.
I had an issue with my I2C MPU6050 with the motor test, the I2C communication seemed not working. The SPI PS2Controller works. And it seemed the Serial affected later.
Then, I damaged this MH-ET ESP32 Mini Kit with this motor test for about 3 minutes. The core got hot, and it's small LDO seems very hot, I couldn't touch it. No sketches could be uploaded to this damaged dev board.
I used another MH-ET ESP32 Mini Kit to continue the test, and I reproduced this I2C failure, it happened 100%, no randomness at all. This time, I didn't try another 3 minutes test.
And I switch to another drive module which using MX1508. Same result.
And I disconnect the Motor Drive Module and use 2 RGB LED to display my PWM status to check if my code is the reason.
No error was found. LEDs, MPU and SPI worked. And minutes passed, no damage to my dev board. I think it must be a hardware failure.
I'm not an expert in hardware. I know the motor is a 'dangerous' device so the motor uses a separate external power source. I got a 6V power to feed the Drive Module's Power Pins and connect only the 6V power's GND with my ESP32 Mini Kit's GND. My dev board was using USB's 5V as power. So there is only the PWM signal wires between the Drive Module and my ESP32.
I know when start or change direction, the motor will almost shortcut. That's why I make this test. Cause it's a usual situation for a robot in a race or competition. But I didn't know that move will damage the Microcontroller.
And I tried to slow down the speed. I used 10 to reproduce the I2C failure at which the motor didn't move at all.
I used 255 full power with no direction switch. Everything was fine. So there must be something in the PWM signal lines when motor's changes its direction.
Does the Motor Drive Module produce currents pulse in the Signal Lines which exceed ESP32's voltage or amp limits?
How to prevent that? The L9110s Module already gets 0.1uf capacity between the Motor Pins and 2 other capacities to the Power Pins.
I got issues by using PWM driving 2 N20 Motors(1:50, 6V).
I've found that sometimes my robot reboot when the motor start or change its direction.
So I make a simple programme to reproduce the error. Something like Blink Example, change 2 N20 Motor direction in full power.
I used L9110s Dual Moter Drive Module and the code was something like this:
Code: Select all
Motor()
{
// ledc is 8 bit, 255 is full power
// Direction 1
ledcWrite(motor_1_channel_a, 255);
ledcWrite(moter_1_channel_b, 0);
ledcWrite(motor_2_channel_a, 255);
ledcWrite(moter_2_channel_b, 0);
delay(100);
// Direction 2
ledcWrite(motor_1_channel_a, 0);
ledcWrite(moter_1_channel_b, 255);
ledcWrite(motor_2_channel_a, 0);
ledcWrite(moter_2_channel_b, 255);
delay(100);
}
is needed by my robot project), I used Serial.print() to debug them.
I had an issue with my I2C MPU6050 with the motor test, the I2C communication seemed not working. The SPI PS2Controller works. And it seemed the Serial affected later.
Then, I damaged this MH-ET ESP32 Mini Kit with this motor test for about 3 minutes. The core got hot, and it's small LDO seems very hot, I couldn't touch it. No sketches could be uploaded to this damaged dev board.
I used another MH-ET ESP32 Mini Kit to continue the test, and I reproduced this I2C failure, it happened 100%, no randomness at all. This time, I didn't try another 3 minutes test.
And I switch to another drive module which using MX1508. Same result.
And I disconnect the Motor Drive Module and use 2 RGB LED to display my PWM status to check if my code is the reason.
No error was found. LEDs, MPU and SPI worked. And minutes passed, no damage to my dev board. I think it must be a hardware failure.
I'm not an expert in hardware. I know the motor is a 'dangerous' device so the motor uses a separate external power source. I got a 6V power to feed the Drive Module's Power Pins and connect only the 6V power's GND with my ESP32 Mini Kit's GND. My dev board was using USB's 5V as power. So there is only the PWM signal wires between the Drive Module and my ESP32.
I know when start or change direction, the motor will almost shortcut. That's why I make this test. Cause it's a usual situation for a robot in a race or competition. But I didn't know that move will damage the Microcontroller.
And I tried to slow down the speed. I used 10 to reproduce the I2C failure at which the motor didn't move at all.
I used 255 full power with no direction switch. Everything was fine. So there must be something in the PWM signal lines when motor's changes its direction.
Does the Motor Drive Module produce currents pulse in the Signal Lines which exceed ESP32's voltage or amp limits?
How to prevent that? The L9110s Module already gets 0.1uf capacity between the Motor Pins and 2 other capacities to the Power Pins.