Author Topic: Handling battery to wall power brick switching  (Read 1219 times)

0 Members and 1 Guest are viewing this topic.

Offline dinsTopic starter

  • Newbie
  • Posts: 5
  • Country: au
Handling battery to wall power brick switching
« on: April 28, 2019, 02:50:40 pm »
Hello all, I have been working on a Bluetooth speaker and while I have smoothed out most of the electricals I have one issue I can’t get my head around.

So I am using 3x 18650 cells to make a 12v internal battery to power this, but I also want to have it charge and run via your typical dc barrel jack with a wall power brick. I believe I have the basics covered, low and high voltage cut off, short protection and weak but at least present balancing with a cheap bms, and I will charge with a SY6912 dedicated cc-cv board that steps down the voltage itself and has safety timers and I am guessing cut off once the battery is at the right voltage.

Now my problem appears when I look at the following, I need to keep the battery and its charging circuit separate from the power of the wall power brick once its plugged in else the power brick will be forever leaking current in to the battery charging it directly which is not desired.   the dc barrel jack has the ground switching ability in it but that is useless since all the grounds are connected any way, the charger has a common ground by the looks of it so I need to switch the positive side once the power brick is plugged in.

I want to avoid having a power brick that has tip ground and jacket positive which would give me switching on the positive side using the jacks inbuilt switch. BUT since that is the complete opposite of what every power brick I have seen uses and I don’t want some one plugging in some other brick and giving it reverse polarity.

I want to switch the two supplies with the least power loss, but with the smallest size device, so fets are the best option over physical relays right?, they don’t waste much power at all so long as the gate is fully engaged right?

The other thing I need is for the battery to be connected by default when the power brick is unplugged, and it should use minimal power if none to keep that battery connected. So once again fets are the best?

Secondly I know roughly how n and p, or mosfets work, one needs high voltage at the gate to let power flow from source to drain while the other I think is open by default at low voltage, but I cant get my head around how to arrange them with the two different power supplies I have, and I think you can get some back flowing current through a mosfet so would need a diode to stop unwanted power flowing back in to the battery from the power brick ? I know diodes will drop the voltage and waste some power so it would be neat if there is a way to avoid that from happening with out wasting power from the battery, I don’t mind wasting power from the power brick side however.

Can some one tell me if I am on the right track with all the above and maybe suggest how to switch these or offer a better alternative?

Attached is a picture of how I intend to set this up and you can get an idea of what will happen if the two positive lines are just directly connected.


And the load this all powers isn’t much, it might take 2 amps at most and it can handle 12-20 volts, I have ordered a few AO4606 N+P mosfets thinking I can use either channel type and they can handle 6 amps and up to 20v by the looks of it.

 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Handling battery to wall power brick switching
« Reply #1 on: April 28, 2019, 02:57:47 pm »
Power supplies with barrel jacks these days are almost universally connected with negative to the outside of the barrel and positive to the inside.

I thought the purpose of the battery circuitry was precisely to stop the charging when the batteries were filly charged.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5170
  • Country: ro
  • .
Re: Handling battery to wall power brick switching
« Reply #2 on: April 28, 2019, 03:26:31 pm »
The easiest would probably be to use a simple mechanical relay.
For example, restrict the DC In voltage to 15..18v and get a matching relay ...  maybe use a buck regulator down to 12v if the speaker amp can't handle 15..18v
use a small signal relay to switch between battery and dc in / step-down regulator



alternatively, why not just a couple very low drop diodes ... and maybe a LDO after the diodes, bringing 12.6v - 15...18v (whatever) down to 12v or whatever's safe for the bluetooth.
 

Offline Calambres

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: es
    • Piso-Tones
Re: Handling battery to wall power brick switching
« Reply #3 on: April 28, 2019, 06:43:02 pm »
Power supplies with barrel jacks these days are almost universally connected with negative to the outside of the barrel and positive to the inside.

