Connect with us

2S LiPo charger / 12V power supply - possible?

Discussion in 'Power Electronics' started by Andy.wpg, Sep 19, 2015.

Scroll to continue with content
  1. Andy.wpg

    Andy.wpg

    19
    1
    Apr 8, 2015
    Hi all. I have searched the entire (it seems) internet, but can't seem to find what I'm looking for. I've found lots of chargers, and lots of power supplies, but not a combination.

    I am creating a device (for me - not a school project) that has an 'acquisition unit' that measures a couple of temperatures and controls a fan. Using XBee radios, the data is sent to the 'control unit' that has an LCD display and a couple of buttons for control. The acquisition unit will be plugged into a power supply all the time, and the control unit will be battery powered and mobile.

    My control board has a 3.3V power supply using an LM317. I am monitoring the input voltage using a voltage divider and an analog port on the MCU. When the supply voltage drops to a preset level, there will be a warning to plug in the power supply.

    Here is the problem. I would like to use a 2S LiPo battery (7.4V) to have some overhead for the LM317. When I plug in the power supply (12VDC wall-wart), I want to charge the battery with a MCP73213 charge controller, while simultaneously providing 12VDC to the LM317.

    The first image is one I found (I'm darned if I can find it again though):

    [​IMG]

    My modification is this:

    [​IMG]

    Sorry for my lousy drawing abilities. My question is this: Am I on the right track here? When the switch in the power jack transfers, am I going to get a power dropout? If so, is there a way to combat that?

    Thanks for any help you can offer. I really appreciate it.

    Andy
     
  2. Old Steve

    Old Steve

    734
    169
    Jul 23, 2015
    I see problems with both circuits. The first will only work if the 12V input rail pulls to a good solid ground when the power is cut, to turn on the MOSFET and provide a return path for the load. I'm assuming that the 73213 can't conduct backwards, too, or there'll be a short across the battery.

    Your circuit suffers from a similar problem - there's no ground connection to switch on the MOSFET when the power is cut. The MOSFET's gate would be open and floating. You could add a resistor to ground from the bottom of the 100 ohm resistor, say 1K. Actually, you can remove the 100 ohm resistor altogether, keep the gate connection to the Vdd pin and also connect this point to ground via a 1K resistor. The wall-wart won't mind the extra 7mA drain.

    If the Vdd pin of the 73213 internally connected to ground when it was unpowered both circuits would work, but it doesn't.

    Another point - I don't know if the 73213 would possibly be damaged with battery power applied to the Vbatt pin(s) when there is no input voltage, but it's probably designed in such a way that this isn't a problem.

    I don't think I've overlooked anything....
    Edit: I made a mistake originally, but just corrected it. :D
    Edit2: And thinking about it some more, when the first circuit is powered, the MOSFET's internal diode would conduct, with current flowing through the load backwards from +12V to the battery and into the Vbatt pins on the 73213.
    I think I'm done now.
     
    Last edited: Sep 19, 2015
  3. GPG

    GPG

    452
    66
    Sep 18, 2015
    How much current to operate the load?
     
  4. Arouse1973

    Arouse1973 Adam

    5,164
    1,081
    Dec 18, 2013
    I had the same problem with this device I designed in to a product. DO NOT DO THIS, you risk blowing up the batteries. You can not use a P-channel MOSFET, it will conduct the opposite way and start charging the battery from the supply. This is very dangerous!!
    The device goes into shutdown mode if the input voltage is lower than battery voltage. You can do this with an n-channel but you would need a boost circuit to drive the gate. I opted for a simple diode.

    I was told by Microchip that it had auto switch over, but it doesn't. All I did was connect a diode from the battery to the load and connect the supply the load side of the diode. This now works how I want it to. I too had trouble finding an auto switch over 2 cell linear charger. You can get switchers that do it but they are far more complex a circuit.
    Adam
     
    Old Steve likes this.
  5. Old Steve

    Old Steve

    734
    169
    Jul 23, 2015
    I thought that was the case Adam. BANG!!!
    Thanks for confirming my diagnosis in the case of the first circuit, and stressing the point more strongly than I did.
    I didn't realise that the second circuit will do the same until right now. Duh. +12V through diode, back through MOSFET internal diode and, once again, BANG.
    It would have been easier to mentally picture if the internal diode was drawn in.
     
    Last edited: Sep 19, 2015
    Arouse1973 likes this.
  6. Old Steve

    Old Steve

    734
    169
    Jul 23, 2015
    So you did this? :-
    (I guess there's a 317 before the actual load, but this is the basic cct.)

    scan017.JPG

    Edit: So all three of us made the same mistake - I wonder how many others have done it and actually blown up batteries?
    It's a good reason why that MOSFET internal diode should always be drawn in. It would help to avoid this type of error.
     
    Last edited: Sep 19, 2015
  7. Andy.wpg

    Andy.wpg

    19
    1
    Apr 8, 2015
    I can't see it being much over 300-400ma. I'm only running a PIC18F2550, a 20X4 LCD (extra 75ma if the backlight is on), and a low power (100ft) XBee radio.
     
  8. Andy.wpg

    Andy.wpg

    19
    1
    Apr 8, 2015
    I knew there was something that bothered me about those circuits! I just couldn't wrap my head around what it was.

    I like the diode idea. Any thoughts on dropout during the transfer to 'wall wart mode'? I know that switch is going to bounce at least a couple of times until it settles down.

    Thanks for the replies!
     
  9. Old Steve

    Old Steve

    734
    169
    Jul 23, 2015
    I'm just glad Adam pointed out that neither version would work, even with the resistor I suggested for the second one.
    I'm still kicking myself for not seeing that fault in the second circuit, especially after seeing it in the first.
    Oh well, all's well that ends well.

    You shouldn't have a 'dropout' as such, not like you'd have using a relay, just a bit of a surge/spike possibly. I think that if you use a pair of caps on the input side of the LM317, you shouldn't have a problem. One larger electro cap to suit your load, then a small one across it, 0.01uF to 0.1uF.
    It's hard to say definitively whether or not you'll still have any problems. Just make sure everything is well bypassed with caps.

    You might not even need the switch, either.
     
  10. Arouse1973

    Arouse1973 Adam

    5,164
    1,081
    Dec 18, 2013
    Spot on!
    Adam
     
  11. Andy.wpg

    Andy.wpg

    19
    1
    Apr 8, 2015
    The only question I have about this is when the charge controller is running. If it was just a charger, the output current would just go through the battery. In thus configuration, some of the current will go through the diode into the load that is parallel to the battery. Is that going to mess up the charge controller as far as the charging profile of a LiPo? Obviously it won't as you've used this before, but I'm not sure why.

    Thanks again

    Andy
     
  12. Arouse1973

    Arouse1973 Adam

    5,164
    1,081
    Dec 18, 2013
    No because the diode will be reverse biased due to the fact the PSU voltage will be higher than the battery voltage. The battery charger will effectively have nothing connected to it so it will be fine. I did get a response from Microchip about doing this and they said umm well not sure but it might not like voltage feeding back from the output to the input. I said this is bollocks the device shuts down if the input voltage is less than 50 mV of the battery voltage. Due to the diode drop it will shut down. It doesn't care what is powering it, just that the headroom voltage is catered for when charging, which it is. I heard nothing more from Microchip :) give it a go it will be fine.

    Thanks
    Adam
     
  13. Andy.wpg

    Andy.wpg

    19
    1
    Apr 8, 2015
    Thanks for the explanation. To mollify the Microchip engineers - even though you explained why feedback won't happen - what about this? One more part and the drop across the new diode is meaningless. And I'm pretty sure that Old Steve is right - no point to the switch, the voltage is either there or it isn't.

    [​IMG]
     
  14. Arouse1973

    Arouse1973 Adam

    5,164
    1,081
    Dec 18, 2013
    Yep that will work. Well done. Although you are wasting energy with the extra diode but I guess everyones happy now. Good work.
    Adam
     
  15. GPG

    GPG

    452
    66
    Sep 18, 2015
    As far as I can see, after much perusal of the data sheets, You can run the load directly across the battery so long as Rprog is set low enough to supply more than the load uses, the excess charging the battery. The battery must be able to be charged at this current when the load is off and the battery is below the charge voltage limit eg when the plugpack is plugged in after potable use. The PIC should be able to turn the load off when the battery is at discharge voltage.so;
    . http://www.linear.com/product/LT1129
     
    Last edited: Sep 21, 2015
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-