Author Topic: Low cost, Selecting between Vusb and Battery  (Read 1950 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Low cost, Selecting between Vusb and Battery
« on: December 10, 2020, 03:35:09 pm »
1. I have a circuit which has power coming from Vusb or Vbat. Current is 700mA max.

2. When power from Usb is coming, device should run on Vbus and Vbat should not come in picture, as soon as Vusb removed, then device should immediately run on Vbat without fluctuation.

3. Made this circuit, going to test it, any comments on it?

 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Low cost, Selecting between Vusb and Battery
« Reply #1 on: December 10, 2020, 05:16:38 pm »
Its FUBARed.  Q1 can never turn on if Vbat is present so effectively its a diode from Vbat to Vusb, with a 100K to ground.
 

Offline PeteH

  • Supporter
  • ****
  • Posts: 113
  • Country: ca
Re: Low cost, Selecting between Vusb and Battery
« Reply #2 on: December 10, 2020, 05:38:48 pm »
Once the logic is sorted, (VBat flows though to VOUT which turns Q1 off)...

You probably also want to ensure you aren't backfeeding VBAT to VUSB if VUSB is attached but "off". This could solve the logic problem and backfeed...
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2007
  • Country: us
Re: Low cost, Selecting between Vusb and Battery
« Reply #3 on: December 10, 2020, 06:54:15 pm »
Maybe I'm missing something, but it looks ok to me.  It's basically a load sharing circuit using a P-channel mosfet oriented strangely.  If Vbus is not present, R2 will ground the gate and turn on the mosfet, allowing Vbat to supply the load.  If Vbus is present, and Vbat is less than Vbus, then the gate goes high, which turns off the mosfet, and its body diode blocks Vbus current from coming back to the battery.

What may be missing is a Schottky diode in the Vbus line to block the battery from back-sourcing Vbus or anthing else that might be connnected to it, such as a charger circuit.

http://ww1.microchip.com/downloads/en/AppNotes/01149c.pdf

I don't think you need R1.
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 7859
  • Country: us
Re: Low cost, Selecting between Vusb and Battery
« Reply #4 on: December 10, 2020, 07:25:32 pm »
3. Made this circuit, going to test it, any comments on it?

Start by defining how you want it to work.  I assume Vbus is 5.0V, what is Vbat

If Vbus is less than Vbat, do you still want the device to run on Vbus?

What if Vbus drops to say 3 volts, or 2?  What other fault conditions do you want your circuit to handle without dropping out?

What voltage does your device need?

Start with the obvious easy example of having two 1N4001 diodes on both inputs and then identify what problems that solution has so you know what to improve on.
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline PartialDischarge

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: 00
Re: Low cost, Selecting between Vusb and Battery
« Reply #5 on: December 10, 2020, 08:56:30 pm »
Exactly what Peabody said. Also missing the diode in vbus
 

Offline jdutky

  • Regular Contributor
  • *
  • Posts: 103
  • Country: us
Re: Low cost, Selecting between Vusb and Battery
« Reply #6 on: December 10, 2020, 09:15:35 pm »
Maybe a small capacitor between Vout and ground? To cover any voltage drop while the transistor switches from Vbus to Vbat
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2007
  • Country: us
Re: Low cost, Selecting between Vusb and Battery
« Reply #7 on: December 10, 2020, 09:29:00 pm »
Actually, what I said about the Schottky diode being needed to prevent back-powering other stuff on Vbus was only the secondary reason for adding it.  The main reason is  that if battery voltage flows back to an unpowered Vbus, that will raise the gate voltage and turn off the mosfet, which is not what you want.  So the diode has to be there so the pulldown resistor will ground the gate.  It's all in that Microchip appnote.
 

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Re: Low cost, Selecting between Vusb and Battery
« Reply #8 on: December 13, 2020, 12:07:58 pm »


1. Here is updated design, battery voltage range is 2.4V to 4.2V

2. Vusb is +5V
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2007
  • Country: us
Re: Low cost, Selecting between Vusb and Battery
« Reply #9 on: December 13, 2020, 03:32:01 pm »
It looks good.  But you want to be careful picking D1.  Schottky diodes are great for low Vf, but when reverse biased they can leak a good bit.  And the leakage current rises exponentially as they get hotter.  When USB is connected, D1 will be carrying the entire load current.  If it gets hot doing that, then when USB is disconnected the diode may leak a good bit of battery current back through to the gate, raising gate voltage, and not allowing the mosfet to turn on fully.  The fix would be to lower the value of R2 to sink the leakage current until the diode cools down.

In picking the diode, you want a low Vf to reduce the heating, and low leakage specs.  But those two are usually mutually exclusive, so you have to compromise a bit.  A high current rating will help because the diode will be bigger and dissipate heat better, and not get as hot.  In the last of these circuits I built, I used an SB220, which has a 2 amp rating, but I never go above 1 amp of actual current.  And my R2 was 10K, with no R1.

So in testing your circuit, the critical point is the transition from USB power to battery power when the diode is hot - there should be no sag or dropout.

 

Offline PartialDischarge

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: 00
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 7859
  • Country: us
Re: Low cost, Selecting between Vusb and Battery
« Reply #11 on: December 13, 2020, 04:28:03 pm »
OK, so what advantage does this circuit have over just using two diodes?

As far as Schottky vs other diodes, if the device will run on a single li-ion cell voltage, then there is absolutely no need for a Schottky on Vusb, a regular 1N400x or any other silicon diode with low reverse leakage will do a better job. 

If you do just use two diodes, a Schottky would be appropriate on the battery circuit, as reverse leakage would just charge the battery a tiny bit and low voltage drop will extend battery operation. 

If you still want to use the MOSFET circuit to extend battery life a bit further, just make sure that when Vusb goes away it goes away completely.  If it were to drop to 2V, say, your MOSFET might not turn completely on depending on battery voltage.  Also, as battery voltage drops below 3V, your RDS(ON) will start to go up anyway.  Where and if this becomes a problem you will have to determine. 
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2007
  • Country: us
Re: Low cost, Selecting between Vusb and Battery
« Reply #12 on: December 13, 2020, 05:07:00 pm »
The primary justification for using a mosfet is to eliminate the voltage drop across a diode in the battery line.  Of course it depends on what the load is, but if it's a boost converter to get back up to 5V, then battery life could be materially reduced.  The lower the voltage coming into the boost converter the more current it will have to draw from the battery in the first place, and even without that, battery life will be reduced because of the Vf of the diode.  Of course if none of that matters in a specific situation, then two diodes would work just fine.

As for Schottky vs regular diodes, in addition to the lower Vf, a Schottky will switch much faster.  I don't know if that's important in this case, but it might be.  In any case, these circuits are always shown using Schottky diodes in app notes, etc.

I agree that this circuit requires all or none on Vusb.  It wouldn't work on solar.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf