Using Ultrasonic with ESP32

Good day
Can someone help me power three ultrasonic sensor connected with ESP32. When it is connected to my laptop, and the switch is turn off, the ultrasonic runs smoothly... it can detect distance

while complete opposite for when the switch is on or battery powered with 2x 3.7V (7.4V) 18650 battery stepdown to 5V using the LM2596 buck converter, the ultrasonic sensors with its led indicator doesn't work at all

I suspect my power source is not enough when all components are combined? if so what should i do? should i use another external to power different components?

There are a few possible reasons for this problem.
First, it's possible that the batteries you are using are not providing enough current to power all the components properly. Ultrasonic sensors typically require a certain amount of current to operate correctly, and if the power source cannot supply enough current, the sensors may not work as expected. In this case, using a different power source or adding additional power supplies to handle the load could be a solution.

  1. Check the current rating of the batteries: If the current rating is too low, consider using batteries with a higher current output or switching to a different power source altogether.
  2. Measure the voltage and current: Use a multimeter to measure the voltage and current at different points in the circuit. Check if the voltage remains stable and if the current meets the requirements of the ESP32 and the ultrasonic sensors..
  3. Check the power connections: Verify that the power connections between the batteries, ESP32, and the ultrasonic sensors are correct and secure. Ensure that there are no loose connections or voltage drops along the circuit.
  4. Consider using separate power supplies: If the combined power draw of the ESP32 and the ultrasonic sensors is too high for the current power source, you can try using separate power supplies. For example, you could power the ESP32 from the batteries, while using a separate power supply to directly power the ultrasonic sensors. Be sure to connect the ground (GND) of both power supplies together.
  5. Optimize power consumption: Review the power consumption of your circuit and identify any components or functions that may be consuming excessive power. Look for ways to optimize the power usage, such as reducing the duty cycle of the sensors or minimizing unnecessary operations.

I have redo the schematics of the power sources
Can you check if this is right?

Kindly share the code as well!

What is the Ah (ampere-hour) marked/written on the 1x3.7V battery? What are the purposes of the other two boards other than the 3xUltrasonic?

it is 2,000mAh and the purpose of the other module is a GPS module that finds the location of the whole prototype, while the buck converter controls the other power source into 5V

Update: I have rewire everything according to this schematics,


but it only the left-most ultrasonic sensor works... idk why that particular part so I did change the order of the ultrasonic... still the left most
so I did check the wires with my multimeter, and they are all working

any other way to troubleshoot this?

1. Disconnect everything from ESP32.
2. Connect one Ultrasonic, one LED; operate the setup using PC.
3. If Step-2 is ok, then check its operation using 1x3.7V battery.
4. Connect 2nd ultrasonic and LED; operate the sub-system using PC.
5. If Step-4 is ok, then check its operation using 1x3.7V Battery.
6. and so on until the whole system works with Battery setup.

i solved this by using a powerbank as its power source in the first schematics since it works fine if the proto is plug in to my laptop
thank you

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.