Hello everyone,
I’m building a small car controlled via a PS4 controller. The software works fine, but I’m having hardware issues.
When the ESP32 is powered through its mini USB port, everything works: the controller connects, sends commands, and the motors respond. The motors are powered separately by 4 AAA batteries (6V total) to avoid overloading the ESP32.
However, when I try to power the ESP32 from the same 6V source using an AMS1117 voltage regulator, the circuit initially works but stops when I quickly reverse the motors’ direction. It seems like the ESP32 loses connection with the controller.
components i'm using:
-esp32: DevKitC V2 esp32-wroom-32 made by Az-Delivery. (datasheet: https://azde.ly/embeajwu)
-"TT motor" made bySunfounder (info: TT Motor — SunFounder 3in1 Kit documentation)
-Ams1117 module 3.3V Stepdown voltage regulator made by Az-Delivery (datasheet: https://cdn.shopify.com/s/files/1/1509/1638/files/AZ050_B_2-1_IT_B072FTMS89_5b294f9f-122a-4cc7-b60c-0cb685c32523.pdf?v=1721113156)
-L298N module made by ATOYT, brand = xocome (I could not find the datasheet for this module, but this one should do: https://www.handsontec.com/dataspecs/L298N%20Motor%20Driver.pdf?)
-4 AAA batteries in series as the power supply.
Circuit Schematic
I hope the photo makes the circuit layout clear. I apologize in advance for any inaccuracies, as I’m a beginner and this is my first attempt at drawing a circuit diagram.
(P.S.: The GND connected to the ESP32 is shared with the GND of the battery pack. I’ve shown it separately for clarity and organization purposes.)
conclusions
I’m a beginner, and I recognize that this is an ambitious project for me, so the issue is likely related to incorrect power supply (I’m not sure how to calculate the current requirements for each component). I also considered that since I’m using a 6V power supply, I should connect 5V to the logic of the L298N module (according to the datasheet, it can be left unconnected only if using a 7V or higher supply). I left it unconnected, but before spending more money on voltage regulator modules, I prefer to ask someone with more experience.
What do you think is causing the problem? Should I change the type of battery or something else?
(I haven’t included the code because, as mentioned, everything works fine when the ESP32 is powered from the PC, but if you think it’s necessary, let me know, and I’ll share it.)
I appreciate any suggestions or help. Thank you!






