Page 1 of 1

Actuator limit switch causing ESP32 reset

Posted: Wed Jul 22, 2026 3:06 am
by JamesZhang
Hi! I'm controlling a linear actuator with the ESP32 and the microcontroller randomly reset when the actuator limit switch is triggered. I tried a lot of stuff but still haven't managed to get it working yet. Any help is greatly appreciated! Details:

Actuator model: Prorgessive Automations PA-01 (24V 2A, 16lbs, 8", with hall feedback, link). This actuator has limit switches (contact switches) that cut off motor power, and does not provide signal to external hardware.
Microcontroller: ESP32-S3-WROOM-1 (resets occur with Arduino Nano as well)
Driver: Adafruit DRV8871 (up to 45V 3.6A)
Power supply: Mean Well 24V 6.67A (currently using an adjustable 24V 2A PSU for testing, but the issue persists across both supplies)
Resets: always occur right before or after a limit switch is triggered, and is always reported as an interrupt watchdog timeout (even if no interrupts are used) or a Serial freeze without report. This can happen in the first 10 limit switch activations or after 400 activations and seems random. They happen even when the actuator is under manual push-button control and the ESP is simply printing millis() every second.
Wires: 24V power lines are 18 AWG or thicker. Signal lines are typical jumper wires. All wires are in twisted pairs.

Oscilloscope measurements:
When limit switches are triggered, voltage fluctuations lasting ~500ns can be observed in the motor leads and the microcontroller power rail. Specifically, Vmotor can spike or drop by ~20V amplitude for a few nanoseconds at the motor driver. Please refer to the image at the end of the post.
Unfortunately, I don't have access to H- or E-field probes.

Some troubleshooting attempts:
Disconnecting hall feedback did not solve the problem.

I added 100nF ceramic capacitors and 100uF electrolytic capacitors at the motor terminals and the microcontroller power rails. This did not solve the issue.

Clamp-on ferrite beads did not help.

A makeshift grounded metal cage covering the microcontroller did not seem to help. I can try more professional cages, but only if that's the only option.

The actuator reset the ESP32 even when completely electrically isolated (separate power supply, no shared ground, no electrical connection, running no code).

The only attempt that worked was placing the ESP32 50cm away from the actuator.

I suspect that the cause is some sort of electromagnetic interference emitting from the limit switches. Does the PA-01 have anti-EMI design (internal capacitors, etc.)? How can I resolve this issue?

Attachments:
Circuit layout:
Circuit diagram.jpg
Circuit diagram.jpg (175.5 KiB) Viewed 15 times
Physical layout:
Physical layout.png
Physical layout.png (6.43 MiB) Viewed 15 times
ESP32 control code (resets still happen if the actuator is manually controlled and the ESP32 runs no code):
ESP32 code.png
ESP32 code.png (159.35 KiB) Viewed 15 times