Sunday, July 25, 2010

Does screen brightness significantly affect battery life?

Many laptops will automatically dim the screen when running on battery power in order to conserve energy. But does this significantly increase the battery life? How much power is actually saved when the screen's brightness is turned down? My guess has always been that the energy savings are negligible, that a darkened screen might give the laptop 10 more minutes of battery life, nothing more.

To discover the answer, I ran a small experiment. I ran a script which polled the battery data on my netbook every 5 seconds. I monitored this data for 2 minutes with the screen on its brightest setting and 2 minutes with the screen on its darkest setting. I disabled my netbook's wireless network card and muted the speakers to avoid any interference in the data. The results were marginally better than I expected:

Avg. mABat. life
(4200 mAh battery)
Brightest1120.83h 42m
Darkest1018.64h 7m

If kept on its darkest screen setting, my netbook battery would last about 25 minutes longer. If the brightness were to be set somewhere in between the two extremes to a level where the screen would actually be readable, the energy savings would probably be about half that--12.5 minutes.

The battery data was collected from "/proc/acpi/battery/BAT0/state". The script used to poll the data was written in PHP and is shown below:

 $state = file_get_contents('/proc/acpi/battery/BAT0/state');

 preg_match('/present rate:\\s+(\\d+)/', $state, $matches);
 $presentRate = $matches[1];

 echo date('M d G:i:s'), ' ', $presentRate, "\n";


Wednesday, July 21, 2010

UNetbootin Troubles

If you are having trouble running the UNetbootin Linux binary, you can try installing it using apt-get. This will automatically download and install any required dependencies.

1. Add the following lines to "/etc/apt/sources.list".
deb [name] main
deb-src [name] main
Where "[name]" is the name of your Ubuntu version:

2. Add the GPG key.
sudo apt-key adv --keyserver --recv-keys 72D340A3
3. Get the list of packages from the newly added source.
sudo apt-get update
4. Install UNetbootin. It will appear in the "System Tools" menu.
sudo apt-get install unetbootin
1. How to install UNetbootin in ubuntu