Automatic Battery->USB switch using high-side MOSFET

Discussion in 'General Electronics Chat' started by theSeekerr, Mar 24, 2013.

  1. theSeekerr

    Thread Starter New Member

    Mar 24, 2013

    I've got a circuit which needs to operate from either a 9V battery or 5V USB supply.

    The twist is that the USB supply should be preferred, so I can't use a simple diode ORing scheme.

    Total current demand is perhaps 200mA peak, with RMS well below 10mA.

    My first thought looks like this, the intention being that the presence of the 5V supply should turn off the P-channel MOSFET, allowing SD2 to turn on and supply 5V to the load:

    But of course that doesn't work, because the difference between the two supplies is higher than the threshold voltage of any commonly available p-channel MOSFET. If my battery supply was ~7V it would work perfectly, but as it is the 'FET is always switched on.

    My second attempt, then, looks like this:

    But the N-channel 'FET gives the opposite characteristic to that desired - now when 5V is present T2 is on, which grounds the gate of T1 and turns it on. So this version uses two 'FETs to achieve the same thing as no FET's - not terribly helpful.

    So, adding a CMOS inverter in front of T2 brings us to this:

    This circuit works correctly, but it uses 4 MOSFETs to do what I'd hoped to achieve with 1 or 2.

    So, having applied everything I know about digital design to this problem, is there some easy solution I've overlooked?
    Last edited: Mar 24, 2013
  2. bug13

    Senior Member

    Feb 13, 2012
    Hi there,

    I can't see you photo, you might want to upload your photos to this site

    Your profile -> Albums
  3. theSeekerr

    Thread Starter New Member

    Mar 24, 2013
    Do the attachments work correctly now?

    The other problem with this design is that both the pull up and pull down resistor are in circuit when the device is on battery power, wasting power. I'm not sure how large I can make these resistors without degrading transient response too badly - I would prefer to make them very large because the load (a microcontroller-based data logger, sampling at 1Hz) is usually asleep, using much less than 1mA, so small pull-up resistors could double my power consumption!
    Last edited: Mar 24, 2013
  4. Dodgydave

    AAC Fanatic!

    Jun 22, 2012
    How about a small 5v relay?
    • Usb.png
      File size:
      16.7 KB
  5. theSeekerr

    Thread Starter New Member

    Mar 24, 2013
    No can do - it's an admirably simple solution, but anything that's not solid-state won't meet the spec.