Using two LDOs to protect 5V / Vbus on a bluepill ? - Page 1
Forum section: electronics / beginners

author: Jaunedeau
author_rank: Regular Contributor
timestamp: July 01, 2023, 11:17:47 am
content: Hi,I am building something that uses an stm32f103. For cost reduction and simplicity, I will plus a bluepill on my PCB.On the bluepill, Vusb (on the usb connector) is connected either directly or via a diode to 5V (you can't rely on the diode being present). 5V is available through some pins on the bluepill, and it is supplying a 3.3V ldo which in turn make 3.3V available to the microcontroler and to 3.3V pins oc the bluepill.I want to be able to power the blue either via the pcb, the usb connector, or both, and to power on/off the psu of my PCB while the bluepill (only it) stays powered via USB. But since the protection diode is not present on all bluepills, there is a risk that 5Vmypcb is higher than 5Vusb and tries to send current via the usb connector.I was wondering if I could add a 3.3V LDO on my pcb and feed its output to 3.3V pin on the bluepill, hoping that the LDOs on the bluepill and the PCB will act as barriers to prevent 5Vmypcb or Vusb to leak in the other one ?I found no rating for "max voltage on OUT from other source" on the datasheet of the LDO I read. I foundthis documentationwhich explains why I wont double the power using two LDO but this is not my goal.Thanks,J.

author: mon2
author_rank: Frequent Contributor
timestamp: July 01, 2023, 11:26:24 am
content: Recommend to apply two of WCH CH213K ideal diodes, head to head to OR the power rails. This is a new device from WCH in China. Available from their AliExpress store. One will be applied at the output of the 3v3 LDO. Other from the other power source. For the LDO, select one that is low esr cap friendly so you can use ceramics rather than electrolytic or tantalum.

author: ArdWar
author_rank: Frequent Contributor
timestamp: July 01, 2023, 11:45:34 am
content: If you want to OR, just do it at the 5V line with your favourite dual schottky SOT-23 or similar. Widely available, no need for proprietary parts and you only need a single part. From your description you seems not particularly concerned with the 5V rail itself.Although yeah, CH213 indeed sounds interesting. However maybe you need to do OR-ing in 3V3 stage instead (i.e. need your 5Vpcb preregulated) due to the rating being too close for comfort.

author: Jaunedeau
author_rank: Regular Contributor
timestamp: July 01, 2023, 12:04:15 pm
content: I'm not sure I understand what I should ^^I attache a schematic of what I have. The blue rectangle marks components that are already on the bluepill. I do ot want to modify the bluepill (it would be easier to just solder the LQFP mcu than cutting a track, scrapping the soldermask, and soldering a 0402 diode on it)I can easily add a diode between 5Vpcb and Vin of the LDO, but that will only protect the pcb, not the usb charger / host. The solution I was asking about was adding and ldo between 5Vpcb and 3V3, hoping (but not sure) the LDO will protect the usb and pcb connections from eachother.I don't understand how adding a (dual) diode can protect Vusb without modifying the track betweek Vusb and Vin ?thanks,J.

author: ArdWar
author_rank: Frequent Contributor
timestamp: July 01, 2023, 12:59:02 pm
content: Sorry, I misunderstood your situation.So yeah, unfortunately not an ideal situation for the common Blue Pill. The 3v3 rail will be backdriven to 5Vbus.Shouldn't be a problem (I think) if USB port is either left unconnected, or if whatever connected to the USB port always sourcing something >3.3V.For reference, my WeAct blackpill v3 got diode reverse current protection on Vbus.Quote from: Jaunedeau on July 01, 2023, 11:17:47 amThe absolute rating generally follows Vin rating for most LDO, and unless explicitly said otherwise Vout will be simply passed back to Vin when Vout > Vin. It's quite rare to find exception where LDO features reversecurrentprotection.Please beware that sometimes the datasheet will mistakenly list reversevoltageprotection as reversecurrentprotection. Even something as big as Diodes mistakenly do that on their AP2205.

author: Ian.M
author_rank: Super Contributor
timestamp: July 01, 2023, 01:44:11 pm
content: Back-driving Vbus is a major problem. Not only is it non-compliant but it can cause problems for the host PC when it shuts down or enters any power-saving mode that turns off Vbus, often resulting in failure to resume or boot-up till the offending device is removed and the power to the PC cycled, and possibly actually causing motherboard damage.I certainly wouldn't *ever* trust a Chinese 'jellybean' 3.3V LDO to block reverse current - even if you test and find it does, the next batch from a different supplier to the Blue Pill manufacturer may not.If you aren't willing to work with your supplier to source Blue Pills with onboard Vbus protection diodes, and aren't willing to hack the boards you receive, then your only options would be to intercept the USB to the Blue Pill to add Vbus protection externally, or to *never* use the Blue Pill's native USB port.