PIC power backup with "super capacitor"


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default PIC power backup with "super capacitor"

    Hello,

    I need to make a power backup for a PIC.

    As it is a mains's frequency driven clock and thus powered by the mains too. In case of power loss, I want to make the PIC go on by itself on a backup power source and keep on counting "time" until mains power comes back again.

    The anything it will do during it's backup mode will be to keep the PIC essential function "alive" to count interrupts. Any other display or buzzer will be shut off.

    I think I can use a 5,5V super capacitor (to keep it as small as possible).

    Since I'm not an electronician, I don't really know what capacity I should use if I want to make sure my PIC will stay running for, lets say, 2 hours (never seen a son long power outage in my country... should be the worst case).

    I have found a datasheet about one of these caps and I can choose between 6 capacities.

    1) Witch one shall I take?

    2) I've read my 16F88 ds about low power consumption. These are "physical" tips. What about software? What is the best way to program my PIC this way?
    Attached Images Attached Images
    Roger

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    1. Of course, the larger the capacity, the longer the duration is. But you come across with the physical size of the cap. I would pick DB-5R5D105 from your list.

    2. Have a serial diode to your PIC power line and put the cap after diode. You may have an input pin to detect the power loss before the diode, and start your power saving mode immediately WHILE the cap is still powering your PIC.

    This is my idea in theory.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default Capacity Calculation

    Thanks Sayzer,

    Am I right to calculate the capacitor's capacity like this (sorry but I don' t know the english technical names):

    Assuming a very bad case where my PIC consumes 1mA and I would like my PIC to stay powered 2 hours, it would give this:
    Q(cap load) = I(amps) x t(seconds)
    this would give: 1mA x 7200seconds = 7,2C(Coulomb - capacity)

    Then, to find out the cap's capacity, I would calculate the time like this:
    C(Capacity) = Q(cap load) / U(Volt)
    this would give: 7,2C / 5V = 1,44F

    This is theory but please let me know if I'm wrong and if yes, where.

    What about the low power programming?
    Roger

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    flotulopex,

    I have no idea about that formula and the calculation.

    I am sure someone will jump in and help you out.

    But, why don't you try it in a real circuit?

    So simple to test in a real application. With your own eyes, you can see how long it will last.

    ------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Working from memory here because it is a long time since I went to college!!!

    Isnt the charge/discharge curve of a capacitor non linear an also as the cap discharges the voltage drops so you will hit brownout long before the cap is discharged. Might be better just with a lithium or rechargeable battery as the backup supply.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  6. #6
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Super caps are frequently used with RTC chips so you can find a lot of online data about how to select the right size. Maxim has an online calculator that you can probably use.

  7. #7
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    In simplified terms, the governing equation for a “perfect” capacitor is:
    I = C dV/dt
    which states that the current is equal to the capacitance times the change in voltage with respect to time. In layman's terms, you can get a first approximation like this:
    I = C (Vinitial – Vfinal)/time
    Example, If:
    C = .47F
    Vfinal = 5.0 Volts
    Vfinal = 3.3 Volts
    time = 7200 seconds
    the capacitor would be able to supply
    I = .47 (5.0-3.3)/7200 = .000111 amps = .11mA during that time frame (the voltage would change from 5.0 V to 3.3 V after 7200 seconds while supplying the shown current)

    However, the equation works both ways – if your circuit draws more current, for example .001 amps, you can determine how long you can keep your capacitor voltage at 3.3 or above like this
    I = 0.001 = (5.0-3.3)/time
    solving for time gives time = 1700 seconds (about 28 minutes).

    I picked a lower limit of 3.3 V – you need to determine this for your setup. Also, with the nanoWatt controllers, you should be able to get your current consumption much lower, like several uA or less, which means you could have a backup for days.

    Last, no system is perfect – there are leaks and losses and other things going on that you need to be aware of – design your power backup to last longer than you really need it – and test it!
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  8. #8
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    See this link:
    http://www.qsl.net/zl1bpu/MICRO/CLOCK/index.htm

    From the above link:
    When the AC supply fails, D3 conducts, D4 is reverse biassed, and the
    clock continues to operate from the battery with no loss of time.
    However, since R2 is no longer able to keep micro input PD2 (pin 6) high,
    the micro detects power failure and displays a "BATT" message. The battery
    can be a small alkaline 9V type if power failures are rare, and will last
    normal shelf life. If power failures are frequent or the clock is used as a
    portable time source, a 6-cell 500mAH or better NiCd or NiMH battery pack is
    recommended. R1 can be added to slowly charge the battery from the AC supply.

    Schematic:
    http://www.qsl.net/zl1bpu/MICRO/CLOCK/CLOCK2.GIF

    * * * *

    Best regards,

    Luciano

  9. #9
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default excellent schematic

    Quote Originally Posted by Luciano View Post
    Luciano,

    9V battery in that schematic is indeed a good idea.

    Thanks.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  10. #10
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default gona make it!

    Well,

    So many ideas..... :-)

    I think, I'm going to make it the simple way first.

    I found a super cap on an old PC motherboard so give me a few hours and I'll come back with some news.

    Thanks to everybody for all your information. Really Great ;-)
    Roger

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Well,

    So many ideas..... :-)

    I think, I'm going to make it the simple way first.

    I found a super cap on an old PC motherboard so give me a few hours and I'll come back with some news.

    Thanks to everybody for all your information. Really Great ;-)
    By the time you get done messing with a super-cap, you might find (as I did) that a diode-protected lithium coin cell might do exactly what you wanted the super-cap to do, easier and possibly cheaper (with an occassional replacement). I just wish I could find NiMH coin cells in similar size to the lithium coin cells...for cheap anyways...

Similar Threads

  1. Pic getting part power from Analog Port
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 22nd April 2009, 11:34
  2. PIC backup power supply: switchover ???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 18th April 2008, 18:05
  3. Ideal backup power for PIC micro
    By emavil in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd March 2007, 01:07
  4. problems on power up of PIC
    By dmairspotter in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th June 2006, 15:11
  5. Controlling power to a PIC with another PIC
    By jswayze in forum Off Topic
    Replies: 3
    Last Post: - 28th May 2005, 20:44

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