PIC backup power supply: switchover ???


Closed Thread
Results 1 to 14 of 14
  1. #1
    xnihilo's Avatar
    xnihilo Guest

    Smile PIC backup power supply: switchover ???

    Here is the topic:

    I am using two curcuits, based on PIC16F684.
    Main circuit is powered by 5V (9V battery to 5V voltage regulator).
    Auxiliary circuit is powered by 3V (one small battery) because it will be its backup supply.
    Auxilliary circuit is supposed to be normaly connected to the power supply of main circuit (5V) but, if disconnected, it should use the 3V power supply.

    Would someone know and be so kind to tell me how I could, electricaly design my circuits so I can implement such diagram?
    I will need a system to switchover from 3V to the 5V of the main circuit and vice versa when separating auxiliary circuit from main circuit.

    The fact is that this switchover must be immediate because the PIC CANNOT loose its power supply and reset.

    Thanks for your help.

    Regards.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    2 diodes and there you go. Low voltage drop please let's say 1N5817
    <img SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2516&stc=1&d=120852848 5">
    Attached Images Attached Images  
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    Thank you for your quick reply.
    Can I ask why you are using diodes? To avoid peak currents? Wouldn't 1N4001 diodes be okay (I have a bunch of these...)
    I see a capacitor, what would be the value? 100UF would be fine or do I need higher value? Do you use it to prevent a voltage drop at the time the voltage switching occurs?
    I disabled BOD in the pics, should I expect a reset anyway if the voltage drops a little?

    Thanks mister_e

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Diode are there to avoid conflict between your voltage source... with this, the higher voltage will win the race

    Capacitor, 10 uF and more should be enough. For filtering purpose.

    You could use 1N4xxx diode, bear in mind their voltage drop is around .6V so your 3V will be 2.4 volt when your battery is at full-charge.

    The pic will work as long you haven reach the Brown-Out threshold voltage OR his voltage threshold depending on the osc speed you're using.

    You could still use another much fancy system, this one work pretty well in many cases.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mister_e View Post
    Diode are there to avoid conflict between your voltage source... with this, the higher voltage will win the race

    Capacitor, 10 uF and more should be enough. For filtering purpose.

    You could use 1N4xxx diode, bear in mind their voltage drop is around .6V so your 3V will be 2.4 volt when your battery is at full-charge.

    The pic will work as long you haven reach the Brown-Out threshold voltage OR his voltage threshold depending on the osc speed you're using.

    You could still use another much fancy system, this one work pretty well in many cases.
    I didn't know that diodes had such use
    What's wrong if both supplies are connected at the same time in parallel???

    Filtering capacitors? What do they filter?

    Voltage drop? Right... 2.4v is a little too low, knowing the PIC will be fine down to 2V but I can't use 8MHz anymore if using 2V... In this case I can use 3*1.5v batteries instead and use 1N4001 diodes, right?

    I disabled Brown Oout Detect in the config words, do I still need to care about this feature?

    What fancy system are you talkning about?

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    ...................whoops...............

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    You could still use another much fancy system, this one work pretty well in many cases.
    What fancy system are you talkning about?
    Yes, tell me more about Fancy System v1.0...............

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xnihilo View Post
    What's wrong if both supplies are connected at the same time in parallel???
    what happen if you connect a 5 volt directly to a 3v battery?

    Filtering capacitors? What do they filter?
    voltage regulator output, battery... yeah you may think battery don't produce noise.. well yes and no, they have internal resistor, everything that need juice will make the voltage drop a little bit, knowing there's a clock source somewhere and you will also drive something, the voltage will swing accordingly.

    Do a test, remove all capacitors, do a led blink (10mSec or so) then use your scope to monitor your Vdd rails... cool huh? now add the mandatory filtering caps... how better now?

    Voltage drop? Right... 2.4v is a little too low, knowing the PIC will be fine down to 2V but I can't use 8MHz anymore if using 2V... In this case I can use 3*1.5v batteries instead and use 1N4001 diodes, right?
    Sounds right

    I disabled Brown Oout Detect in the config words, do I still need to care about this feature?
    No, it will be disabled. It's not a bad idea to have it enabled so far. Just look the datasheet to know it's threshold and what advantage it may give you.

    What fancy system are you talkning about?
    Don't worry, way to complicated....
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Don't worry, way to complicated....
    My method for the backup is 'simple'-ish. Used it a number of times, works for me...
    +5v normally powers the whole circuit except for the PIC. It also trickle charges a 3 cell pack of NiMH batt's thru a blocking diode and a current limiting resistor (I also have a jumper that adds another resistor in parallel if I need to do a manual fast charge for awhile, i.e. I let it run too long on backup). This 3 cell pack directly feeds the PIC. I tap off the main +5v line into a normal port and keep an eye on it. If I lose the main +5v line, I shut down other peripherals, drop the clock speed, and start napping until main power comes back up. A single PIC running off 3 AAA 650 mAh NiMH cells can run a long time in sleep / low power mode. Even looping on the internal low speed clock (~37Khz) draws so little current that the thing can 'sleep' for a solid week before I have to worry about.

  10. #10
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    what happen if you connect a 5 volt directly to a 3v battery?

    -> Dunno... Some electrical magic for sure Will you tell me?
    Are you talking about a problem based on different voltage levels or on batteries in parallel?
    IF the latest, I thought putting batteries in parallel increases their capacity 'i.e. 2x1.5V 2500mAh will give 1.5V 5000 mAh... ?)

    voltage regulator output, battery... yeah you may think battery don't produce noise.. well yes and no, they have internal resistor, everything that need juice will make the voltage drop a little bit, knowing there's a clock source somewhere and you will also drive something, the voltage will swing accordingly.

    -> I'm not using oscilloscopes. I'm building a DIY lasergame project. I'm biochemist and filmmaker, that's why I'm asking so many dumb questions
    I will use a capacitor on the power supply, good practice, for the reason you are giving above. Thank you for that.

    Do a test, remove all capacitors, do a led blink (10mSec or so) then use your scope to monitor your Vdd rails... cool huh? now add the mandatory filtering caps... how better now?

    -> Great.

    Sounds right


    No, it will be disabled. It's not a bad idea to have it enabled so far. Just look the datasheet to know it's threshold and what advantage it may give you.

    -> Well, BOD resets the chip when the voltage drops too low if I remember well, but my system must not reset... I will have a look at the BOD feature in the datasheet this WE, just in case.

    Don't worry, way to complicated....[/QUOTE]

    -> Okay, the simpler the better anyway

  11. #11
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile backup yes, but not for sleeping

    Quote Originally Posted by skimask View Post
    My method for the backup is 'simple'-ish. Used it a number of times, works for me...
    +5v normally powers the whole circuit except for the PIC. It also trickle charges a 3 cell pack of NiMH batt's thru a blocking diode and a current limiting resistor (I also have a jumper that adds another resistor in parallel if I need to do a manual fast charge for awhile, i.e. I let it run too long on backup). This 3 cell pack directly feeds the PIC. I tap off the main +5v line into a normal port and keep an eye on it. If I lose the main +5v line, I shut down other peripherals, drop the clock speed, and start napping until main power comes back up. A single PIC running off 3 AAA 650 mAh NiMH cells can run a long time in sleep / low power mode. Even looping on the internal low speed clock (~37Khz) draws so little current that the thing can 'sleep' for a solid week before I have to worry about.
    Skimask, the "crazy flying tiger"...
    Remember I'm in a project where I use a gun and a mag for a DIY lasergame.
    I have a pic in the gun and a pic in the mag. When the mag is in the gun, it gets its power from it. When player needs to switch to the next virtual mag, he removes the 'physical' mag, clicks on a switch to cycle through his virtual mags and then reinserts the mag in the gun. I need some power supply in the mag while it is out of the gun, it cannot sleep because player interacts with the pic inside the mag while it is away from the main power supply. See?

  12. #12
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xnihilo View Post
    Skimask, the "crazy flying tiger"...
    ?????

    I need some power supply in the mag while it is out of the gun, it cannot sleep because player interacts with the pic inside the mag while it is away from the main power supply. See?
    So don't sleep! Sounds to me like the 'mag' is going to be fairly simple anyways. It'll take a LONG time to deplete a few AAA batts.

  13. #13
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile

    So don't sleep! Sounds to me like the 'mag' is going to be fairly simple anyways. It'll take a LONG time to deplete a few AAA batts.

    ->Who is talking about depleting batteries? It is only for a short time (while the mag is pulled out and reinserted a few seconds later) and during this time, the PIC in the mag has to continue running.
    Let me explain, when I'm talking about BACKUP it is not like the one for the CMOS in a PC.
    I need to switch temporarily from a supply from the GUN (good battery with a voltage regulator) to another one (3 mini batteries onboard the mag).
    The mag still needs to run when I remove it from the gun unit. I want to use small wristwatch batteries to supply power to the mag while it is out of the mag.
    Do you understand?

    By the way, mag is not simple at all, the managment of this little ******* fills all the 1048 words of the PIC...

  14. #14
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    ->Who is talking about depleting batteries? It is only for a short time (while the mag is pulled out and reinserted a few seconds later) and during this time, the PIC in the mag has to continue running................
    By the way, mag is not simple at all, the managment of this little ******* fills all the 1048 words of the PIC...
    Yes, I get it... And again, how much power do you think a PIC uses just sitting there? Just use the blocking diode and those watch batteries. It'll take awhile to drain those out and if you're careful, it could take QUITE AWHILE to drain them out.

    And as far as how simple the 'mag' is...it doesn't matter if the PIC is empty or full, it's still going to draw the same current. It's sounds fairly simple to me...
    Either the mag really is just that simple, or you're making it entirely too complicated.
    But then again, I'm not trying to zap or fry anybody either...

Similar Threads

  1. Backup Power Supply
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2007, 19:37
  2. Ideal backup power for PIC micro
    By emavil in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd March 2007, 00:07
  3. PIC power backup with "super capacitor"
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 24th January 2007, 23:51
  4. Decent 24 volt Pic power supply
    By rwskinner in forum Schematics
    Replies: 7
    Last Post: - 18th December 2006, 12:27
  5. backup supply for pic
    By PoTeToJB in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th May 2006, 17:24

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts