How to prevent a battery powered microcontroller(ESP32) from reseting when motors start running?
You must make sure that the motors do not drain your capacitor. Try adding a (Schottky) diode before the LDO and put the capacitor after the diode and before the LDO:







simulate this circuit &ndash; Schematic created using CircuitLab