Shop OBEX P1 Docs P2 Docs Learn Events
Automatic battery backup — Parallax Forums

Automatic battery backup

ihmechihmech Posts: 179
edited 2010-05-22 02:58 in General Discussion
I am working on a BS2 project for my dog.· Its just something fun for me·to do and do some more learing since I'm still very much a novice, but when I get it done, I look forward to posting in in completed projects.· I have been playing around with the BS2 for about·1 1/2yrs and just started·trying a propeller chip and this will me my first pratical thing I've done with a micro.· What I am trying to figure out is the best way to make a battery backup system.· What I need it to do is....It will work on main power from an ac adapter and during a power out automaticly switch to battery power until main power is restored.· I am going to be controlling a water valve in this project and if the power goes out, I want it to be able to check for main power loss and shut off the water valve if needed and go on standby until main power is restored.· I really don't want my kitchen flooded!· If anyone has any ideas or schematics I would greatly appriciate it!!

Comments

  • ercoerco Posts: 20,260
    edited 2010-05-01 03:42
    No-nonsense way is to constantly trickle charge a gel cell SLA battery from a small wall wart through a diode, current-limited to deliver a bit more current than your circuit requires steady-state. Size the battery based on backup time requirements, and set the extra current on the size of your battery (AH capacity).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • Peter KG6LSEPeter KG6LSE Posts: 1,383
    edited 2010-05-01 05:38
    I am going add on to what erco said .

    This info is most likely TMI but its good none of the less..
    A neat little trick I found out with old Iron core Xfmrs is the Open circuit voltage is often a good amount higher then he rated voltage on a UN REGULATED wall wart .

    If you set/ pick the wart to put our at OCV at or sightly above ".2V " the ending charge profile voltage it will in effect self regulate the VOLTAGE part of a "dumb charge " cycle to a certain extent ..

    mind if you have a 4 A wall wart with a 5AH 12V SLA you could very easly cook the SLA !!



    My personal Rule O thumb is if the batt is below 20 AH or so I make shure the wart can never go above a C/30 to C/20 charge rate .
    Above 20 AH I use C/15 to C/10 max rate .



    EG for a 9.6 RC pack I use a 7.5 V rated wall wart with a OCV of around 10.2 V . this is just about right .

    its worked for years with no real harm to the pack VS real charger ..
    BUT be carfull with any kind of " dumb charger" at high C rates !

    I use a hollow cinder bock as a containment system for my packs in my room ..

    Peter KG6LSE

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Carpe Ducktum" "seize the tape!!"
    peterthethinker.com/tesla/Venom/Venom.html
    Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway. —Tanenbaum, Andrew S.
    LOL
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-05-01 15:50
    Very easy to do




    ··································································220 ohms
    ·················································+ .............^^^^^^........|·········
    ·································································10k ohms······· ·|<<<<<< ____ Pin out goes Basic Stamp I/O pin
    ················································ - .............^^^^^^.........|

    ················································ ^


    Transformer····························· Optic Sensor······················· rectifier·························· Cap······························ Basic Stamp Input Power pin
    ·················· .....>>>> |<<<....···················· ........>>>>>················ + .........>>>>>>······· <<<<<<<............
    ·················· .....>>>> |<<<....····················· ........>>>>>·················-·.........>>>>>>······· <<<<<<<............

    Wall Ward··· Optc·Sensor········ dieode

    ··············· + .......................^^^|^^^.............>>>>>>>>>> To Basic Stamp power input pin

    Have a optic sensor on your main power in and have as an INPUT to the Basic Stamp pin
    Have your code written that unless there an output from the Optic sensor it goes to a doing look at input pin routine
    something like this

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
     
    main:
    
    DO WHILE IN0 = 0
    LOOP
     
    Water_Dish:
    
    IF IN0 = 1 THEN      'This is from your Optic Sensor
    IF IN1 = 1 THEN      'This is from your float if you are using one
    
                          Put your code here to turn your water valve ON
    
    IF IN0 = 0 THEN GOTO main
    
    ELSE
    
    GOTO main
    
    ENDIF
    ENDIF
    
    RETURN  ' not sure if this is need
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·Now wanting to learn Spin· Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 5/1/2010 3:55:12 PM GMT
  • ihmechihmech Posts: 179
    edited 2010-05-01 16:51
    Hey thanks for the ideas guys!! I was thinking of using a 9v battery for the backup, can I use any rechargable? I was planning on using a 9v 300mA wall pack and a plain 9v batt. because I have one, but I can get something different if needed. When I first starting trying to figure out a power backup, I thought about using a relay that latches when the main power is on and when main power goes out, it unlatches and defaults to battery power. Then the stamp would confirm that the valve is closed and then sleep until main power comes back on. The problem I had with this idea is that I didn't know if the relay would use too much power and if the cylce time of the relay would cause problems with the stamp. The stamp reseting is not a big problem, the first thing the program will do is check for main power. Let me know what anyone thinks! Thanks
  • Junk_BotJunk_Bot Posts: 15
    edited 2010-05-03 21:13
    A rechargeable 9-volt won't give you enough power to hold open a good solenoid valve- you need to pick out a valve and check the current draw. I would recomend a 3-6 Ah gel cell battery- should hold a valve open/closed for plenty of time. You could also get a couple of batteries and hook them together in parrallel.

    Also, you'll probably want to use a valve that closes when no power is applied, otherwise your just delaying the inevitable. Eg. the Basic Stamp closes the valve when power is lost, then 3 hours later the Basic Stamp's battery dies and the valve opens again.

    You'll also wanna have a manual open/close switch, in case the circuit malfunctions.

    One last thing- most small rechargable batteries- AA, AAA, 9v, ect. are Ni-Cad or NI-MH batteries- and trickle charging them will·greatly reduce their life and capacity. Because of this, you need a gel cell.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up,·Never submit to the seemingly invincible enemy.

    JS-KB3RBR

    Post Edited (Junk_Bot) : 5/3/2010 9:28:46 PM GMT
  • ihmechihmech Posts: 179
    edited 2010-05-22 02:58
    Hey guys, I came up with·a schematic to share with all of you.· Is it a valid design?· If not what do I need to do to make it work.· Also, any improvements to it would be appriciated!

    Post Edited (ihmech) : 5/22/2010 3:03:07 AM GMT
Sign In or Register to comment.