0
\$\begingroup\$

I need to power a microcontroller (ATTINY826-SU) from a USBC port that supports Power Delivery (I'll use a battery back for that). For the sake of simplicity I'll omit the circuite to negotiate the Voltage and the Current according to the Power Delivery protocol, let's simply assume that VBUS could range from 5 to 20V.

If the selected input voltage is 5V I can feed the microcontroller directly without using the LDO, on the contrary, if the voltage is greater that 5V I must use an LDO to stepdown the voltage.

In order to achieve this I've used a comparator (based on the LM393DT OPAMP). The comparator's output is connected to the base of a P-Channel MOSFET to enable/disable the LDO. Can you please suggest a way to feed the micro-controller VDD with VBUS only if its value is 5V? Can I use an NPN transistor on the high side switch configuration?

enter image description here

Thanks

\$\endgroup\$
6
  • \$\begingroup\$ Is there a reason you can't run the microcontroller on like 4.5V or 4.75V? If you could do that then just use the LDO all the time. There are plenty of LDOs that have dropout voltages of only a few hundred mV (or even less for low currents). There are LDOs that have supply currents of only a few microamps if low power is also a concern. \$\endgroup\$
    – user4574
    Commented Feb 26 at 20:23
  • 1
    \$\begingroup\$ Terminology technicality: a 7805 is most definitely not a LDO (Low DropOut) regulator. It's a Linear regulator, and "LDO" is not an abbreviation or synonym for "Linear". \$\endgroup\$
    – brhans
    Commented Feb 26 at 21:55
  • \$\begingroup\$ Why would you select the voltage any higher than you need? I suspect there is something more to this question...Some other part of the design can request higher voltage without your permission, right? \$\endgroup\$ Commented Feb 27 at 6:49
  • \$\begingroup\$ @brhans you're right and I appreciate the suggestion. I searched for an LDO in lcsc.com but with this acronym they mean Linear Voltage Regulator, I've replaced the 7805 with WL9100S3-50B \$\endgroup\$
    – Angel0ne
    Commented Feb 27 at 7:05
  • \$\begingroup\$ @Ale..chenski exactly, I've answered to you comment in the post below. Do you have any suggestion to give? Many thanks \$\endgroup\$
    – Angel0ne
    Commented Feb 27 at 7:07

1 Answer 1

0
\$\begingroup\$

Answer edited because I originally misread the question.

So you want to negotiate USB-PD voltage to suit the current pulled by your load (for example, a 12V pump). You also need 5V for your MCU, even if the USB-PD voltage is 5V. It runs from a powerbank, so current draw should be low.

The schematic in the question has constantly-on a LM393 (0.8-1mA supply current) and LM4040 (<100µA) so we should try to use less current than this. I'm ignoring the up to 60mA drawn by the voltage divider resistors because these could easily be changed.

If your only load on 5V is the Attiny and a few low current sensors, then a simple way would be to use a LDO with low idle current and a PMOS pass transistor.

When input voltage is higher than 5V it will regulate it down to 5V, and when input voltage is 5V the LDO will operate in dropout with the internal PMOS fully turned on. In this case dropout depends on the RdsON of the internal PMOS and output current.

As an example let's look at AP7375 LDO: it has an idle current of 2µA which means having it on continuously isn't a problem. Datasheet says:

VDROP = 35mV@IOUT = 10mA (Typ.) VDROP = 350mV@ IOUT = 100mA (Typ.)

So with your Attiny using 10mA, the dropout would be tiny and it would get almost 5V. Besides, Attiny works fine down to 1.8V, it will run fine on 4.965V too.

enter image description here

It's important to use a PMOS LDO and not a PNP, as the latter will draw current to saturate the pass transistor when operating at low input voltage.

If you have other loads on 5V that use more current, then it would be more efficient to use a switching regulator.

LDO advantages: simplicity, cost, no switching noise, low idle current

Switcher advantages: much higher efficiency at high current

For a few mA current, from a big powerbank, a switcher isn't really needed. For a few tens to hundreds of mA, then definitely yes.

In this case you need a buck chip that can operate at 98-100% duty cycle, so when the input is 5V, it will output 4.9-something volts, and when output is higher it will regulate. Here are two examples: AP63205 TPS54202.

\$\endgroup\$
11
  • \$\begingroup\$ Thanks for the reply. The problem is that I need to preserve the power consumption because the USBC is fed by a battery pack. In your scenario the LDO is always powered on, I would like to switch it on only if needed. \$\endgroup\$
    – Angel0ne
    Commented Feb 26 at 20:22
  • 3
    \$\begingroup\$ If you care about conserving battery power then a linear regulator is not what you should be using. \$\endgroup\$
    – vir
    Commented Feb 26 at 20:47
  • 1
    \$\begingroup\$ OK, I misread the question lol. Yes the answer is to use a switching converter that allows 100% duty cycle so it will output almost 5V on a 5V input. \$\endgroup\$
    – bobflux
    Commented Feb 26 at 21:07
  • \$\begingroup\$ Since the circuit allegedly uses PD to control the input voltage, the correct answer should be to always negotiate the default 5V contract and forget about downconverting. The entire purpose of PD is exactly that. \$\endgroup\$ Commented Feb 27 at 6:44

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.