USB + External 5V + Battery powered PIC

Discussion in 'Embedded Systems and Microcontrollers' started by garyeholmes, Oct 1, 2012.

  1. garyeholmes

    Thread Starter New Member

    Sep 19, 2012
    7
    0
    Hi Guys,

    I have a PIC32 circuit that needs to be powered from either of 3 sources, USB (5V), external 5V or batteries. I have got this far: (see attachment).

    The regulator is a TS9011 to provide 3.3V.

    The diodes will only drop around 0.3(ish) volts so the one after the regulator will drop my 3.3V down to a nominal 3V - which I think will be OK.

    I'm trying not to spend too much money on this if possible.

    Does anyone know a better solution or will this do what I want.

    Thank you in advance.

    Gary.
     
  2. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I think you need another diode in series with the battery, and perhaps yet another one in series with +5V_EXT, because you risk back-feeding the power sources when there's a higher voltage plugged in. Or maybe you're sure that this can occur without any harm resulting.
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Why do you need the diodes before and after the regulator?
     
  4. garyeholmes

    Thread Starter New Member

    Sep 19, 2012
    7
    0
    Hi,

    Thanks for reply. Yes you may be correct. I was thinking that +5V_EXT would either be not connected or greater than the USB 5V (minus a diode drop) but I guess if this goes below that then it may cause a problem. Also, with the battery I've assumed this would be the only source connected... if the battery is connected (say 2xAA's) along with an output from the regulator (say 3V) the battery voltage could be below 3V - I don't really know what this would do to the batteries?

    Best regards,

    Gary.
     
  5. garyeholmes

    Thread Starter New Member

    Sep 19, 2012
    7
    0
    Hi,

    Thanks for reply.

    I thought injecting a voltage into the regulator O/P from the battery might cause a problem. If you think this might be superfluous I'm happy to try it without - I would love to loose it TBH as it gives me an unwanted voltage drop.

    Again, thanks.

    Best regards,

    Gary.
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Are you suggesting that any combination of the three sources might be connected at the same time?
     
  7. garyeholmes

    Thread Starter New Member

    Sep 19, 2012
    7
    0
    Possibly USB and +5V_EXT. I would be recommending a battery to be connected without any other power sources, but I won't be able to physically stop it so anything I can do to avoid permanent damage would be a bonus!

    Regards,

    Gary.
     
  8. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Then I would opt for one Schottky diode in series with each of the power sources and omit the one at the output of the regulator.

    If the battery is over 3.7V then I would treat this the same as the other two and bring it through the input of the regulator.
     
  9. garyeholmes

    Thread Starter New Member

    Sep 19, 2012
    7
    0
    Sounds good re. VUSB and VEXT. Only thing with battery was that I was hoping to use say 2xAA's which will give me ~3V, your suggestion would require 3xAA's. Maybe I plan for 3xAA's to be safe and route as you suggest...

    Cheers.
     
  10. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Why use 3 when 2 will do?
    It really depends on your application and concerns about reliable operation.
    If your circuit takes very little current and the batteries are just for backup I would reconsider going with 2 AAs or a 3.6V coin cell.
     
  11. garyeholmes

    Thread Starter New Member

    Sep 19, 2012
    7
    0
    Hi,

    Sorry this is drawing out with all these messages. We have designed a small flexible module with an OLED display and intend to supply as an OEM part. As such, it could reside in a bigger system (5V_EXT), it could be USB powered or it could be a hand held standalone device and battery powered (possibly with the user connecting USB for updates). As a battery powered device I guess the system could draw 60-80ma in normal operation so maybe 3xAA's might make more sense. OR, we could take a bit more time and design in a MOSFET switch of some sort controlled by the regulator 3.3V O/P that effectively disconnects the VBATT if there is 3.3V at the regulator O/P...

    Cheers.
     
  12. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Sorry about all the messages - it's just the nature of AAC - that it brings out the eagerness in some of us to lend a hand.

    60-80mA is a lot of current by today's standards. AA batteries will not last long with that kind of current drain. Whether you use 2 or 3 AA's, the drain and life span remains the same.

    If the unit is to be battery powered, you should have an automatic mechanism for shutting down the power when the device is not in use.
     
  13. garyeholmes

    Thread Starter New Member

    Sep 19, 2012
    7
    0
    Yes, sorry that would probably be the peak draw if all the OLED segments were on and sound was playing at high volume, we do go into standby at every opportunity. The point I was making is that the battery supply will be a main power source so we probably couldn't take advantage of your idea of a small higher voltage cell.

    Cheers.
     
Loading...