The safe and proper power supply design for a system consisting of an Arduino Uno, an ultrasonic sensor, and an ESP32 using a 12V source

Hi,

I have a question about powering my project.

I want to use a 12V adapter to power the following setup:
Arduino Uno
RCWL-1655 ultrasonic sensor (connected directly to the Arduino)
ESP32 (powered separately through the breadboard)

My idea is:
supply 12V to the Arduino Uno (via VIN or barrel jack)
power the ultrasonic sensor directly from the Arduino (5V and GND)
power the ESP32 from the Arduino’s 5V (or VIN) through the breadboard

I am not sure if this is safe and stable.

My questions are:
Is it OK to power everything from the Arduino regulator using 12V input?
Will the Arduino regulator handle the current for Arduino + sensor + ESP32?
Should I instead use a buck converter (12V → 5V) and power everything from that?

I would appreciate any advice on the correct and safe way to power this setup.

Don't use any microcontroller as powersupply. One or two LED might be okey. The little 5 volt converter will be overloaded and burn.

No.

Will the Arduino regulator handle the current for Arduino + sensor + ESP32?

No.

Should I instead use a buck converter (12V → 5V) and power everything from that?

No.

Thank you, so the correct approach would be to use a buck converter (12V to 5V) and power all modules from that, instead of using the Arduino regulator, correct?

What would be the correct way to power this system?

That depends on what the Uno and ESP are doing.
If you have an ESP32 why do you need an Uno?

I am building a smart parking system where each parking spot has its own setup.

I am using the Arduino Uno to read the data from the ultrasonic sensor (RCWL-1655), because it works well with 5V sensors.

Then I use the ESP32 to handle communication (WiFi) and send the data to a web application.

So basically:
Arduino Uno reads the sensor
ESP32 sends the data to the server
That’s why I am using both boards.

If this is the same sensor that you used in your other topic, then it should also work at 3.3V and no need for the Uno.

If your RCWL only works on 5V, then you could use level shifters to interface it with the ESP, eliminate the Uno and then you would only need one 5V supply.

You do NOT need the UNO. If the sensor is really 5V use a level shifter but check the data sheet, it may work fine at 3.3V

I just googled it and got

The RCWL-1655 waterproof ultrasonic sensor operates on a wide supply voltage range of 2.8V to 5.5V DC.

  • Operating Voltage: 2.8V – 5.5V
  • Logic Level: The output signal (ECHO pin) matches the supply voltage, making it compatible with both 3.3V (e.g., ESP32, Raspberry Pi) and 5V (e.g., Arduino Uno) microcontrollers.
  • Working Current: Approximately 3.5mA to 4mA.
  • Detection Range: 20cm to 400cm (at 3.3V) or up to 600cm (at 5V).

If you decide to use the level shifters, let me know, otherwise:

Safe way:
Power Uno with 9V, 2A power supply
Power RCWL from Uno 5V output.
Power ESP32 with a 9V to 5V buck from the 9V, 2A supply.

@jim-p

Why not directly use a 5V supply?

Only problem with the Uno is that it's not advised to use USB while external 5V is connected to the 5V pin. In which case one can replace the Uno with a Nano.

It wasn't your question, but how are you planning to communicate between the Uno and the ESP32?

For reference, this is the other topic:

But now it has an Uno too.

Actually, you didn’t explain why the same sensor doesn’t work well with 3V3.

+1 to drop out the Uno and use just the ESP.

Because @k4sl asked for a safe and proper design.