Something wrong with the circuit-ESP-32s not working as intended.

Thread Starter

Parapara29

Joined Apr 23, 2024
10
Hi there!
I am facing a weird issue with my circuit currently, where even though the inbuilt ESP-32s LED lights up, the ESP does not work the components connected to it. More explanation on this is described as follows: The cytron mdd3a driver that I am using is a buck convertor type driver which can also supply upto 5v. I am using that to power up my ESP-32s, but that is somehow not working, meaning the ESP does not run any code even though the LEDs on the ESP turn on. When I try to power the ESP by the buck convertor(LM2596S) that I am using to power the ESP, using just the 5V output from the convertor, I face the same issue. I am also using DC 12V encoded motors (Encoders powered by 5v supply from the buck convertor, the ground being common between the encoders and the ESP) and 3S battery, MPU6050 for the IMU, and I could not find the cytron mdd3a driver on fritzing anywhere, hence am using the mdd10a, but the wiring is mostly the same. Just the cytron mdd3a having a 5V output as well.
Now, when I do not connect either of them to the ESP and just power the ESP via USB from my laptop, the code "lags" or the ESP just stops responding. The circuit diagram that I am using is here:
r/arduino - Help needed with self balancing robot circuit
if you'd like to get a closer look, there's also a fritzing file at this link: https://drive.google.com/file/d/1At_DHDWQc6BU1TPhMWUa1kaSGdjD0Wp2/view?usp=sharing
I am sure that there is a small thing I might be missing, but any help will be much appreciated. Also, I am not from an Electrical background and am still learning hence why my questions are mostly on the circuit. Can anyone please look into this and let me know what might be the problem?
Thanks in advance!
 

dl324

Joined Mar 30, 2015
16,996
Welcome to AAC!
The circuit diagram that I am using is here:
It would be helpful if you posted a block diagram that was easier to read. We keep wires multiples of 90 degree angles unless there's a good reason to deviate from the norm and we try to avoid unnecessary wire crossings.
 

Thread Starter

Parapara29

Joined Apr 23, 2024
10
Welcome to AAC!

It would be helpful if you posted a block diagram that was easier to read. We keep wires multiples of 90 degree angles unless there's a good reason to deviate from the norm and we try to avoid unnecessary wire crossings.
Hi, thanks for replying, please find the block diagram of the circuit, for your reference. I did not add the signal connections, but just the power and the ground. Hopefully it's clear enough now.

1713897202398.png
 

dl324

Joined Mar 30, 2015
16,996
You show multiple GND, 5V, and 11.1V connections, but you don't show them being connected explicitly. Are they actually connected?

Does incorrect operation involve motors being turned on? Do you have back EMF diodes on the motors?
 

Thread Starter

Parapara29

Joined Apr 23, 2024
10
You show multiple GND, 5V, and 11.1V connections, but you don't show them being connected explicitly. Are they actually connected?

Does incorrect operation involve motors being turned on? Do you have back EMF diodes on the motors?
I am not sure what you mean by explicit connections, but they are connected with each other, if that is what you were asking. No, the incorrect operation means that even after connecting the ESP to the buck converter as shown, the ESP is not running the code (the inbuilt LEDs, are on though). However, once I connect the USB connection of the ESP to the laptop, the code starts running. I don't have back EMF diode on the motors.
 

dl324

Joined Mar 30, 2015
16,996
I am not sure what you mean by explicit connections, but they are connected with each other, if that is what you were asking.
Standard procedure is to assume that nets are "connected by name", but inexperienced people don't necessarily follow the usual conventions.
However, once I connect the USB connection of the ESP to the laptop, the code starts running.
Have you checked to make sure all voltages are within acceptable ranges before you connect USB power?
 

Thread Starter

Parapara29

Joined Apr 23, 2024
10
Standard procedure is to assume that nets are "connected by name", but inexperienced people don't necessarily follow the usual conventions.
Have you checked to make sure all voltages are within acceptable ranges before you connect USB power?
Yes, the voltages were all in the acceptable range. One thing I am concerned about is the common ground for the circuit. Do i also need to connect the battery ground to the ESP ground to have a common reference?

