PINE64
+LTS/SOPINE Powering the A64 LTS from a LiPo - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Pine A64 Hardware, Accessories and POT (https://forum.pine64.org/forumdisplay.php?fid=32)
+---- Forum: Lithium and RTC Ports (https://forum.pine64.org/forumdisplay.php?fid=44)
+---- Thread: +LTS/SOPINE Powering the A64 LTS from a LiPo (/showthread.php?tid=12420)



Powering the A64 LTS from a LiPo - belsamber - 12-05-2020

It took me a while to collect this information from across various threads and the schematic, so I wanted to summarise it back and hopefully make life easier for other people in future.

I have an A64 LTS (2GB) and I am now powering it from a battery pack made of 4 x 18650 cells in parallel. It's also driving a medium sized LCD which is powered by USB, which resulted in some extra complexity in getting enough power to the USB port. 

So, points to note:

1. Battery temp sensor 
The middle wire on the battery connector either has to be connected to a thermistor or to a 10k resistor connected to GND, otherwise the battery will not charge (still powers things fine though)

2. Power jumpers 
There is a pair of jumpers on the board marked DC5V and BAT. According to the schematic, you should jump DC5V if you are powering just from the DC adaptor (default,) jump BAT if you are powering from battery, or have neither connected if you are powering from both. Since I was intending to use this in a portable device (like a laptop) I assumed "both" was correct and had none of the jumpers connected, however this did not give me enough power to the USB. I had to leave BAT jumpered. This seem to work fine - not sure if anyone would care to elaborate on what this actually does. I can see the DC5V jumper connects the DC adaptor to the 5V line, so I assume having it disconnected means that everything is being powered from the AXP803, but I can't figure out what the BAT jumper is doing... If anyone can explain that one to me, it would be great :-)

3. Charging rates with high power USB devices 
Once the battery was discharged, I was struggling with charging it again. It turns out that the Pine and the USB powered screen together were using almost exactly as much power as the AXP803 was putting out when on battery - actually with loaded CPU it was drawing from the battery even with the power adaptor plugged in which isn't great. Thankfully I could adjust the power draw from the DC adaptor using the following path:

/sys/class/power_supply/axp813-ac/input_current_limit

This was set to 1.5A, though according to the data sheet it supports up to 4A. The next higher supported value was 2A (0.5AS increments), which gave me enough headroom to run the device and charge without having to pull from the battery in high load situations. Massive win. The AXP803 does get warmer from pulling more current when the device is both in use and charging, but I have a 3A DC power supply, a well ventilated case and I added a heatsink to the power chip (an old one off an RPI3 set worked perfectly) so to my mind this is moderately safe... If anyone would like to tell me otherwise I'm all ears.

4. Other useful battery tweaks 
The other useful attributes are in:

/sys/class/power_supply/axp20x-battery/

Check the uevent file in that folder to see a summary of what is available - it includes the remaining capacity (percentage) so I'll be using this to drive a "low battery" LED. Notably here you can change the min/max voltage and the max charging current (default is 1.2A, max is 2.8A according to the data sheet, and it's settable in 0.2A increments.) I've kept these at defaults for now, but I may reduce the maximum charging voltage to 4.1V or lower since I have a tendency to use my battery powered devices plugged in a lot, and this slightly lower voltage should increase battery life. Theoretically I could increase the charging current since my battery pack is around 12Ah, but decided to limit the amount of time the AXP803 is working above "typical" values, so stayed with the default on this.

I hope that's a useful summary for someone in future :-)


RE: Powering the A64 LTS from a LiPo - tllim - 12-08-2020

(12-05-2020, 10:51 PM)belsamber Wrote: It took me a while to collect this information from across various threads and the schematic, so I wanted to summarise it back and hopefully make life easier for other people in future.

I have an A64 LTS (2GB) and I am now powering it from a battery pack made of 4 x 18650 cells in parallel. It's also driving a medium sized LCD which is powered by USB, which resulted in some extra complexity in getting enough power to the USB port. 

So, points to note:

1. Battery temp sensor 
The middle wire on the battery connector either has to be connected to a thermistor or to a 10k resistor connected to GND, otherwise the battery will not charge (still powers things fine though)

2. Power jumpers 
There is a pair of jumpers on the board marked DC5V and BAT. According to the schematic, you should jump DC5V if you are powering just from the DC adaptor (default,) jump BAT if you are powering from battery, or have neither connected if you are powering from both. Since I was intending to use this in a portable device (like a laptop) I assumed "both" was correct and had none of the jumpers connected, however this did not give me enough power to the USB. I had to leave BAT jumpered. This seem to work fine - not sure if anyone would care to elaborate on what this actually does. I can see the DC5V jumper connects the DC adaptor to the 5V line, so I assume having it disconnected means that everything is being powered from the AXP803, but I can't figure out what the BAT jumper is doing... If anyone can explain that one to me, it would be great :-)

3. Charging rates with high power USB devices 
Once the battery was discharged, I was struggling with charging it again. It turns out that the Pine and the USB powered screen together were using almost exactly as much power as the AXP803 was putting out when on battery - actually with loaded CPU it was drawing from the battery even with the power adaptor plugged in which isn't great. Thankfully I could adjust the power draw from the DC adaptor using the following path:

/sys/class/power_supply/axp813-ac/input_current_limit

This was set to 1.5A, though according to the data sheet it supports up to 4A. The next higher supported value was 2A (0.5AS increments), which gave me enough headroom to run the device and charge without having to pull from the battery in high load situations. Massive win. The AXP803 does get warmer from pulling more current when the device is both in use and charging, but I have a 3A DC power supply, a well ventilated case and I added a heatsink to the power chip (an old one off an RPI3 set worked perfectly) so to my mind this is moderately safe... If anyone would like to tell me otherwise I'm all ears.

4. Other useful battery tweaks 
The other useful attributes are in:

/sys/class/power_supply/axp20x-battery/

Check the uevent file in that folder to see a summary of what is available - it includes the remaining capacity (percentage) so I'll be using this to drive a "low battery" LED. Notably here you can change the min/max voltage and the max charging current (default is 1.2A, max is 2.8A according to the data sheet, and it's settable in 0.2A increments.) I've kept these at defaults for now, but I may reduce the maximum charging voltage to 4.1V or lower since I have a tendency to use my battery powered devices plugged in a lot, and this slightly lower voltage should increase battery life. Theoretically I could increase the charging current since my battery pack is around 12Ah, but decided to limit the amount of time the AXP803 is working above "typical" values, so stayed with the default on this.

