Author Topic: USB/VIN Switch Mechanism for Custom ESP32 Board  (Read 216 times)

0 Members and 1 Guest are viewing this topic.

Offline czagrzebskiTopic starter

  • Newbie
  • Posts: 1
  • Country: us
USB/VIN Switch Mechanism for Custom ESP32 Board
« on: April 14, 2024, 05:48:55 pm »
Hello.

I am designing a PCB for an ESP32 that features an LM2596 switching regulator to power the chip using a 7 to 12v DC input. I am also allowing the board to be powered through the USB-C port when VIN is not present. As a result, I designed a switching mechanism to toggle between VIN and VBUS to prevent power from going back onto the USB-C port when VIN is present. I have a P-Channel FET for the VBUS that is toggled off by a divider when VIN is present. However, I have a concern regarding when VIN is not plugged in and VBUS is.

My main concern is the 5V from VBUS that will be present on the output of the switching regulator when VIN is not present (i.e., Vin < Vout). Will this be a problem? I have seen designs that use the AMS1117 LDO (https://learn.adafruit.com/assets/98525) that put voltage back on the output of the regulator when VIN is not present, but I was wondering if this is ok for the LM2596. Attached is the schematic of the LM2596/switching mechanism.

Thanks,


« Last Edit: April 14, 2024, 05:50:31 pm by czagrzebski »
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 6857
  • Country: va
Re: USB/VIN Switch Mechanism for Custom ESP32 Board
« Reply #1 on: April 14, 2024, 06:33:57 pm »
Why not just post the netlist?

Seriously, you have USB_PORT_D_N label right next to a USB_PORT_D_N label! Just join the things up and then you can visually see that the former is joined to the latter. As it is, you have to read the damn label and then go looking for where (on the entire sheet) it might be used.

Similarly, where the Vin 5V meets the USB 5V it would be more obvious what's going on  if it were actually visually connected. You can still put boxes around the appropriate parts, but for pities sake joined up the dots.
 

Offline xvr

  • Regular Contributor
  • *
  • Posts: 172
  • Country: ie
    • LinkedIn
Re: USB/VIN Switch Mechanism for Custom ESP32 Board
« Reply #2 on: April 14, 2024, 06:44:15 pm »
On 7V Vin your MOSFET will not be closed - after divider you got 3.5V that less, than 5V of VBUS. MOSFET got 1.5V on gate and will be [partially] open.

Why not just put 2 diodes and ored both power source?
 

Offline fchk

  • Regular Contributor
  • *
  • Posts: 245
  • Country: de
Re: USB/VIN Switch Mechanism for Custom ESP32 Board
« Reply #3 on: April 14, 2024, 06:47:09 pm »
This problem calls for an ideal diode. Ideal diodes have got only very small forward voltages.

This would solve your problem:

https://www.analog.com/media/en/technical-documentation/data-sheets/4413fd.pdf

fchk
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf