0
\$\begingroup\$

I have an ESP32 (ESP-WROOM-32) on a dev board, the same as pictured here:

enter image description here

It will be used in a project and powered by an external 3.3 V power supply through the 3.3 V and GND pins.

I'll need to communicate with the help of the USB to serial converter of the dev board, through a USB cable. So when the USB cable is plugged, the AMS1117 regulator will be powered by the 5 V line of the USB cable and produce its own 3.3 V supply, on the same voltage rail as the external power supply.

It's not an option to disconnect the external power supply while using the USB port, so I was wondering if it could cause any issue.

From what I understand:

  • If the AMS1117 3.3 V voltage is higher than the external power supply's, some current will go to the power supply and start charging its capacitors at a rather slow rate, which should not be a problem (the regulation will do its job).
  • If it's the other way around, the small excess voltage will cause the AMS1117's output to be at a slightly higher voltage than it should, and what happens depends on its internals.

For the second option, I assume that the AMS1117 can probably take it, but I have nothing to base this intuition on. I searched for more info, but everything I found is about not using Vin together with USB, which is not what I'll be doing.

There is also a diode between the Vout pin and the Vin pin of the AMS1117, so anything over ~4.0 V would be fed back to the Vin pin of the AMS1117.

What's your opinion on this? How can I know if it's going to be a problem or not, short of trying it and see if something burns?

\$\endgroup\$
5
  • \$\begingroup\$ The AMS1117 is a very cheap and not very good regulator, so I would rethink your assumption that the AMS1117 "can probably take it". The diode from Vout to Vin is to protect the regulator from the situation where Vout ≫ Vin (for instance, if there's power from an alternative source and Vin is disconnected), which will cause issues in many linear regulators. \$\endgroup\$
    – Hearth
    Dec 19, 2023 at 16:05
  • \$\begingroup\$ Exactly what happens when the 1117 has a higher output voltage than the external supply depends on the external supply, however. What is your external supply, specifically? \$\endgroup\$
    – Hearth
    Dec 19, 2023 at 16:06
  • \$\begingroup\$ You can just remove the AMS1117. Specially if you need to save power. It consumes power even when not used and it's not very efficient. The same for the led, if you don't need it you will save a few mA. \$\endgroup\$
    – Gos
    Dec 19, 2023 at 16:20
  • \$\begingroup\$ @Hearth I'm taking the 3.3V from an ATX power supply of a PC. The USB cable will be connected for serial communication. \$\endgroup\$
    – Bradlin
    Dec 19, 2023 at 18:28
  • \$\begingroup\$ @Gos indeed I could just remove it. I think that's what I'll do if I cannot ensure that it is safe to keep it. \$\endgroup\$
    – Bradlin
    Dec 19, 2023 at 18:29

2 Answers 2

1
\$\begingroup\$

The simplest is to remove AMS1117 and apply your external 3V3 supply to the corresponding 3V3 pin on the connector.

These ESP32 modules sometimes crash due to transient current demand dropping the "3V3" voltage, for example coming out of wifi-sleep causes quick steps in supply current. The fix is to use a better LDO with fast transient response and replace the tantalum cap with 10µF ceramic. For example LDL1117 works flawlessly.

If you remove the LDO this does not apply, but then the only remaining decoupling on the board for 3V3 will be a high-ESR tantalum cap of unknown origin and a 100nF MLCC. This could be a problem if the supply wires are long. So I'd recommend replacing the tantalum cap with a 10µF ceramic, or simply add an electrolytic cap of few hundred µF on the power pins.

The CP2102 USB chip is powered from USB VBUS and creates its own 3V3 supply via an internal regulator, so it will still work fine and you will be able to program the ESP32 and use the serial port normally even with AMS1117 removed.

According to the datasheet, it is allowed to apply logic level voltage to CP2102 input pins even when it is powered down. So when USB is disconnected, even if ESP32 outputs some serial signals, CP2102 will not be damaged.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks, it works perfectly witthout the AMS1117 in my use case. \$\endgroup\$
    – Bradlin
    Jan 4 at 20:13
0
\$\begingroup\$

To ensure that there would be no problems, the correct way would be a Wired OR, which means having a diode on the output of each power supply. In your case adding a diode on the output of the AMS1117 would drop it's voltage and a bit complicated to do actually. If having two sources of voltages is a must, then maybe get an adjustable regulator and use a diode(putting the feedback resistor after the diode to compensate for the voltage drop), alongside with your external regulator which should have a diode of it's own.

If only one source will suffice, than maybe doing as @Gos said and remove the regulator altogether.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.