I hope that's a useful summary for someone in future :-)

2. The power jumper is for USB power source selection whether come from +5V or battery power.


RE: Powering the A64 LTS from a LiPo - Voidwatcher - 03-18-2023

Hey there Belsamber.  On the off chance you're still lurking about the PINE64 forums, I just wanted to tip my hat to you and say you've inspired me to do something quite similar to your Model 100 / PINE64 project.

In my case, however, I chose the Tandy 102's keyboard as it feels much better to my fingers. I happened to have a dead 102 in my stash of retrocomputers.  While the keyboard is definitely preferable to me, I wasn't able to use the actual Tandy 102's case as it is quite a bit thinner than the TRS-80 Model 100 and wouldn't fit the 4-cell 18650 battery pack, PINE A64-LTS v2 board, and 8.8" 1920x480 display inside the case.

However, I *also* had a TRS-80 Model 100 that had a damaged motherboard.  This just meant marrying the Tandy 102 keyboard with a Model 100 case.  Not too big of a deal except it lacked a few of the holes in the PCB which must be used to affix the keyboard to the top-case of the M100.  That was easily fixed with a drill, and lucky there weren't any traces close by. Also, there's only 18-pins instead of 20 on the 102's keyboard connector, and it is an edge connector instead of the JST type.  With an edge cable recepticle, this was easily solveable and the wiring was mostly the same, just shifted a tiny bit.

I actually was able to reuse your keyboard strobing python script, and I highly appreciate the work you did putting that together.  

Anyway, just wanted to say thank you for the inspiration.  I probably should write it all up and snap photos and post a blog entry at some point..

Regards,
Voidwatcher