5v power supply + battery overview

Discussion in 'The Projects Forum' started by slapshot136, Oct 31, 2012.

  1. slapshot136

    Thread Starter New Member

    Oct 31, 2012
    16
    0
    Hi,

    I want to create a home-made power supply for a Raspberry pi + USB hub, I am looking for something along the lines of a 1.5-2A 5V regulated power supply, and would like to also have it attached to a backup battery in the event of a power failure

    I was going to start off with this circuit, but wanted to modify it to suit my needs and thought I would ask for some help before I started ordering parts since I don't have much experience with circuits, I have a programming background
    [​IMG]
    my first "obstacle" is that I have a 24V power source that I would like to use, as opposed to a 12V one as shown in the diagram. The LM2596 I am planning to use should support up to 37V, but I wanted to know if there are any other changes I should make to the circuit knowing that.

    second, what would be the best way to attach a battery? I already have 2x 3.7v 2500maH li batteries from a dead spare phone charger (the circuit died and I disassembled it), or I could also play with some standard 1.2v aa or aaa batteries that I have lying around the house (I would prefer not to buy stuff unless I need to, and batteries seem expensive) - would it be OK to just combine a 3.7 v and a 1.2v battery in series and hook them up directly to the 5v power, or would this kill the batteries? (They are only for backup, and won't be used on a regular basis), or would it be best to put them before the power regulator? I am not looking for a long runtime, something along the lines of 5-10 minutes should be fine (but I think I will end up with longer due to the size of the batteries relative to my power requirements)

    third, if possible I would like to hook up the backup battery circuitry to the GPIO pins of the raspberry pi, which are capable of 3.3 (not 5V!) so that the device knows if it's on battery power and how much is left (if possible, but maybe I am getting ambitious - I just want the device to shut itself down)

    P.S. I would prefer to stick with the LM2596 if possible as I have already ordered that
     
  2. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,999
    745
    no mods required for 24v supply as long as the capacitors are rated at 35volts or higher,

    you can alter the output voltage by changing the resistors R1 or R2 so if you want 3.3 v instead make R2 a variable 4k7,
    this will give you 1.23v to 7volts

    see page 13 of manual http://www.ti.com/lit/ds/symlink/lm2596.pdf


    as for the batteries as long as they are all of the same capacity in series is ok, ie 3.7v and 1.2v both 2500Mah will do
     
    Last edited: Nov 1, 2012
    slapshot136 likes this.
  3. slapshot136

    Thread Starter New Member

    Oct 31, 2012
    16
    0
    Thanks for your reply, actually I am using the 5v version (non-adjustable) because I need 5V at the power source, but then for the sensor (to check the battery charge), it needs to be 3v (or less), but I am at a loss as to exactly how I would measure the battery's charge at that point, I suppose the easy solution would be to use another lm2596 that reduces the 5v to 3v and to connect it with a diode to the 5v supply, and then have that connect to one of the sensor ports

    is it OK to keep the batteries connected directly to the power circuit 24/7?
     
  4. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,999
    745
    not agood idea to keep batts connected, unless you have a trickle charger,the only way to monitor the batt voltage is with a resistor divider across the batteries, with the charger disconnected .
     
  5. slapshot136

    Thread Starter New Member

    Oct 31, 2012
    16
    0
    would it essentially be a trickle charger since the charging voltage = the battery voltage (and not any higher), or would I need to set up something with a diode and a resistor such that when charging, the max current is small?

    hmm.. so I can't check the battery charge while charging them? how does a phone for example do it then? do they just disconnect the battery while charging for a short interval in order to get a reading?
     
  6. bountyhunter

    Well-Known Member

    Sep 7, 2009
    2,498
    507
    The 2596 should work for the 5V converter.

    You need a higher voltage than 5V to keep the battery charged.

    You could set up a trickle charge (resistor/diode) from the input voltage to the battery +. You could use a lead acid battery with several silicon diodes connecting it to the 5V rail so it won't source current until the 5V rail loses power.

    You can't trickle charge Li batteries, don't try that.
     
    slapshot136 likes this.
  7. slapshot136

    Thread Starter New Member

    Oct 31, 2012
    16
    0
    lead acid batteries are a bit bigger than what I want to use.. can you offer any alternatives that would with just Li batteries, or would that require a complex circuit?

    alternatively, I guess I could hook up a couple of these 1.5f capacitors, if I go with a 5v 1A draw, each should last me .5(1.5)(5)^2 ~ 18 seconds, or would it be better to go with a higher voltage capacitor at the 24v part of the circuit? or would the voltage drop below 4.8 within a few seconds? (I just need a small amount of time for the computer to do a nice shutdown)
     
  8. bountyhunter

    Well-Known Member

    Sep 7, 2009
    2,498
    507
    The LI batteries just need an accurate charger that will hold the battery voltage at whatever the maker says (typically 4.2V/cell ballpark) in constant voltage mode. You would need a dedicated charger circuit for that.

    If it's a one off, you might use a voltage regulator like the LM2941 with a trimpot so you can dial in the voltage precisely to set the voltage to charge the Li batteries..
     
Loading...