Heads up. A20 on battery still supplies power via the 5V rail

Started by dave-at-axon, September 04, 2014, 02:14:31 PM

Previous topic - Next topic

dave-at-axon

Hi All,

Just a heads up and something I discovered today.

The 5V rail still has power on it when the device is in the powered off state if you have a LiPo battery connected. This is no concern for those using the A20 standalone or for those who don't draw anything from the 5V power rail.

If you do power devices on the 5V rail, you will still be powering them when the unit is powered off but the battery is still connected. This is due to the fact that the switching supply has the coil across the input to the output. Normally when this device is activated, the output is regulated to 5V but when exten is off, the output tracks the LiPo voltage less the voltage drop across the Schottky diode on the same switching supply.

If you intend to use the 5V rail for anything you will need to add in a FET switch to enable and disable this based on the 3.3V rail. This is what I have done to my board today and it works well with this arrangement.

I couldn't figure out why the battery was discharging so fast in the off state until I spotted it today that it was powering my RS485 drivers all the time. Small current but still enough to drain the battery.

This probably applies to any other board that uses the same power supply arrangement.

NK

Excellent find.
Does this means, anything attached to USB port(s) draws power when powered by battery?

dave-at-axon

No, the USB is powered down so there is no current drawn by any device still connected.

I am modifying a board today and leaving it off for the weekend after fully charging it and I will report what I find on Monday.

JohnS

I recall post(s) about LiPo not lasting very long.  I wonder if the poster(s) had 5V going somewhere....

John

dave-at-axon

#4
My testing went well except for one small issue and that seems to be related to drivers for the AXP209.

The good news first.

I got the battery up to 72% on Saturday before I switched it off to let it sit in the off state. Powered off from holding down the power button, not put into standby mode.

Power it up this afternoon with external power it is still showing 72% capacity. This is great as previously it was losing charge after so many hours left in this state.

I can power it down and power it back up a number of times and it still shows 72%.

Now for the issue.

When I power it up on battery only, the display was showing 18%. I powered it off, powered back up on external power and it was reading 72%. Mmmmm

Powered off and back on battery only and it again shows 18%.

When it boots up on batter only, the debug port shows

bat vol = 3901 mv

Which is clearly not an 18% reading. As I have it set for 3600 for shutdown to avoid strange voltages on the 3.3V rail, this should be closer to 50%. It's strange that on ext power it shows as 72%.

I need to dig into the kernel for the AXP209 driver to find out why this is and see if I can look at some debug output from the device.

dave-at-axon

On Thursday morning (11th Sep) I switched off the unit with 100% battery capacity. Left it over the weekend with no external power or USB and today when I powered up it is showing 100% so I now know that the fix to disable the 5V power rail when powered off works and I now no longer take power from the battery.

Spark

Quote from: dave-at-axon on September 15, 2014, 12:24:25 PM
On Thursday morning (11th Sep) I switched off the unit with 100% battery capacity. Left it over the weekend with no external power or USB and today when I powered up it is showing 100% so I now know that the fix to disable the 5V power rail when powered off works and I now no longer take power from the battery.

Hi,
Would you share the fix?

dave-at-axon

There is no fix to the A20 itself.

What you have to do is put a FET switch or some other way to switch the 5V output from GPIO pins and use the 3.3V line to enable this.

I used a P channel FET on the 5V output from the GPIO connector and this is driven by an NPN transistor who's base is connected via a resistor to the 3.3V rail. When the 3.3V rail comes up, the transistor switches the gate on the FET to GND turning it on. I also have a resistor from the 5V rail to the gate on the FET to keep it switched off when the 3.3V is off. Works a treat.

Alep

To avoid this problem for the power of my external devices I use (for the 5 volt) the power supply of the hard disk or of the USB ports. This port are all turned off when the computer is off and I can turn on or turn off also from my programs

dave-at-axon

Quote from: Alep on September 20, 2014, 11:15:21 AM
To avoid this problem for the power of my external devices I use (for the 5 volt) the power supply of the hard disk or of the USB ports. This port are all turned off when the computer is off and I can turn on or turn off also from my programs

Correct. The USB and the SATA power are controlled so they would be off.

The issue I was indicating to was for those who might use the GPIO connector 5V pin and this is not powered off and receives the battery voltage (less the voltage drop of the diode) in the power off state.