One notable exception is the musical effect boxes, A.K.A. "effect pedals"... and many other appliances using their same power scheme. They are almost universally powered with both external power sources, via a barrel jack, and an internal 9V battery. The reason why they use positive barrels is to avoid the 9V battery clip to short with the already grounded and negative chassis. This is a side effect of the way the switched barrel female plugs are built: They always switch the barrel side, not the internal stud. This should render the positive terminal of the 9V battery clip always connected to + and subject of shorting easily with the surrounding chassis when a battery is not attached. With the center stud connected to the negative terminal there's no such risk.


Online Peabody

  • Super Contributor
  • ***
  • Posts: 2246
  • Country: us
Re: Handling battery to wall power brick switching
« Reply #4 on: April 28, 2019, 10:49:04 pm »
I think what you need is called "load sharing".  When the mains power is used, it powers both the battery charging and the ultimate device independently.  But if there's no mains power, the battery supplies the current, with no voltage drop.  The circuit normally consists of a p-channel mosfet, a schottky diode, and a resistor.  The versions I've seen are for single LIPO cells and USB power, so yours may be more complicated.  Here are useful links that explain it:

http://blog.zakkemble.net/a-lithium-battery-charger-with-load-sharing/

http://ww1.microchip.com/downloads/en/AppNotes/01149c.pdf

 

Offline dinsTopic starter

  • Newbie
  • Posts: 5
  • Country: au
Re: Handling battery to wall power brick switching
« Reply #5 on: April 29, 2019, 02:04:12 am »
the bms / protection circuit should disconnect the battery when its over charged, they usually specify 4.3v cut off which is pretty high, but i have read a lot on li-ion cells, its best to charge them via cc then cv, plus the bms may not cut off the dc from the wall power brick as the voltage may never reach cut off height from various resistances i guess, this leads to a constant trickle charge, a proper charger will avoid the trickle charging which li-ion does not like apparently. it should be charged by a proper charger not direct dc from the power brick if you want the battery to last as long as possible is what i have figured out from various internet sources!
 

Offline dinsTopic starter

  • Newbie
  • Posts: 5
  • Country: au
Re: Handling battery to wall power brick switching
« Reply #6 on: April 29, 2019, 03:12:25 am »
I think what you need is called "load sharing".  When the mains power is used, it powers both the battery charging and the ultimate device independently.  But if there's no mains power, the battery supplies the current, with no voltage drop.  The circuit normally consists of a p-channel mosfet, a schottky diode, and a resistor.  The versions I've seen are for single LIPO cells and USB power, so yours may be more complicated.  Here are useful links that explain it:

http://blog.zakkemble.net/a-lithium-battery-charger-with-load-sharing/

http://ww1.microchip.com/downloads/en/AppNotes/01149c.pdf

this looks to be like what i was originally thinking but very eye opening thanks, in the article it states "internal MOSFET diodes have a drop of around 0.6V" i looked up a bit on the body diode but im not sure about something, does that voltage drop waste battery energy when the load is sourcing power from the battery? that is a pretty big waste of power.

If so maybe i could use mariush's suggestion of two much lower voltage dropping diodes to prevent power from one source leaking in to the other, but having read that article you linked it states how if the battery side is leaking any power even milliamps it can effect the charging sensing,  i am not sure if any power from the charging/battery side would be pulled by the load if there is a higher voltage supply from the wall power brick? attached is that idea
« Last Edit: April 29, 2019, 03:14:05 am by dins »
 

Online Peabody

  • Super Contributor
  • ***
  • Posts: 2246
  • Country: us
Re: Handling battery to wall power brick switching
« Reply #7 on: May 22, 2019, 02:12:14 am »
Sorry to be late replying.  I didn't see your last post until now.

When the battery is supplying the load, the mosfet is turned on.  If that's the case, then the body diode is completely bypassed by the drain-source path, and no current is flowing through the diode.  So the diode voltage drop is irrelevant.

If the charging power source is powering the load, then the mosfet is turned off, and its body diode is reverse biased because the voltage on the cathode side is higher than the battery voltage.  So again, no current flows through the body diode.  There IS loss in the diode through which the charging source powers the load - when that is happening - but that doesn't affect battery life.

The only loss applicable to the battery is whatever the mosfet's RDSon is.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf