I'm not entirely sure how to ask this because I'm just a hobbyist . . . but here goes.

My daughter and I are working on a PCB for next year's pinewood derby car (I call it the Carduino). It's base on the ATmega32U4. I'd like to be able to use the same schematic for Christmas ornaments this year. So, to be flexible, here's my plan.

I added a tag-connect footprint for flashing the Arduino bootloader onto the AVR; that footprint includes a power pin I called V_ISP.

I added a USB port which provides power on a rail I called V_USB.

Finally, I have a battery port for V_BATT.

I tried to protect each of these with Schottky diodes and if the USB power is present, it should charge the battery and power the device (and allow you to flash the AVR with firmware).

Power and Charging

We have WS2812Bs on the board so we need a 5V rail . . . and I want to run the AVR at 16 MHz. So, I have a boost converter to get the input voltage (I call V_IN) to a stable 5V. Then I LDO it down to 3v3 to power accessories (like an accelerometer).

enter image description here

Today I read that the USB power rail can have a maximum capacitance of 10uF! My boost converter has a 22uF capacitor on the V_IN line which I assume would contribute to the capacitance of whichever power supply is providing power.

First of all, am I doing this all wrong in the first place? Will the 22uF cap on the V_IN line exceed the capacitance limit of the USB port? What's the right way to do this?


Edit: Will this work?

Following some of the answers and discussions, pushing the USB power into the boost converter will likely exceed the USB specifications because of the inrush current due to the large capacitance on the power side of the boost converter.

But, I don't really need to boost the USB power because it's already stable . . . so the best bet is likely to switch off the power supply from the battery when USB power is present.

Would this effectively put the device into "charging mode" by eliminating the load on V_BATT?


simulate this circuit – Schematic created using CircuitLab

Edit: The New Version

Here's what I have now. I'll come back and update this question once I figure if it works or not. :)

enter image description here

  • \$\begingroup\$ Tag-Connect? Fancy schmancy. \$\endgroup\$
    – DKNguyen
    Commented Jan 26, 2022 at 21:50
  • 1
    \$\begingroup\$ @DKNguyen, yeah. I'm using this project as an opportunity to learn some things. Having the tag connect footprint so I don't need components on the board to flash the bootloader is kinda cool. :) \$\endgroup\$
    – D. Patrick
    Commented Jan 26, 2022 at 21:52
  • \$\begingroup\$ @DKNguyen, I'm very open to other alternatives to that too! I thought about making a PCB with through holes I could solder POGO pins through myself . . . but since that problem's already solved I figured I may as well buy a tag-connect cable. \$\endgroup\$
    – D. Patrick
    Commented Jan 26, 2022 at 21:53

2 Answers 2


The 5V from the USB should be stable. I'm not sure why you think you need a boost to be honest. Even if you did need 5V, I thought you would want a SEPIC or buck-boost or something that can bring both higher and lower voltages to 5V. Is the boost converter only there to make up for the Schottky diode's voltage? If so, don't use a Schottky; Use a PMOS circuit.

The OP's circuit here will work if you just need the USB to override the battery whenever the USB is plugged in. It prevents the USB from injecting current into the battery. It is simple but does not accommodate battery charging:

enter image description here

Is this MOSFET upside down?.

This is why just a PMOS alone won't work in many two-supply situtations: nmos reverse current protection.

Lastly, this here makes a true ideal diode with an PMOS that behaves in the way you take for granted with a real diode where any and all reverse currents are blocked irrespective of circuit voltages, and does generally work in two-supply situtations:

enter image description here

Understanding an 'ideal' diode made from a p-channel MOSFET and PNP transistors

You do not need this last one for your battery-USB function if you just need the USB to override the battery and not discharge into the battery. The first circuit works for that. But the very first circuit might not be applicable if you want to actually have the USB run through a charger for your battery. You may very well need something like this then.

You may also need it in other parts of your circuit since I see multiple Schottky diodes. But just use Schottky diodes if you can tolerate the voltage drop. Much simpler.

  • \$\begingroup\$ Honestly, I'm pretty sure that I can eat the voltage drop from the diodes. I was going to drive them into the boost converter because the boost converter would tolerate it and I'd have a pretty nominal 5V output. But, given these complications, I may just push the battery into the boost converter and then bring the USB power inputs in after the boost converter but before the LDO. \$\endgroup\$
    – D. Patrick
    Commented Jan 26, 2022 at 22:31
  • 1
    \$\begingroup\$ I'd just see if everything runs on 5V minus the 0.3V diode drop if that's the only reason you have the boost. \$\endgroup\$
    – DKNguyen
    Commented Jan 26, 2022 at 22:44
  • \$\begingroup\$ That is indeed the primary reason I had the USB power rails going into the boost converter (the battery obviously needs to be boosted). But, I could achieve the same result I think if I put the USB power after the boost converter and then use a MOSFET to turn off V_BATT when USB power is present. I suppose I could probably just use a MOSFET and pull the EN pin on the boost converter to ground when USB power is attached. \$\endgroup\$
    – D. Patrick
    Commented Jan 26, 2022 at 22:48
  • \$\begingroup\$ @D.Patrick You might also just be able to get away with a 1 Ohm resistor in series before the capacitor to limit the surge current. \$\endgroup\$
    – DKNguyen
    Commented Jan 26, 2022 at 22:51
  • \$\begingroup\$ Oh man. That's interesting. That's something I'm gonna have to look up. Basically, the board's gonna struggle for power during startup while all the caps load up right? But, there won't be a surge of power demand on the USB port? \$\endgroup\$
    – D. Patrick
    Commented Jan 26, 2022 at 22:54

Yes, having a 22 uF capacitor will violate the specs that say max 10 uF.

However, if you limit the inrush energy to below the allowed energy vs time curve, then you can fill a larger capacitor slowly. But you will be instantly powering the whole board and all the capacitors via schottky diodes, all while charging a battery, so total surge needs to be taken care of.

If you only intend to power up the board, with a power supply with USB connector, it might work fine. However, hot-plugging it, or connecting to power supplies that can't handle the inrush current, may have problems starting up.


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.