My ESP32 keeps resetting when the motors start

Well how about first you provide is with a full schematic.