[Solved] Why ACS70331 and ACS712 make ESP32 crash when current changes?
Posted: Wed Apr 15, 2020 2:10 pm
[Solved] DC motor without the spark cap crashed everything.
Hi, My ESP32 dev boad is MH-ET ESP32MiniKit.
Lately, I tried to use ACS70331and ACS712 to measure the current of my robot's DC motor. But ESP32 crashed when the current changed rapidly.
The motor's stall current I measured from my multimeter is about 1.6~2A. So first I tried ACS70331-2P5B3 which range is -2.5A~+2.5A and a 3.3V sensor.
The current result is good when the motor has no load or small load. Everything is fine, the system never crashed. But I tried to put some friction to the wheel with my hand to test and even stop the wheel to make the motor stall. If the current of the motor changed severely by hold and release the wheel repeatedly. ESP32 crashed with random reasons like invalid instruction, load prohibited, write prohibited, watchdog... on core 1 or core 0 cause I use both cores for my robot system.
I checked with the backtraces of the reboot report. And the last function is unreasonable. I thought there should be a hardware failure.
And I tried to use the ADS1015 module to test the voltage of ACS70331. But ESP32 still crashed. And I found out even I tried not to connect the wire between ACS70331's output pin and ADS1015's input pin. ESP32 also crashed. It was not about ADC values at all.
I only connected ACS70331's GND pin to my ESP32 system's GND and used a separate battery to supply voltage for the ACS70331. The current change also crashed ESP32.
And I add an extra battery to supply power for my ESP32MiniKit board to help the USB cable. Nothing changed. ESP32 crashed easily.
Then I thought maybe my ACS70331 sensor was broken, I replaced it with a new chip, but the problem still existed.
I replaced ACS70331 with ACS712-05B which is -5A~5A 5v sensor.
I used a voltage converter to set ADS1015 into the 5V stage and measured ACS712-05B's output with it. The result is good for a small load just like ACS70331. But the 'heavy-duty' test also made the ESP32 crash. But the chance is smaller, about 20% of ACS70331. ESP32 seemed tougher with ACS712.
I tested with ACS712-30A which is -30A~30A range 5V sensor, ESP32 also crashed. It felt like the same as ACS712-05B.
By the way, If I hold the wheel to stall the motor for a couple of seconds, the value result is good and ESP32 won't crash. The current changing crashed ESP32.
And sometimes especially tested with ACS712 (ESP32 is tougher), the CP210X of ESP32MiniKit will crash first. I lost the serial connection to report the values. I added a simple blink to identify if ESP32 was still working, it seemed ESP32 did not reboot when Serial is down.
I tested ACS70331 again, I got a reboot report, ESP32 was down first.
What's the cause of the crash? How to deal with it?
Hi, My ESP32 dev boad is MH-ET ESP32MiniKit.
Lately, I tried to use ACS70331and ACS712 to measure the current of my robot's DC motor. But ESP32 crashed when the current changed rapidly.
The motor's stall current I measured from my multimeter is about 1.6~2A. So first I tried ACS70331-2P5B3 which range is -2.5A~+2.5A and a 3.3V sensor.
The current result is good when the motor has no load or small load. Everything is fine, the system never crashed. But I tried to put some friction to the wheel with my hand to test and even stop the wheel to make the motor stall. If the current of the motor changed severely by hold and release the wheel repeatedly. ESP32 crashed with random reasons like invalid instruction, load prohibited, write prohibited, watchdog... on core 1 or core 0 cause I use both cores for my robot system.
I checked with the backtraces of the reboot report. And the last function is unreasonable. I thought there should be a hardware failure.
And I tried to use the ADS1015 module to test the voltage of ACS70331. But ESP32 still crashed. And I found out even I tried not to connect the wire between ACS70331's output pin and ADS1015's input pin. ESP32 also crashed. It was not about ADC values at all.
I only connected ACS70331's GND pin to my ESP32 system's GND and used a separate battery to supply voltage for the ACS70331. The current change also crashed ESP32.
And I add an extra battery to supply power for my ESP32MiniKit board to help the USB cable. Nothing changed. ESP32 crashed easily.
Then I thought maybe my ACS70331 sensor was broken, I replaced it with a new chip, but the problem still existed.
I replaced ACS70331 with ACS712-05B which is -5A~5A 5v sensor.
I used a voltage converter to set ADS1015 into the 5V stage and measured ACS712-05B's output with it. The result is good for a small load just like ACS70331. But the 'heavy-duty' test also made the ESP32 crash. But the chance is smaller, about 20% of ACS70331. ESP32 seemed tougher with ACS712.
I tested with ACS712-30A which is -30A~30A range 5V sensor, ESP32 also crashed. It felt like the same as ACS712-05B.
By the way, If I hold the wheel to stall the motor for a couple of seconds, the value result is good and ESP32 won't crash. The current changing crashed ESP32.
And sometimes especially tested with ACS712 (ESP32 is tougher), the CP210X of ESP32MiniKit will crash first. I lost the serial connection to report the values. I added a simple blink to identify if ESP32 was still working, it seemed ESP32 did not reboot when Serial is down.
I tested ACS70331 again, I got a reboot report, ESP32 was down first.
What's the cause of the crash? How to deal with it?