Laptop Power&Batteries

From FreekiWiki

Jump to: navigation, search

Contents

Safety

A large amount of energy can be stored in a laptop battery. Make sure to remove the main battery before disassembly of a laptop, and NEVER short battery terminals for any reason.

Laptop batteries contain toxic metals. If a laptop battery shell is broken, is unusually hot or is smoking, STOP and immediately check with your instructor.

Laptops can also contain a small battery for CMOS maintenance. When removing those batteries if failed or if disassembling a laptop for recycling, take the same precautions, and store the battery in the designated location for CMOS batteries.

K7aay 19:17, 21 May 2008 (PDT)


Power Management

i386 architecture comes with two different forms of power monitoring and control, APM and ACPI. These are both capable of showing how full a battery is and of putting the computer to sleep. The freekbox3 laptop install has two grub menu options, one for each, defaulting to APM. This default should be changed on laptops that run well with ACPI (either by changing the 'Default' option, or moving the menu entries around).

APM

This is the older of the two protocols, but is also compatible on newer computers with ACPI. It has fewer capabilities, and is therefore simpler to use.

To find out how much charge a battery has, you can run various battery monitoring tools (xapm), some of which plug into various window managers' toolbars, or you can ask at the command line with 'apm'.

Only suspending to memory is supported for sleep states, and this can be tested at the command line with 'apm -s' (as root). The power should turn off, but the power light should still be blinking. While in this state, some power consumtion to keep the memory refreshing. Hitting the power button should then bring the computer immediately back to where you left it without going through the boot process.

ACPI

ACPI is actually used for far more than just power management. It has interfaces for monitoring pretty much all the hardware signals a motherboard uses, from keys being pressed to the lid being closed to the speed of the cooling fans. We only care about the power management part, though.

To find out how much charge a battery has, there are again various graphical tools, many of which you can ask your window manager to put into your toolbar, or the command line will respond to the 'acpi' command. 'acpi -V' will display more information.

Multiple different sleep states are supported, and you can find out which with 'cat /sys/power/state' at the command line. 'standby', 'mem' and 'disk' are common. 'standby' is the softest of them all, and doesn't stop any processes, really. 'mem' is basically the same as APM's suspend. 'disk' will copy all running programs to disk and completely turn off the computer. Returning from disk suspention takes than the other sleep states, and will go through the normal initial boot process (grub menu, &c.), but will still be quicker than shutting down and restarting. To test if any of these work, do 'echo standby > /sys/power/state' as root (replacing 'standby' with 'mem' and 'disk' to test them).

Battery Life

Batteries are often the first thing to go wrong with a laptop, mostly in the loss of ability to hold a charge for very long. The time a computer can spend running off of a battery with go from a few hours when first purchased to a few minutes after relatively short amounts of laptop use. There are some recommended practices to extend battery life, but once they're dead, they're dead.

To test how long a battery lasts, we cannot rely on the output of 'apm' or 'acpi'. As batteries degrade, they misreport their charge and capacity, and so will behave very discongruously during discharge (jumping quickly from 50% full to 5% full, for instance). We need to test their life manually. First, we need to first charge it fully (check using a battery monitoring tool). Then we need to drain it while something runs (i usually play a cd) and time it. You can use the following script to help you time it:

#!/bin/sh

FILE=~/battery_test.log

BATT=apm
acpi_available && BATT='acpi -b'

while true; do
    date >> $FILE
    $BATT >> $FILE
    sleep 10
done

Then wait till the laptop runs out of power, plug it back in and look at the battery_test.log file. Compare the time at the top with the time at the bottom, do some subtraction, and record how long the battery life is. Some laptop BIOSes have battery calibration programs that do the same sort of thing which you can run instead to make the 'time remaining' output of both 'apm' and 'acpi' more accurate.

Links

  • Laptop Batteries Guide.com

http://www.laptop-batteries-guide.com/