Without resetting....Switching PIC over to Backup Battery


Closed Thread
Results 1 to 6 of 6
  1. #1

    Default Without resetting....Switching PIC over to Backup Battery

    I am trying to make a timer which will normally be plugged into the mains socket during normal operation. It has a 16F877A & one 16x2 LCD module. LCD module is powered by the PIC itself.
    I would like to ask if someone has a good design or an idea to put PIC on backup battery power as soon as there is a mains powercut without resetting it. I will be using an smps delivering 12V to 7805 which will give 5 V to my PIC.
    Through one resistance from 12V, PIC will know about the powercut and will switch OFF the LCD & turn it back on when power returns.
    I have 3V backup plan (2 x AA) (NON-RECHARGEABLE). Can someone help me put it together so PIC can jump straightaway to 3V & back to 5V when power returns.
    ___________________
    WHY things get boring when they work just fine?

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi financecatalyst,
    If you can suffer a .7 volt drop, why not just use 2 diodes, one on the battery and 1 on the mains fed supply, the pic will draw from whichever is outputting the highest voltage. No reset. as for the other stuff, sense the mains fed supply with an analog port, or heck even a digital port (if power then main loop) and jump to the disabled routine if not true.
    Last edited by Archangel; - 24th December 2010 at 06:18.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default A simple DC ups

    Quote Originally Posted by Joe S. View Post
    Hi financecatalyst,
    If you can suffer a .7 volt drop, why not just use 2 diodes, one on the battery and 1 on the mains fed supply, the pic will draw from whichever is outputting the highest voltage. No reset. as for the other stuff, sense the mains fed supply with an analog port, or heck even a digital port (if power then main loop) and jump to the disabled routine if not true.
    The January 2011 Nuts and Volts magazine shows a simple example using exactly that. They let people embed it into blogs and such, but I am not sure it will be visible without a subscription.

    <table border="0" cellpadding="0" cellspacing="0"> <tbody><tr style="background-color: rgb(210, 210, 210); height: 30px;"> <td><img class="navlogo" src="http://n-cdn.dashdigital.com/nutsvolts/include/icons/navbar_logo.gif?lm=1292898564000" alt="Nuts &amp; Volts" align="left" height="28"> </td> <td style="color: rgb(102, 102, 102); font-weight: bold; font-family: tahoma,sans-serif; font-size: 11px; line-height: 15px; padding-right: 5px;" align="right"> <span id="top_right_text">Look inside &gt;</span> </td> </tr> <tr style="background-color: rgb(255, 255, 255);"> <td colspan="2" style="padding: 10px 0px;" align="center"> <a href="http://nutsvolts.texterity.com/nutsvolts/201101?pg=41" target="_blank" onclick="window.open('http://nutsvolts.texterity.com/nutsvolts/201101?pg=41','sharewidget','toolbar=no,menubar=no ,resizable=yes,scrollbars=yes,left=0,top=0,width=' +(screen.width-10)+',height='+(screen.height-10)+'');return false;" title="View Magazine"> <img src="http://n-cdn.dashdigital.com/nutsvolts/201101/data/imgpages/smtn/0041_wdxmxd.gif?lm=1292898564000" alt="41" border="0"> </a> </td> </tr> <tr style="background-color: rgb(210, 210, 210); height: 30px;"> <td colspan="2" style="color: rgb(102, 102, 102); font-weight: bold; font-family: tahoma,sans-serif; font-size: 11px; line-height: 15px;" align="center"> <span id="bottom_text">January 2011</span> </td> </tr> </tbody></table>
    Last edited by ScaleRobotics; - 24th December 2010 at 19:19.
    http://www.scalerobotics.com

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Thanks for the answers. I checked the Nuts&Volts article, it actually uses 9V battery before 7805. I am using 3xAA, which puts 7805 out of picture.
    I tried it with 2 diodes, what capacitor values & what types should I use to minimise current consumption as well and where should I place them to avoid resetting. I will check it on my breadboard before making my PCB and setting it there.
    Currently it is still resetting, I tried it with few random capacitor values but no success.

    Currently on my breadboard, one 4007 is attached to 5V line from 7805, and one from 4.5V battery set.
    ___________________
    WHY things get boring when they work just fine?

  5. #5
    Join Date
    May 2010
    Location
    Chile
    Posts
    25


    Did you find this post helpful? Yes | No

    Default

    Try only feeding the pic with a 1000uF capacitor when the power is cut and the switching from main to battery takes place.
    How? leave the two diodes but after the regulator one for the battery, other for the regulated supply, add a 1000uf capacitor before the pic and raise the regulator voltage to keep the 5V

    "...maybe could work" circuit diagram:



    Is a good practice to make a power supply detection signal with a voltage divider or another diode after the regulator.

    Also if i'm not wrong 16F877 will not work under 4.0 volts but similar ones work happy up to 2,0V like the LF version, saying that. change: or your pic, or your battery, or maybe a "low drop" diode will do the trick
    Last edited by El_AMPo; - 29th December 2010 at 02:14.
    "If at first doesn't work, kicking it wont help either"

  6. #6


    Did you find this post helpful? Yes | No

    Default

    The problem was BOD, once switched off it worked with just 1000uF at the supply.
    ___________________
    WHY things get boring when they work just fine?

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