Thanks a lot for the help so far!
 

dl324

Joined Mar 30, 2015
16,996
One thing I am concerned about is the common ground for the circuit. Do i also need to connect the battery ground to the ESP ground to have a common reference?
It would be unusual for all grounds to not be connected. Ground from the USB connector is likely connected to earth ground. Not having specifics for the power sources you're using, I don't know if that's significant.

FWIW, I rarely connect ground from my power supplies to earth ground. But, as soon as I connect one of my analog scopes to the circuit, that connection gets made.
 

Irving

Joined Jan 30, 2016
3,980
Not only should you have a common ground, all grounds should connect to a single point, usually the power supply. Otherwise noise on the ground wiring can severely impact the operation of the system, particularly where motors are involved.

1713905949489.png

If the code starts running with the USB plugged in, it could be a grounding issue, or it could be the way you've configured the serial interface. If you've used it for debugging its possible that the ESP32 is hanging, waiting to send, or receive, something to/from the host.
 

Thread Starter

Parapara29

Joined Apr 23, 2024
10
Not only should you have a common ground, all grounds should connect to a single point, usually the power supply. Otherwise noise on the ground wiring can severely impact the operation of the system, particularly where motors are involved.

View attachment 320577

If the code starts running with the USB plugged in, it could be a grounding issue, or it could be the way you've configured the serial interface. If you've used it for debugging its possible that the ESP32 is hanging, waiting to send, or receive, something to/from the host.
I see. Thanks for the help, I will try it out and will update.
 

Thread Starter

Parapara29

Joined Apr 23, 2024
10
It would be unusual for all grounds to not be connected. Ground from the USB connector is likely connected to earth ground. Not having specifics for the power sources you're using, I don't know if that's significant.

FWIW, I rarely connect ground from my power supplies to earth ground. But, as soon as I connect one of my analog scopes to the circuit, that connection gets made.
Thanks for the help, I will check it out and let you know.
 

Thread Starter

Parapara29

Joined Apr 23, 2024
10
Not only should you have a common ground, all grounds should connect to a single point, usually the power supply. Otherwise noise on the ground wiring can severely impact the operation of the system, particularly where motors are involved.
Hi, following your comment, I remade the circuit like so, however the ESP still is not working properly and it shows me as invalid packet header. Is there still something wrong with the circuit?

Please forgive me if the question seems redundant, but as I said, I am quite new to this stuff and can't figure out the error.
1714054861462.png
 

geekoftheweek

Joined Oct 6, 2013
1,240
On your schematic it shows a connection to pin 12 that may be the cause. On the ESP32 boards I have if you power it through the 5V pins instead of the USB port you need to pull pin 12 low in order for it to boot. Pin 12 has something to do with the boot procedure. Something with being connected to the USB makes it happen normally (I have not bothered to figure out exactly what makes it work).
 

Irving

Joined Jan 30, 2016
3,980
Geek beat me to it... using pin12 incorrectly will generate an Interrupt Watchdog Timeout and my experience of this is that basically it seems to stall one core of the ESP32, so best to leave it alone.

What motors are u using?
What gauge wire to connect everything?

Don't use breadboard for power wiring, its rubbish!

Have you validated that ESP32 talks to motor driver, reads encoders, etc? Can you run basic functions like forward/backward/ramp speed up & down/etc?

Bedtime now... more tomorrow...
 
Last edited:

geekoftheweek

Joined Oct 6, 2013
1,240
using pin12 incorrectly will generate an Interrupt Watchdog Timeout and my experience of this is that basically it seems to stall one core of the ESP32, so best to leave it alone.
Out of curiosity I did some digging...

Pin 12 is used to configure an internal voltage regulator for flash memory at boot. If it is low (0V) it sets the regulator output to 3.3V and if high it sets the regulator output to 1.8V. Basically it would cause the flash to not work which is probably where the watchdog timeout would come from... it's not able to load anything.
 

Irving

Joined Jan 30, 2016
3,980
Get yourself one of these breakout boards, make sure its the right pin spacing for your 38-pin ESP32 (there are wide and narrow versions), and some of these Wago connectors (or cheap Chinese equivalent) with 2, 3 and 5 ports..
1714131046680.png1714132134569.png

Using 20 or 22awg (16/0.2 stranded) wire, tidy up your power wiring like this, keeping wires from battery to motor board and motor board to motors (not shown) as short as possible and away from MCU. Don't rely on breadboard push pins, they are really bad where motors are concerned. This arrangement avoids creating 'ground loops' which can severely affect MCU operation.

1714140721422.png

As an aside, I noticed the Node32s board you are using has pin 14 (highlighted in purple above) as VBatt whereas on every other 38pin ESP32 board I've seen its actually a GND. When the board is running, what voltage is on that pin on yours, 0v or 5v?
 

Thread Starter

Parapara29

Joined Apr 23, 2024
10
Get yourself one of these breakout boards, make sure its the right pin spacing for your 38-pin ESP32 (there are wide and narrow versions), and some of these Wago connectors (or cheap Chinese equivalent) with 2, 3 and 5 ports..
View attachment 320812View attachment 320813

Using 20 or 22awg (16/0.2 stranded) wire, tidy up your power wiring like this, keeping wires from battery to motor board and motor board to motors (not shown) as short as possible and away from MCU. Don't rely on breadboard push pins, they are really bad where motors are concerned. This arrangement avoids creating 'ground loops' which can severely affect MCU operation.

View attachment 320816

As an aside, I noticed the Node32s board you are using has pin 14 (highlighted in purple above) as VBatt whereas on every other 38pin ESP32 board I've seen its actually a GND. When the board is running, what voltage is on that pin on yours, 0v or 5v?
Hi, thanks for taking the time out of your day to answer my question. However, unfortunately, the ESP is still not working as expected, after fixing the circuit and making connections according to this diagram. To answer your question, the pin 14 stays at 0V. Also, I checked out the voltages at each point using a multimeter and I found out that the IMU is only getting 1.5V even though its connected at 3.3V output. The voltage that the ESP is getting is around 4.98V. However, when I connect the USB now, the ESP gets the extra 1.5V somehow, and the IMU gets 3.3V, and the circuit runs fine.

Thanks for the help so far, any further help would be much appreciated.
 

Thread Starter

Parapara29

Joined Apr 23, 2024
10
Hi, thanks for taking the time out of your day to answer my question. However, unfortunately, the ESP is still not working as expected, after fixing the circuit and making connections according to this diagram. To answer your question, the pin 14 stays at 0V. Also, I checked out the voltages at each point using a multimeter and I found out that the IMU is only getting 1.5V even though its connected at 3.3V output. The voltage that the ESP is getting is around 4.98V. However, when I connect the USB now, the ESP gets the extra 1.5V somehow, and the IMU gets 3.3V, and the circuit runs fine.

Thanks for the help so far, any further help would be much appreciated.
Also, the ESP is not getting consistent power, the LED light on it is flickering.
 

Thread Starter

Parapara29

Joined Apr 23, 2024
10
H
Get yourself one of these breakout boards, make sure its the right pin spacing for your 38-pin ESP32 (there are wide and narrow versions), and some of these Wago connectors (or cheap Chinese equivalent) with 2, 3 and 5 ports..
View attachment 320812View attachment 320813

Using 20 or 22awg (16/0.2 stranded) wire, tidy up your power wiring like this, keeping wires from battery to motor board and motor board to motors (not shown) as short as possible and away from MCU. Don't rely on breadboard push pins, they are really bad where motors are concerned. This arrangement avoids creating 'ground loops' which can severely affect MCU operation.

View attachment 320816

As an aside, I noticed the Node32s board you are using has pin 14 (highlighted in purple above) as VBatt whereas on every other 38pin ESP32 board I've seen its actually a GND. When the board is running, what voltage is on that pin on yours, 0v or 5v?
Hey, apparently, there were some wires that were the issue after fixing the circuit, but yeah, this circuit works, but there's some problem after a while, everything stops, and i cant figure out the reason.

Thank you for all your help so far!!!!
 
Last edited:
Top