SlideShare a Scribd company logo
1 of 47
The Effect of CPU Clock Rate on Power
Consumption
Investigation by Marc Gong Bacvanski
7’th Grade
1
Table of Contents
1. Introduction ..................................................................................................................4
1.1 Importance: saving energy used by computers ..........................................................4
1.2 Factors impacting power usage.................................................................................4
1.3 Our focus: CPU clock frequency.................................................................................5
1.4 Impact of CPU clock frequency on power usage.........................................................5
1.5 Objective of experiment...........................................................................................5
2. Research........................................................................................................................6
2.1 Power.......................................................................................................................6
2.2 Voltage.....................................................................................................................6
2.3 Current.....................................................................................................................6
2.4 Measuring Voltage, Current, and Power....................................................................6
2.5 Clock Rate ................................................................................................................7
2.6 Clock rate’s relationship to power.............................................................................7
2.7 PC Power management............................................................................................8
2.8 Raspberry Pi .............................................................................................................8
3. Hypotheses..................................................................................................................10
3.1 If the clock rate is increased, the power usage will increase.....................................10
3.2 If the clock rate is decreased, the power usage will decrease...................................10
4. Technologies Employed in This Experiment ................................................................11
4.1 Hardware ...............................................................................................................11
4.2 Software.................................................................................................................11
5. Materials/Software .....................................................................................................12
5.1 Toshiba Portege Laptop M780.................................................................................12
5.2 Raspberry Pi ...........................................................................................................12
5.3 Fluke 175 True-rms Multimeter...............................................................................12
5.4 Kill-A-Watt Power meter P4400...............................................................................12
5.5 Occidentalis operating system.................................................................................12
5.6 PiInstaller...............................................................................................................12
5.7 8GB Micro SD card & adapter..................................................................................12
5.8 Micro SD Card writer...............................................................................................13
5.9 Standard USB to mini USB cable..............................................................................13
5.10 5V, 1A power supply.............................................................................................13
2
5.11 Microsoft Natural Ergonomic Keyboard 4000 v.1. ..................................................13
5.12 Mouse M-UVDEL1.................................................................................................13
5.13 HDMI to VGA adapter...........................................................................................13
5.14 Dell 2001FP Monitor.............................................................................................13
6. Experiment Workflow: Laptop PC Measurements.......................................................14
6.1 Boot the laptop ......................................................................................................14
6.2 Install CPU-Z...........................................................................................................14
6.3 Set the clock rate....................................................................................................14
6.4 Measure the power................................................................................................16
6.5 Write a program to make the CPU go to 100% load..................................................17
6.6 Saturate the CPU to 100%. ......................................................................................17
6.7 Measure the power................................................................................................17
6.8 Repeat....................................................................................................................17
6.9 Plot the data collected on graphs. ...........................................................................17
6.10 Compare the data trends between the Raspberry Pi and the laptop PC..................17
7. Experiment Workflow: Raspberry Pi Measurements ..................................................17
7.1 Write Occidentalis operating system onto a SD card ................................................18
7.2 Splice the USB cable................................................................................................23
7.3 Connect the multimeter..........................................................................................23
7.4 Boot the Raspberry Pi at 700 MHz clock rate ...........................................................24
7.5 Measure the voltage...............................................................................................24
7.6 Run a program with a loop to increase the CPU load to 100%...................................24
7.7 Measure the voltage...............................................................................................24
7.8 Shut down the Raspberry Pi....................................................................................25
7.9 Change the multimeter contacts .............................................................................25
7.10 Boot the Raspberry Pi at the same clock rate.........................................................25
7.11 Measure the current.............................................................................................25
7.12 Increase the CPU load to 100% ..............................................................................25
7.13 Measure the current.............................................................................................26
7.14 Shut down the Raspberry Pi..................................................................................26
7.15 Repeat measurements with different clock frequencies.........................................26
7.16 Plot the data collected on graphs ..........................................................................26
8. Problems Encountered & Solutions .............................................................................26
3
8.1 Too low clock settings for Raspberry Pi resultedin non-working computer...............26
8.2 Pi cannot boot while using milliamperes setting on multimeter ...............................27
9. Results and Measurements .........................................................................................27
9.1 Laptop PC...............................................................................................................27
9.2 Raspberry Pi ...........................................................................................................30
10. Analysis .....................................................................................................................36
10.1 Laptop PC.............................................................................................................36
10.2 Raspberry Pi .........................................................................................................40
11. Summary...................................................................................................................44
11.1 On the PC.............................................................................................................44
11.2 On the Raspberry Pi..............................................................................................45
12. Acknowledgements...................................................................................................46
13. References ................................................................................................................46
4
1. Introduction
In this project, we investigate how CPU clock rate of a computer impacts the computer’s
power consumption. We test this on CPUs from normal laptop computers and those
commonly used in mobile devices. Results of this experimentdetermine what frequency is
best used for the least power consumption.
1.1 Importance: saving energy used by computers
As the number of computers in our world rapidly increases, including both mobile devices
and laptop computers, the issue of power consumption of these devices becomes crucial.
To add to this, the cost of electricity is also rapidly rising, and the cost to run a computer for
a certain amount of time also increases. Fortunately, there are many factors that can be
changed in computers in order to save electricity; one of the most important factors is CPU
clock frequency.
1.2 Factors impacting power usage
1.2.1 CPU clock frequency
Inside every computer, the hardware chip that performs operations of the system is called
the CPU (Central Processing Unit). The CPU circuitry performs many cycles per second to
perform the operations. CPU clock frequency is how many cycles per second the CPU
operates at. Within each cycle, power is used to perform a single calculation or operation.
CPU clock rate greatly influencespower consumption.
1.2.2 Memory
Memory includes the chips that store temporary information used by the CPU and other
parts of the computer. Memory requires power to store information, although this power is
minimal. Memory is not a significant factor for power consumption.
1.2.3 Hard drive / storage
The hard drive or storage system stores long – term information for the user and operating
system. It requires power to read and write data to the disk.
1.2.4 Display
The display of a computer is where output from the computer is displayed to the user.
Amongst other parts in a computer, the display draws a significant amount of power,
especiallyin laptops and mobile devices.
1.2.5 External devices
External devicesto a computer include keyboards, speakers, mice, and other accessories.
These devices either do not consume much power, or they have an independent power
source.
5
1.3 Our focus:CPU clock frequency
CPU clock frequency is the focus in this experiment,since it is a major factor in overall
power consumption. We will keep all other factors constant, and only change the CPU clock
speed. The user, through an interface, can easilyinfluence CPU clock rate.
1.4 Impact of CPU clock frequency onpower usage
Power usage is heavily influencedby CPU clock
frequency, as shown in this formula. P is Power, C is
capacitance of the CPU, V is Voltage, and f is the CPU
frequency. If the CPU frequency increases and all the
other factors stay constant, according to this law, the power usage should increase
proportionally.
1.5 Objective of experiment
In this experiment,we examine the exact relationship between clock frequency and power
consumption. We use CPUs from personal computers and from mobile devices.
6
2. Research
2.1 Power
2.1.1 Physical laws for power
Power is how you measure the work potential of electricity. It is measured in Watts.
2.1.2 Power = Voltage * Current
To calculate power, multiply voltage and current together.
2.2 Voltage
2.2.1 Voltage gives free electrons a push to move
Voltage is the difference in electric potential betweenpoints. Since differences want to
equalize,this force gives free electrons a push to move from point A to point B. To visualize
this, imagine a pipe. Voltage would be how quickly the water rushes through the pipe.
Source: http://www.creighton.edu/green/energytutorials/electricitybasics/
2.2.2 Voltage required to have current flow
In order to have current flowing betweentwo points, voltage must exist betweenthe two
points.
2.3 Current
2.3.1 Total charge per unit of time
Current is the amount of electricity that flows in a unit of time. In a pipe analogy, where the
speed of the water is voltage, current is how wide the pipe is.
2.3.2 Measured in Ampere
Current is measured in Amperes.
2.4 Measuring Voltage, Current, andPower
2.4.1 Voltmeter
Voltage is measured by a voltmeter. An ideal voltmeter draws no current and should have
infinite resistance. A voltmeter is connected in parallel with the positive and negative wires.
2.4.2 Ampere meter
Current is measured by an ampere meter (also called an ammeter). An ideal ampere meter
has no resistance. An ampere meter is connected in series on one of the wires so that
electricity must flowthrough the ampere meter.
7
2.4.3 Power
Power is the amount of electricity used. In the pipe analogy, power is the volume of water
flowing.
2.5 Clock Rate
2.5.1 How many cycles the CPU performs per second
For a CPU to perform calculations, the circuits in the CPU execute instructions in cycles in
the rhythm of the clock rate. In each cycle, one instruction of the CPU is performed. The
clock rate determines how fast the instructions are executed. More complex operations
may require several clock cycles.
2.5.2 Measured in MHz or GHz
CPU clock rate is measured in MHz (Megahertz) or GHz (Gigahertz). One megahertz is
1,000,000 times per second (10^6), and one gigahertz is 1,000,000,000 times per second
(10^9). If a certain CPU runs at 850 MHz, it means that it runs 850 * 1,000,000 cycles per
second, or 850,000,000 cycles per second. If a certain CPU runs at 2.4 GHz, it means that it
runs 2.4 * 1,000,000,000 cycles per second, or 2,400,000,000 cycles per second.
2.5.3 Underclocking
Underclocking a CPU is to lower the clock rate of a CPU. Through that, the computer should
be slower. Since a single clock cycle takes a certain amount of power and with a lower clock
rate the CPU does not perform as many clock cycles per second, the computer in theory
uses less power.
2.5.4 Overclocking
Overclocking a CPU is to increase the clock rate of a CPU. The main goal of overclocking is
to make the computer faster by having more clock cycles per second. With an increased
clock rate, the computer runs faster, but also draws more power.
2.5.5 Limits to overclocking and underclocking
There are limits to overclocking and underclocking. If a CPU is overclocked too much, it can
burn out from the extra heat created. The heat can melt certain parts of the CPU and also
can cause pieces to warp, thus destroying contacts on the chip and causing the CPU to fail.
While underclocked, a CPU can go below its lowest operating frequency. If it does so, the
capacitors in the chip lose their output charge before the other circuits in the chip use that
charge to do useful work. Hence CPU is not able to function anymore.
2.6 Clock rate’s relationshiptopower
2.6.1 Power related to frequency
Power draw of a CPU should be proportional to CPU clock frequency. This formula (P = CV2
f)
calculates the power consumption of a CPU where P is Power, C is the capacitance of the
CPU, V is the voltage, and f is the frequency of the CPU. Therefore, if the frequency
8
increases and all other factors stay the same, the CPU will draw more power, as seen in the
illustration below.
2.7 PC power management
2.7.1 User can set some CPU settings
On a PC, the user can customize power modes, such power saving, full performance, etc.
One can set the CPU clock frequency.
2.7.2 Automatically adjusts clock within user set guidelines
To adjust the clock rate of the CPU, the user can set a minimum and maximum percentage
of the normal CPU clock rate. The CPU will then pick an optimum frequency between the
user-set minimum and maximum settings. For example,if the user sets the minimum clock
rate to be 50% and maximum to be 75% and the CPU runs at 1 GHz, the minimum clock rate
will be 500 MHz (50% of 1 GHz) and maximum will be 750 MHz (75% of 1 GHz), assuming
the CPU can attain the lower clock rate of 500 MHz. If the minimum and maximum
percentages are set to be the same, the CPU executes at the given frequency.
2.7.3 System will not use unsafe settings for CPU
After the user sets the percentage clock rate, the system checks the feasibilityof the user’s
settings. If the CPU can run at that frequency, the system uses it. Otherwise, if the user’s
setting cannot be attained, the system changes the CPU frequency to a frequency as close
as possible to the user’s setting, but a still feasible frequency. This prevents the user from
damaging the CPU through excessive overclocking and underclocking, and prevents the
system from crashing under extreme underclocking.
2.7.4 Keeping the CPU at a constant rate
If the user sets both the minimum and maximum CPU rate to be the same, the CPU stays at
that set percentage of its full frequency.
2.8 Raspberry Pi
2.8.1 Small, $35 computer slightly larger than credit card
24
Power
Consumption
CPU Clock Rate
9
Designed by Broadcom in UK, this tiny microcomputer was intended as an educational
device for computer classes. It provides the
user many options for hacking and customizing
hardware settings.
2.8.2 CPU
The CPU on the Raspberry Pi is the same as that
used in many smart phones and mobile devices,
such as the Apple iPhone 3GS. On the
Raspberry Pi,the user can control the CPU clock
rate.
2.8.3 Hardware Settings on Pi
To change the hardware settings on the Raspberry Pi, such as the CPU clock frequency, the
user needsto access the file /boot/config.txt. It contains information for the CPU about
how to boot and its clock frequency. Once the file is changed, the Raspberry Pi needs to be
rebooted for the changes to take effect.
10
3. Hypotheses
3.1 If the clock rate is increased, the power usage will increase.
Based on the law of power, if the clock frequency increases, the power usage also increases.
3.2 If the clock rate is decreased, the power usage will decrease.
Based on the law of power, if the clock frequency decreases, the power usage also
decreases.
24
Power
Consumption
CPU Clock Rate
11
4. Technologies Employed in This Experiment
4.1 Hardware
To test the hypothesis on a general PC, a laptop PC is used. To test the hypothesis on the
Raspberry Pi,which is representative of smartphones and mobile devices,a Raspberry Pi
Model B is used.
4.2 Software
For both the Raspberry Pi and the laptop PC, an operating system is used. In order to
manage the power usage and manipulate the clock frequency on the laptop, a power
management application is required.
12
5. Materials/Software
5.1 Toshiba Portege LaptopM780
The PC used in this experimenthas the specifications as follows: 8GB
RAM, 512 GB SSD, Intel Core i7 620M CPU at 2.67 GHz. This laptop is
representative of present-day PC laptops.
5.2 Raspberry Pi Model B
The Raspberry Pi has the specifications as follows: 512 MB RAM, 8
GB SD card, ARM1176JZF-S (ARMv6k) CPU at 700 MHz. The
Raspberry Pi, since the CPU is identical to those found on
smartphones and mobile devices, represents how
over/underclocking affects the power consumption in mobile devices.
5.3 Fluke 175 True-rms Multimeter
The Fluke 175 True-rms Multimeter is used to measure the current and
voltage drawn by the Raspberry Pi. True-rms means that the multimeter
can measure non-sinusoidal waveforms. From those measurements, the
power consumption of the Raspberry Pi can be calculated.
5.4 Kill-A-Watt Power meter P4400
This power meter is used to measure the laptop’s power usage. Since there
is no access to the power supply for the laptop, this device, which plugs into
the wall outlet and into which the laptop can be plugged in, is used. Its
display gives information on the power usage of the device plugged into it.
5.5 Occidentalis operating system
The Raspberry Pi requires an operating system in order to function. The operating system
used in this experiment is called Occidentalis, which is a derivative of Linux.
5.6 PiInstaller
PiInstalleris a program that will write to an SD card and do all the necessary opening and
closing of files. It is used to write the Occidentalis operating system to the SD card.
5.7 8GB MicroSD card& adapter
The Raspberry Pi’s method of long-term storage is
an SD card. In this experiment an 8 Gigabyte
micro SD card is used. In order that the micro SD
card fits in the normal SD card slot that the
Raspberry Pi has, a micro SD card adapter is used.
13
5.8 MicroSD Card writer
To write to a micro SD card requires a special micro SD card writer. It plugs into a USB port
and has a plug for the micro SD card.
5.9 Standard USB to mini USB cable
The Raspberry Pi’s power cable goes through mini USB. At one end, where it is plugged in to
the power supply, the cable is standard USB. At the other end, where it plugs into the
Raspberry Pi, the cable is mini USB.
5.10 5V, 1A power supply
The Raspberry Pi requires a steady power supply at 5 Volts, 1 Ampere in order to function
correctly. This power supply plugs into the wall outlet and has a standard USB plug.
5.11 Microsoft Natural Ergonomic Keyboard 4000 v.1.
The Raspberry Pi has no other devices attached to it; it is a single board microcomputer.
Therefore, it is necessary to connect input devicessuch as this keyboard. This keyboard is
selected because it is representative of the commonly used keyboard.
5.12 Mouse M-UVDEL1
As mentioned above, the Raspberry Pi has no other input devices attached to it, so it is
necessary to provide a mouse.
5.13 HDMI to VGA adapter
Since the Raspberry Pi has only an HDMI port to connect a display to and the display used in
this experiment has only a VGA connection, this adapter from HDMI to VGA is used.
5.14 Dell 2001FP Monitor
This is the monitor connected to the Raspberry Pi during this experiment.
14
6. Experiment Workflow: Laptop PC Measurements
6.1 Boot the laptop
First, set up the laptop so that the battery does not affect the power consumption and set
up the Kill-A-Wattpower meter.
1. Take the battery out of the laptop so that the
battery does not affect the power
consumption.
2. Plug the laptop power cord into the Kill-A-
Watt power meter, and plug the power meter
into a wall outlet.
3. Turn on the laptop.
6.2 Install CPU-Z
CPU-Z is the CPU clock rate monitoring software used in this experiment. It is free and gives
information about the CPU running in the computer.
1. Download CPU-Z, a CPU monitoring software, from
http://www.cpuid.com/downloads/cpu-z/1.67-setup-en.exe
2. Go through the setup wizard.
3. Open up the CPU-Z application.
4. Note down the current CPU clock frequency: it’s under Clocks: Core Speed.
6.3 Set the clock rate
Set the clock rate of the laptop through the control panel application. Even though the
exact clock rate cannot be changed, the user can change two percentages, minimum and
maximum state of the CPU. The minimum state means that at lowest, the CPU should be
underclocked to that percentage of the highest CPU clock rate attainable. The maximum
state means that at 100% load, the CPU should not reach above that percentage of the
highest CPU clock rate attainable. However, the lowest or highest values may not change
the clock below or above the minimum or maximum safe value.
26
Kill-A-Watt Power
Meter
15
1. On the PC laptop, open up “Control Panel”, then “Hardware and Sound”, and “Power
Options”.
2. Select the “High Performance” power option.
3. Click on “Change Plan Settings”.
16
4. Click on “Change Advanced Plan Settings”.
5. Open “Processor Power Management”.
6. Change the ‘Minimum Clock’ to 5%, and ‘Maximum Clock’ to 5%.
6.4 Measure the power
Measure the power consumed by the laptop 5 times.
17
1. Set the Kill-A-Wattto measure Wattage.
2. Record the actual clock rate of the CPU using the CPU-Z application.
3. Measure and record the power consumption of the laptop 5 times.
4. Find the average of those measurements.
6.5 Write a program tomake the CPU go to100% load.
This program contains a simple loop that runs in circles and therefore increases the CPU
load to 100%. Although the program is different from that run on the Raspberry Pi, the
result is the same as the CPU load goes to 100%.
1. Open up a text editor, such as Sublime Text 2.
2. Write a simple program that has a loop. My program is below. At the begin
statement, it means to begin a loop. In the second line, goto :begin means to go
back to the begin section of the loop. Save it in a file as loops.bat.
begin
goto :begin
6.6 Saturate the CPU to 100%.
Run the loop program 5 times to completelysaturate the CPU. Since the CPU in the laptop
has 4 cores, 5 instances of the program were run to completely saturate the CPU to 100%.
With lessthan 5 instances, the CPU did not go fullyto 100%.
1. Open 5 Command Prompt windows.
2. In each of them, type loops.bat and press [enter].
6.7 Measure the power
Measure the power usage of the laptop when the CPU usage is 100%.
1. Using the Kill-A-Watt power meter set to Watts, measure and record the power
consumption 5 times.
2. Find the average of those measures.
6.8 Repeat
Repeat the steps to change the clock settings and measure the power consumption.
1. Repeat steps 7.2 – 7.6
2. Use clock settings as 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, and 100% of
the full CPU for both minimum and maximum CPU states.
6.9 Plot the data collectedongraphs.
6.10 Compare the data trends betweenthe Raspberry Pi andthe laptop
PC.
7. Experiment Workflow: Raspberry Pi Measurements
These are the steps I followedto gather data on Raspberry Pi power usage.
18
7.1 Write Occidentalis operating systemontoa SD card
First, we need to write the Raspberry Pi’s operating system onto an SD card, which the
Raspberry Pi uses as its boot disk and storage. To write the operating system onto the SD
card from a normal computer, it is necessary to use a micro SD card writer.
19
3. Download Pi Installer onto your computer from:
https://github.com/RayViljoen/Raspberry-PI-SD-Installer-OS-X (for
Mac only). This program makes writing the Raspberry Pi operating system to the SD
card easy.
4. Unzip the program when it finishesdownloading.
5. Download the Occidentalis (version02) operating system image from
http://adafruit-raspberry-pi.s3.amazonaws.com/Occidentalisv02.zip
6. Unzip that file as well.
7. In the directory where the Pi Installer is downloaded, paste the Occidentalis image.
8. Insert the micro SD card into the writer, and insert it into a USB port on your
computer.
9. Open up the terminal application. Navigate to the folder where the installer and the
image are in, using cd to change the directory. For example,if the path to the folder
with the installer and image is:
/PiBackup/Raspberry-Pi-SD-Installer-OS-X-master
then to change the directory one would type:
cd /PiBackup/Raspberry-Pi-SD-Installer-OS-X-master
You will now be in the directory
Raspberry-Pi-SD-Installer-PS-X-master/
20
10. Once you are in the directory where the operating system image and the Pi installer
are, type in sudo ./install Occidentalis_v02.img and then hit enter.
11. Terminal may or may not prompt you for your computer’s password. If so, simply
type it in and hit enter.
12. Pi Installer will then run, and ask you on what disk to install the operating system.
13. Select the disk on which to install Occidentalis. Make sure that you have got the right
disk number; Pi Installer will not check, and will truncate all the data already existing
on the disk you select.
21
14. Double check that you have got the right disk. In our case it is /dev/disk1s1, but
yours might be different. Press Enter, and Pi Installer will do the rest.
This operation may take a few minutes.
When Pi Installer is finishedwriting, it will close up by ejecting the disk.
22
15. Pull out the SD card from the writer. It is not necessary to eject it because Pi Installer
does so when it is done.
16. Insert the micro SD card into its adapter, and slide the whole thing into the SD card
slot on the Raspberry Pi.
17. Plug the keyboard and mouse into the USB ports of the Raspberry Pi.
18. Plug the monitor into the VGA side of the VGA to HDMI adapter, and plug the other
end of the adapter into the HDMI port on the Raspberry Pi.
19. Plug in the 5V, 1A power unit, and plug the standard end of the USB cable into the
power supply and the mini USB end into the Raspberry Pi’s mini USB port. A red and
green light will then light up, and the Raspberry Pi will boot.
20. Go through the first time configuration after the Raspberry Pi starts. Use the arrow
keys to select the items you want. I used: Boot straight to desktop: TRUE; Enable SSH
on bootup: TRUE; Keyboard: Generic, 101 key U.S. When done, exit the
configuration.
21. Shut down the Raspberry Pi by typing sudo shutdown –h now. When the green
status light on the Raspberry Pi flashes 4 times and then goes off, unplug the
Raspberry Pi.
23
7.2 Splice the USB cable
In order to access the power wires in the USB cable to measure the voltage and current
consumed by the Raspberry Pi, it is necessary to cut the USB cable.
1. Carefully strip away the
outer insulation on a
section of the USB wire
using a hobby knife.
Take care not to cut
the delicate data wires
inside. Remove the
shieldingmesh and
metal so you can see
the red, black, green,
and blue wires inside.
2. Using wire snips cut
the red and black leads
and strip 5 mm off the
insulation on each cut
end of them.
3. Attach jumper wires to
each end
correspondingly so that the black jumper wires connect to the black leads, and the
red jumper wires connect the red leads. This color-coding makes it easier to
distinguish the positive and negative leads.
7.3 Connect the multimeter
In order to measure voltage, it is important to connect the multimeter correctly.
1. Connect one of the red jumper wires to the red terminal of the multimeter. With
another red jumper wire, connect the red terminal of the multimeter back to the red
jumper wire connected on the USB cable.
2. Connect one of the black jumper wires to the red terminal of the multimeter. With
another black jumper wire, connect the black terminal of the multimeter back to the
25
Fluke Multimeter
+ -
V
24
black jumper wire connected on the USB cable. The circuit schematic should look
like the one above, where the voltage meter is connected in parallel to one the load.
7.4 Boot the Raspberry Pi at 700 MHz clock rate
Boot the Raspberry to measure power draw when its CPU is at idle usage.
1. Connect the standard USB side of the spliced cable to the 5V, 1A DC power supply,
and the mini USB end of it to the Raspberry Pi. Do not plug the power supply in yet.
2. Turn on the Fluke 175 True-rms multimeter and set it to volts, DC (autoranging).
3. Plug in the Raspberry Pi power supply and measure the amount of time the
Raspberry Pi takes to boot. When it finishesbooting, it should show a screen with
some desktop icons.
7.5 Measure the voltage
Measure the voltage used by the Raspberry Pi when the CPU is at idle.
1. The CPU clock frequency is at 700 MHz currently, which is the default. When the
Raspberry Pi has finishedbooting and the CPU is at idle,measure and record the
voltage drawn 5 times in order to make sure the tests are accurate.
2. Find the average of these measurements.
7.6 Run a program witha loop toincrease the CPUload to100%
In order to test the CPU power consumption when the CPU is at 100% utilization,we will
write and run a loop to increase the CPU load to 100%. This simulates a situation where the
user isrunning applications that require a high CPU clock rate.
1. Open up LXTerminal by double clicking on the desktop icon.
2. Type in nano loops.py
3. Type in a python program with a loop to increase the CPU load to 100%. The
program that I used is below.
while True:
newNum = 123456789 * 987654321
This program runs in a loop forever, and calculates a variable, newNum, which is
123456789 * 987654321. Since the condition for the loop is true, the condition
will never be false, and the loop will never terminate unless the user terminates
the program.
4. To save the program and exit,type [ctrl] x, y, then [enter]
5. To run the program, type python loops.py
7.7 Measure the voltage
Measure the voltage consumed by the Raspberry Pi when the CPU is at 100% utilization.
25
1. Measure and record the voltage 5 times.
2. Find the average of those measurements.
3. Stop loops.py by typing [ctrl] c
7.8 Shut down the Raspberry Pi
In order to change the multimeter contacts to measure current, the Raspberry Pi must be
shut down first. Since reconnecting the multimeter in another circuit will temporarily cut
off the power, it is crucial to power off the Raspberry Pi first.
1. Shut down the Raspberry Pi by typing in terminal: sudo shutdown –h now
7.9 Change the multimeter contacts
In order to measure current, the multimeter must be set up in series with one of the power
wires.
1. Change the contacts for the
multimeter so that one red jumper
wire from the USB wire connects to
the red contact on the multimeter.
2. Connect the other red jumper wire
from the USB wire to the black
contact on the multimeter.
3. This connection is made to measure
current, since to do so the multimeter
needs to be connected in series with
one of the power wires. The finished
schematic should look like the one above.
7.10 Boot the Raspberry Pi at the same clock rate
Boot the Raspberry Pi at the same clock rate that was used to measure idle CPU voltage and
100% CPU utilization voltage.
1. Set the multimeter to measure amperes.
2. Plug in the Raspberry Pi to the power supply to boot it at the same clock rate.
7.11 Measure the current
Measure the current consumed by the Raspberry Pi.
1. Measure and record the current 5 times.
2. Find the average of those measurements.
7.12 Increase the CPU load to100%
To measure the current consumed when the CPU utilizationis 100%, we will run the
program with a loop to increase the CPU load.
+ -
A
26
1. Open up LXTerminal by double-clicking on the desktop icon.
2. Type loops.py to increase the CPU load to 100%.
7.13 Measure the current
Measure the current consumed by the Raspberry Pi when the CPU utilizationis 100%.
1. Measure and record the current 5 times.
2. Find the average of those measures.
3. Type in terminal [ctrl] c to stop loops.py
7.14 Shut down the Raspberry Pi
Change the clock frequency to the next frequency to be tested before shutting down the
Raspberry Pi and rewiring the multimeter circuit to measure voltage.
1. Before shutting down the Raspberry Pi, change the clock frequency to the next
frequency to be tested – see the next step.
2. Type in terminal cd ../../boot/
3. Type in terminal sudo nano config.txt
4. Find the line where it says #arm-freq=800
5. Delete the hash mark in front of the line, and change the number to the clock
frequency (in MHz) you want to set the CPU to. The default clock frequency is
700 MHz.
7.15 Repeat measurementswithdifferent clock frequencies
1. Repeat steps 6.4 – 6.14. At 6.14, use clock frequencies at 600 MHz, 800 MHz, and
900 MHz.
7.16 Plot the data collectedongraphs
8. Problems Encountered & Solutions
8.1 Too lowclock settings for Raspberry Pi resultedinnon-working
computer
8.1.1 Raspberry Pi does not boot at 500 MHz
To test the lowest underclockable
frequency, the clock rate was set to 500
MHz. When plugged in, the Raspberry
Pi began to boot, but then stopped
midway, the screen went all black, and
the boot process began all over. At a
low clock frequency, the capacitors in
the chip lose most of their charge
before that charge can be used for
other parts of the chip. When the clock
frequency is decreased, the amount of
time between the capacitor discharge
27
and when the charge is actually obtained by another component is greater. Therefore,
sometimes, by slight chance of a few nanoseconds, a part does not get the neededpower
that it should get from the discharging capacitor. Thus, the chip and boot process crashes,
and it starts right over again with the boot process. As this graph shows, as the time
increases, the charge from the capacitor discharge decreases rapidly, and less and less
voltage is received. Without enough voltage, the parts that require this nominal voltage
cannot properly function, and the chip crashes.
8.1.2 SD memory card corrupted
Since the Pi did not fullyboot, there was no way to change the boot setting to a more
reasonable CPU clock frequency, so it was necessary to re-install the operating system
image on the SD card. I followedthe exact same process as described in step 6.1 of the
procedure.
8.2 Pi cannot boot while using milliamperes setting onmultimeter
To measure current draw of the Raspberry Pi,I set the multimeter to measure milliamperes.
However, when the Raspberry Pi was connected, the Pi did not even start to boot at all.
Therefore, I tried to use the amperes setting on the multimeter,and the Raspberry Pi
booted.
8.2.1 Multimeter drew too much current at milliamperes
The reason why the Raspberry Pi could not boot when the multimeter was set to
milliampereswas because the multimeter drew too much current. Therefore, the
Raspberry Pi did not get enough current through the power cable in order to start booting.
Although it is not certain exactly why the multimeter draws more current at the
milliamperessetting than at the amperes setting, it is related to the internal circuitry of the
multimeter. This is why on the multimeter there are several settings for a user to choose
from to measure the same thing.
9. Results and Measurements
9.1 Laptop PC
9.1.1 Raw Data Tables
The followingtables are the raw data obtained by sampling the Kill-A-Watt power meter at
differentclock frequencies. At the top right hand corner of the tables is a percentage that
corresponds to what percentage of the full clock rate the CPU was set at those
measurements. The column of numbers underneath is the five trials (denotedT1, T2, etc.),
and the average of those measurements (denotedAverage). These that follow are simply
the data I collected; analysis of this data is in section 10.1. All units are in watts.
28
9.1.2 Graphs and Charts
We will analyze the graphs that follow in section 10.1. All units are in watts.
9.1.3 Comparison
This followingchart shows how idle CPU power consumption is related to percentages of
full CPU clock usage.
27
29
This chart below shows how idle CPU power consumption is related to actual clock
frequencies.
The chart below shows how 100% CPU utilizationpower consumption is related to
percentages of full clock speedused.
The followingchart shows the same data as the above chart, except showing actual clock
frequencies.
This followingchart shows how the idle CPU power consumption compares to 100% CPU
load power consumption in percentages of CPU clock.
30
This followingchart shows how the idle CPU power consumption compares to 100% CPU
load power consumption in actual clock frequencies.
9.2 Raspberry Pi
9.2.1 Raw Data
The followingtable shows the results I got from measuring the Raspberry Pi at different
clock rates. There are no values for 500 MHz since the boot failedbecause of the low clock
rate. At the very last row, I have measured the boot time as a measure of system
performance at that clock rate. Voltage is in Volts, and current is measured in amperes.
31
9.2.2 Graphs
We will analyze the graphs that follow in section 10.2. Voltage is in volts, current is in
amperes, and power is in watts.
28
32
The followinggraph shows how, at idle CPU, voltage drawn by the Raspberry Pi isrelated to
clock rate.
The next graph shows how, at idle CPU, current usage is related to clock frequency.
33
This followinggraph shows how, at 100% CPU usage, voltage drawn by the Raspberry Pi is
related to clock frequency.
This graph below shows how, at 100% CPU usage, current drawn by the Raspberry Pi is
related to clock frequency.
34
Following isthe chart for the power consumption of the Raspberry Pi when the CPU is at
idle.
Below is the chart for power consumption of the Raspberry Pi when the CPU is at 100%
utilization.
35
This followingchart shows both the High CPU Voltage and Low CPU Voltage – voltage drawn
by the Raspberry Pi when the CPU is at 100% and idle.
This chart below shows both the High CPU Current and Low CPU Current – current drawn by
the Raspberry Pi when the CPU is at 100% and idle.
36
Here is the chart that combines High CPU Power and Low CPU Power, power consumption
by the Raspberry Pi when the CPU is at 100% utilizationand idle.
As a measure of system performance, the graph for boot time follows.
10. Analysis
10.1 Laptop PC
10.1.1 Hypothesis holds true
The data collected from the laptop PC supports my hypothesis. As the clock rate increases,
the power consumption also increases. When the clock rate decreases, power consumption
37
decreases. The units are in watts.
Each clock cycle takes a certain amount of power to perform, and when the number of clock
cycles decreases by underclocking, the power consumption also decreases.
10.1.2 Underclocking at idle
Since modern CPUs can turn off certain sections that are not in use when the CPU is at idle,
the power usage is little affected by underclocking at idle CPU. The units are in watts.
Even though it looks like a big difference on the graph, the increase is not actually very
large; only the large increments make it seem significant. However, the main trend is that
with an increased clock at idle CPU, only little power usage is increased. Another graph
follows,but it has the actual clock frequenciesin Gigahertz listedand the power
consumption. The units are in watts.
38
Notice how at the beginning of the X-axis, which is the CPU clock rate, all of them say 1.20,
even though, as seen in the first chart, the frequency percentage is at 5%, then 10%, and so
on until 50%. At 50%, the clock frequency becomes 1.33 GHz, and increases from there on.
This means that the system cannot go below 1.20 GHz, so it puts it for 5%-40%, even though
the percentage CPU should be lower.
10.1.3 Underclocking at 100% CPU utilization
At 100% CPU utilization,at every cycle the CPU is busy doing an operation, which uses more
power than simplyidling. When the CPU is underclocked and the CPU usage stays 100%,
the power saving has a significant reduction. Units are in watts.
The next graph shows the same data, but with the actual CPU clock as well. Units are in
watts.
39
The general trend of the data is that as the clock rate is increased, the power consumption
also increases. Note the fast growth on the chart after 1.16 GHz.
10.1.4 Comparison
The graph that follows shows both trends for 100% CPU utilization(High CPU) and idle CPU.
Units are in watts.
The graph below shows the same data, except with the actual CPU clock rate.
40
Notice how the first 5 clock frequenciesall say 1.20, even though the percentage CPU set
was different:5%, 10%, etc. The reason for that is because below 50% CPU, the CPU will not
be able to function with a lower clock frequency than 1.20. If the CPU went below that
frequency, the chip would crash, and the computer would become inoperable. Therefore,
the operating system does not letthe CPU go below the minimum frequency threshold.
The main trend in data is that as the clock rate increases, power consumption also
increases. Underclocking at 100% CPU load is more effective than underclocking at idle CPU
because at 100% load the CPU is actively using power for each cycle, and reducing the
number of cycles effectivelyreduces the amount of power the CPU draws. With
underclocking at 100% CPU load, over 15 watts of electricity were saved, with the full clock
using over 45 watts, and the underclocked CPU using only 30. However, with underclocking
at CPU idle,only 2-3 watts of electricity were saved, with the full clock using 26 watts, and
the underclocked CPU used 23 watts.
10.2 Raspberry Pi
10.2.1 Hypothesis not supported
The data graphs collected from the Raspberry Pi measurements were singularly peculiar.
The power, voltage, and current measurements seemedto jump all over the place, as seen
in these diagrams. Voltage is in volts, current is in amperes, and power is in watts.
41
42
43
10.2.2 Built-in energy management unit
Further research was conducted after observing these singular diagrams, including
consulting technical documentations about the chip. It was found that the Arm
ARM1176JZF-S CPU, which is used in the Raspberry Pi, has an internal energy management
unit built into the chip. Since this exact CPU is used frequently in mobile devices and
phones, it includes an automatic energy management unit that would measure numerous
chip factors, such as temperature, clock rate, load, etc., and regulate the voltage and
current going to the CPU to optimize performance and reduce energy usage. Particularly,
the energy management is critical for mobile devices such as phones since they would
quickly run out of power without this unit. By manipulating input voltage and current going
to the CPU, the energy management unit is able to control the energy usage of the chip as
our measurements show. Surprisingly, the lowest power use is at the standard clock
frequency, showing that this is an optimal setting for this CPU.
10.2.3 Overrides other CPU settings
Even though the user can set up specific options and settings for the CPU, this energy
management unit can automatically override many of those settings, among them voltage
and current. The energy management unit is preprogrammed to optimize chip
performance, reduce energy consumption, and reduce excess heat production by the CPU.
10.2.4 Buck Regulator
The crucial part of the energy management unit, the Broadcom BCM2835, is the Buck
Regulator. The schematic below shows how a Buck Regulator works. At the supply (circle),
an input voltage is passed. When the switch is closed, the electricitygoes through the
inductivity (coily thing),being the only way for it to travel. When an inductivity sees an
increase in voltage, it builds up an electromagnetic field,thereby smoothening out the
increase in input voltage and slowing down the change of voltage in time. When voltage is
passed in from the source, the inductivity slows down the increase in voltage by building an
44
electromagnetic field. The voltage then goes through, in parallel, a capacitor (two parallel
lines) and the load (rectangle). In our case, the load is the CPU because it causes resistance
and uses power. The
load gets power, but at a
reduced power than at
the source because of
the slowdown of
increase of voltage over
time by the inductivity.
At the second state,
when the switch is
closed, the capacitor
wants to release all its
electrons. However, the
inductivity, being
reluctant to change its
state, smoothens out
that sudden burst of
electricity from the
capacitor to make it useable to the load. The diode (triangle with a line on top) forces the
electricity to go only that way, and does not let the electricity flow back. Therefore, when
the switch opens, the inductor’s momentum (whenit converts the electromagnetic field
back into electricity) does not burn out the switch. The load now gets power, at a reduced
voltage, without any loss of power throughout the circuit! Then, when the switch closes
again at state 1, the voltage slowly increases, the capacitor charges, and the load gets
electricity at a reduced voltage than the source.
Through regulating the switching by controlling the amount of time in each state, a different
power can be given to the device,without any loss through heat! This is differentthan a
normal regulator, as in a regulator the excess power is converted into heat, and in the Buck
Regulator no electricity is lost due to heat or other losses.
11. Summary
11.1 On the PC
Power usage on the PC significantlydecreases by reducing the clock rate. This is because
each clock cycle requires energy to perform. By reducing the clock rate, we reduce the
number of clock cycles per second; hence, power usage decreases.
State 1: switch closed
State 2: switch open
45
11.2 On the Raspberry Pi
On the Raspberry Pi,power consumption decreased by reducing the clock rate and first
increased by increasing the clock rate at 800 MHz, and then decreased significantlyby
increasing the clock rate to 900 MHz. This erratic power usage is due to aggressive power
management on the CPU by the built-inhardware power management system. As the
power management system noticed the CPU was going at a higher clock rate, it decreased
the power given to the CPU.
46
12. Acknowledgements
I would like to thank my mom for her continued support of my project, and my dad for his
practical advice and suggestions.
13. References
Safari Books Online. Hacking Raspberry Pi. Retrieved from
techbus.safaribooksonline.com/print?xmlid=9780133476637%2Fch18lev1sec3 on 2/1/14.
Windows. Power Policy Configuration and Deployment in Windows. October 21, 2010.
Safari Books Online. Practical Electronics for Inventors. Retrieved from
techbus.safaribooksonline.com/print?xmlid=9780071771337%2Fch2_13_html on 2/1/14.
Windows. Processor Power Management in Windows 7 and Windows Server 2008 R2.
October 19, 2012.
Wikipedia. Raspberry Pi. Retrieved from http://en.wikipedia.org/wiki/Raspberry_Pi on
2/1/14.
Safari Books Online.Raspberry Pi User Guide. Retrieved from
techbus.safaribooksonline.com/print?xmlid=9781118464496%2Fa2_10_9781118464496_ch
06_html on 2/1/14.
Windows. Using PowerCfg to Evaluate System Energy Efficiency.March 26, 2010.

More Related Content

What's hot

Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating SystemsRohit Joshi
 
Syste O CHip Concepts for Students.ppt
Syste O CHip Concepts for Students.pptSyste O CHip Concepts for Students.ppt
Syste O CHip Concepts for Students.pptmonzhalabs
 
What is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And ArchitectureWhat is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And Architecturepec2013
 
10 gigabit ethernet technology
10 gigabit ethernet technology10 gigabit ethernet technology
10 gigabit ethernet technologySajan Sahu
 
Hard disk drive
Hard disk driveHard disk drive
Hard disk driveAwais Alam
 
System On Chip
System On ChipSystem On Chip
System On Chipanishgoel
 
System-on-Chip Design, Embedded System Design Challenges
System-on-Chip Design, Embedded System Design ChallengesSystem-on-Chip Design, Embedded System Design Challenges
System-on-Chip Design, Embedded System Design Challengespboulet
 
RAM :A primary Memory
RAM :A primary MemoryRAM :A primary Memory
RAM :A primary MemoryDev Dorse
 
Project Report on Embedded Systems
Project Report on Embedded Systems Project Report on Embedded Systems
Project Report on Embedded Systems Suhani Singh
 
SOC - system on a chip
SOC - system on a chipSOC - system on a chip
SOC - system on a chipParth Kavi
 
Hyper threading technology
Hyper threading technologyHyper threading technology
Hyper threading technologydeepakmarndi
 
Embedded system in Smart Cards
Embedded system in Smart CardsEmbedded system in Smart Cards
Embedded system in Smart CardsRebecca D'souza
 
Ec8791 unit 5 processes and operating systems
Ec8791 unit 5 processes and operating systemsEc8791 unit 5 processes and operating systems
Ec8791 unit 5 processes and operating systemsRajalakshmiSermadurai
 
SOC System Design Approach
SOC System Design ApproachSOC System Design Approach
SOC System Design ApproachA B Shinde
 

What's hot (20)

Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Syste O CHip Concepts for Students.ppt
Syste O CHip Concepts for Students.pptSyste O CHip Concepts for Students.ppt
Syste O CHip Concepts for Students.ppt
 
What is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And ArchitectureWhat is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And Architecture
 
10 gigabit ethernet technology
10 gigabit ethernet technology10 gigabit ethernet technology
10 gigabit ethernet technology
 
Hard disk drive
Hard disk driveHard disk drive
Hard disk drive
 
System On Chip
System On ChipSystem On Chip
System On Chip
 
Vx works RTOS
Vx works RTOSVx works RTOS
Vx works RTOS
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
System-on-Chip Design, Embedded System Design Challenges
System-on-Chip Design, Embedded System Design ChallengesSystem-on-Chip Design, Embedded System Design Challenges
System-on-Chip Design, Embedded System Design Challenges
 
Bicoms
BicomsBicoms
Bicoms
 
RAM :A primary Memory
RAM :A primary MemoryRAM :A primary Memory
RAM :A primary Memory
 
Low power
Low powerLow power
Low power
 
Project Report on Embedded Systems
Project Report on Embedded Systems Project Report on Embedded Systems
Project Report on Embedded Systems
 
Embedded Systems
Embedded SystemsEmbedded Systems
Embedded Systems
 
SOC - system on a chip
SOC - system on a chipSOC - system on a chip
SOC - system on a chip
 
Hyper threading technology
Hyper threading technologyHyper threading technology
Hyper threading technology
 
Plastic memory
Plastic memoryPlastic memory
Plastic memory
 
Embedded system in Smart Cards
Embedded system in Smart CardsEmbedded system in Smart Cards
Embedded system in Smart Cards
 
Ec8791 unit 5 processes and operating systems
Ec8791 unit 5 processes and operating systemsEc8791 unit 5 processes and operating systems
Ec8791 unit 5 processes and operating systems
 
SOC System Design Approach
SOC System Design ApproachSOC System Design Approach
SOC System Design Approach
 

Viewers also liked

Curcite voltage
Curcite voltage  Curcite voltage
Curcite voltage Anis Arafat
 
Signal encoding techniques
Signal encoding techniquesSignal encoding techniques
Signal encoding techniquesSyed Zaid Irshad
 
Heart beat monitor using AT89S52 microcontroller
Heart beat monitor using AT89S52 microcontrollerHeart beat monitor using AT89S52 microcontroller
Heart beat monitor using AT89S52 microcontrollerSushil Mishra
 
Operational Amplifier Part 1
Operational Amplifier Part 1Operational Amplifier Part 1
Operational Amplifier Part 1Mukesh Tekwani
 
Physics Investigatory Project Class 12
Physics Investigatory Project Class 12Physics Investigatory Project Class 12
Physics Investigatory Project Class 12Self-employed
 
Data Encoding
Data EncodingData Encoding
Data EncodingLuka M G
 
Learn how to Manage Aircraft Records
Learn how to Manage Aircraft RecordsLearn how to Manage Aircraft Records
Learn how to Manage Aircraft RecordsJeanette Erazo
 
Raising insulation performance in passive components - Highlight
Raising insulation performance in passive components - HighlightRaising insulation performance in passive components - Highlight
Raising insulation performance in passive components - HighlightHuntsman Advanced Materials Europe
 
DESIGN OF VENT GAS COLLECTION AND DESTRUCTION SYSTEMS
DESIGN OF VENT GAS COLLECTION AND DESTRUCTION SYSTEMS DESIGN OF VENT GAS COLLECTION AND DESTRUCTION SYSTEMS
DESIGN OF VENT GAS COLLECTION AND DESTRUCTION SYSTEMS Gerard B. Hawkins
 
Stealth aircraft technology ppt
Stealth aircraft technology pptStealth aircraft technology ppt
Stealth aircraft technology pptHanim MS
 
M.S. Thesis Presentation
M.S. Thesis PresentationM.S. Thesis Presentation
M.S. Thesis PresentationElkin Mejia
 
Yutong Liu - Final Report - Anodized Aluminium Oxide (AAO)
Yutong Liu - Final Report - Anodized Aluminium Oxide (AAO)Yutong Liu - Final Report - Anodized Aluminium Oxide (AAO)
Yutong Liu - Final Report - Anodized Aluminium Oxide (AAO)Yutong Liu
 
Fuel tank enhancements as a means to decrease risk of fuel tank explosion on ...
Fuel tank enhancements as a means to decrease risk of fuel tank explosion on ...Fuel tank enhancements as a means to decrease risk of fuel tank explosion on ...
Fuel tank enhancements as a means to decrease risk of fuel tank explosion on ...Mersie Amha Melke
 

Viewers also liked (20)

Curcite voltage
Curcite voltage  Curcite voltage
Curcite voltage
 
Current and voltage
Current and voltageCurrent and voltage
Current and voltage
 
Insha Exports Pvt Ltd, Mumbai, Parking Barriers
Insha Exports Pvt Ltd, Mumbai, Parking BarriersInsha Exports Pvt Ltd, Mumbai, Parking Barriers
Insha Exports Pvt Ltd, Mumbai, Parking Barriers
 
Signal encoding techniques
Signal encoding techniquesSignal encoding techniques
Signal encoding techniques
 
Heart beat monitor using AT89S52 microcontroller
Heart beat monitor using AT89S52 microcontrollerHeart beat monitor using AT89S52 microcontroller
Heart beat monitor using AT89S52 microcontroller
 
Operational Amplifier Part 1
Operational Amplifier Part 1Operational Amplifier Part 1
Operational Amplifier Part 1
 
Electric circuits
Electric circuitsElectric circuits
Electric circuits
 
Physics Investigatory Project Class 12
Physics Investigatory Project Class 12Physics Investigatory Project Class 12
Physics Investigatory Project Class 12
 
Data Encoding
Data EncodingData Encoding
Data Encoding
 
Aerospace Propulsion Study For Shenyang Aerospace University by Lale420 (Fina...
Aerospace Propulsion Study For Shenyang Aerospace University by Lale420 (Fina...Aerospace Propulsion Study For Shenyang Aerospace University by Lale420 (Fina...
Aerospace Propulsion Study For Shenyang Aerospace University by Lale420 (Fina...
 
Learn how to Manage Aircraft Records
Learn how to Manage Aircraft RecordsLearn how to Manage Aircraft Records
Learn how to Manage Aircraft Records
 
Mg Alloys in Industry
Mg Alloys in IndustryMg Alloys in Industry
Mg Alloys in Industry
 
CPSC and Its Textile Flammability Regulations
CPSC and Its Textile Flammability RegulationsCPSC and Its Textile Flammability Regulations
CPSC and Its Textile Flammability Regulations
 
Raising insulation performance in passive components - Highlight
Raising insulation performance in passive components - HighlightRaising insulation performance in passive components - Highlight
Raising insulation performance in passive components - Highlight
 
DESIGN OF VENT GAS COLLECTION AND DESTRUCTION SYSTEMS
DESIGN OF VENT GAS COLLECTION AND DESTRUCTION SYSTEMS DESIGN OF VENT GAS COLLECTION AND DESTRUCTION SYSTEMS
DESIGN OF VENT GAS COLLECTION AND DESTRUCTION SYSTEMS
 
Stealth aircraft technology ppt
Stealth aircraft technology pptStealth aircraft technology ppt
Stealth aircraft technology ppt
 
NGI-SIMOPS
NGI-SIMOPSNGI-SIMOPS
NGI-SIMOPS
 
M.S. Thesis Presentation
M.S. Thesis PresentationM.S. Thesis Presentation
M.S. Thesis Presentation
 
Yutong Liu - Final Report - Anodized Aluminium Oxide (AAO)
Yutong Liu - Final Report - Anodized Aluminium Oxide (AAO)Yutong Liu - Final Report - Anodized Aluminium Oxide (AAO)
Yutong Liu - Final Report - Anodized Aluminium Oxide (AAO)
 
Fuel tank enhancements as a means to decrease risk of fuel tank explosion on ...
Fuel tank enhancements as a means to decrease risk of fuel tank explosion on ...Fuel tank enhancements as a means to decrease risk of fuel tank explosion on ...
Fuel tank enhancements as a means to decrease risk of fuel tank explosion on ...
 

Similar to The Effect of CPU Clock Rate on Power Consumption

Billion BiPAC 7300NX Router Manual
Billion BiPAC 7300NX Router ManualBillion BiPAC 7300NX Router Manual
Billion BiPAC 7300NX Router ManualFanus van Straten
 
FYP_enerScope_Final_v4
FYP_enerScope_Final_v4FYP_enerScope_Final_v4
FYP_enerScope_Final_v4Hafiiz Osman
 
Electronics en engineering-basic-vocational-knowledge
Electronics en engineering-basic-vocational-knowledgeElectronics en engineering-basic-vocational-knowledge
Electronics en engineering-basic-vocational-knowledgesandeep patil
 
Digital Control in Power Electronics - Buso & Mattavelli - 2006.pdf
Digital Control in Power Electronics - Buso & Mattavelli - 2006.pdfDigital Control in Power Electronics - Buso & Mattavelli - 2006.pdf
Digital Control in Power Electronics - Buso & Mattavelli - 2006.pdfGollapalli Sreenivasulu
 
Digital Control in Power Electronics.pdf
Digital Control in Power Electronics.pdfDigital Control in Power Electronics.pdf
Digital Control in Power Electronics.pdfGollapalli Sreenivasulu
 
Energy star-v5-implementation-paper
Energy star-v5-implementation-paperEnergy star-v5-implementation-paper
Energy star-v5-implementation-paperCyber Spacio
 
Wireless m-bus-quick-start-guide
Wireless m-bus-quick-start-guideWireless m-bus-quick-start-guide
Wireless m-bus-quick-start-guide봉조 김
 
Advanced Networking Concepts Applied Using Linux on IBM System z
Advanced Networking  Concepts Applied Using  Linux on IBM System zAdvanced Networking  Concepts Applied Using  Linux on IBM System z
Advanced Networking Concepts Applied Using Linux on IBM System zIBM India Smarter Computing
 
ComputerNetworks.pdf
ComputerNetworks.pdfComputerNetworks.pdf
ComputerNetworks.pdfMeetMiyatra
 
Ibm power vc version 1.2.3 introduction and configuration
Ibm power vc version 1.2.3 introduction and configurationIbm power vc version 1.2.3 introduction and configuration
Ibm power vc version 1.2.3 introduction and configurationgagbada
 
IBM Power 710 and 730 Technical Overview and Introduction
IBM Power 710 and 730 Technical Overview and IntroductionIBM Power 710 and 730 Technical Overview and Introduction
IBM Power 710 and 730 Technical Overview and IntroductionIBM India Smarter Computing
 
Cenet-- capability enabled networking: towards least-privileged networking
Cenet-- capability enabled networking: towards least-privileged networkingCenet-- capability enabled networking: towards least-privileged networking
Cenet-- capability enabled networking: towards least-privileged networkingJithu Joseph
 
19100011989 tl wr945-n_v1_user guide
19100011989 tl wr945-n_v1_user guide19100011989 tl wr945-n_v1_user guide
19100011989 tl wr945-n_v1_user guideAnaclet Rafiki
 
Lenze 8400-motec-manual
Lenze 8400-motec-manualLenze 8400-motec-manual
Lenze 8400-motec-manualIgorTerekhov2
 

Similar to The Effect of CPU Clock Rate on Power Consumption (20)

Billion BiPAC 7300NX Router Manual
Billion BiPAC 7300NX Router ManualBillion BiPAC 7300NX Router Manual
Billion BiPAC 7300NX Router Manual
 
FYP_enerScope_Final_v4
FYP_enerScope_Final_v4FYP_enerScope_Final_v4
FYP_enerScope_Final_v4
 
Electronics en engineering-basic-vocational-knowledge
Electronics en engineering-basic-vocational-knowledgeElectronics en engineering-basic-vocational-knowledge
Electronics en engineering-basic-vocational-knowledge
 
final (1)
final (1)final (1)
final (1)
 
Digital Control in Power Electronics - Buso & Mattavelli - 2006.pdf
Digital Control in Power Electronics - Buso & Mattavelli - 2006.pdfDigital Control in Power Electronics - Buso & Mattavelli - 2006.pdf
Digital Control in Power Electronics - Buso & Mattavelli - 2006.pdf
 
Digital Control in Power Electronics.pdf
Digital Control in Power Electronics.pdfDigital Control in Power Electronics.pdf
Digital Control in Power Electronics.pdf
 
Energy star-v5-implementation-paper
Energy star-v5-implementation-paperEnergy star-v5-implementation-paper
Energy star-v5-implementation-paper
 
Wireless m-bus-quick-start-guide
Wireless m-bus-quick-start-guideWireless m-bus-quick-start-guide
Wireless m-bus-quick-start-guide
 
Advanced Networking Concepts Applied Using Linux on IBM System z
Advanced Networking  Concepts Applied Using  Linux on IBM System zAdvanced Networking  Concepts Applied Using  Linux on IBM System z
Advanced Networking Concepts Applied Using Linux on IBM System z
 
Phasor series operating_manual
Phasor series operating_manualPhasor series operating_manual
Phasor series operating_manual
 
ComputerNetworks.pdf
ComputerNetworks.pdfComputerNetworks.pdf
ComputerNetworks.pdf
 
Ibm power vc version 1.2.3 introduction and configuration
Ibm power vc version 1.2.3 introduction and configurationIbm power vc version 1.2.3 introduction and configuration
Ibm power vc version 1.2.3 introduction and configuration
 
Stk 500
Stk 500Stk 500
Stk 500
 
IBM Power 710 and 730 Technical Overview and Introduction
IBM Power 710 and 730 Technical Overview and IntroductionIBM Power 710 and 730 Technical Overview and Introduction
IBM Power 710 and 730 Technical Overview and Introduction
 
Cenet-- capability enabled networking: towards least-privileged networking
Cenet-- capability enabled networking: towards least-privileged networkingCenet-- capability enabled networking: towards least-privileged networking
Cenet-- capability enabled networking: towards least-privileged networking
 
Master_Thesis
Master_ThesisMaster_Thesis
Master_Thesis
 
19100011989 tl wr945-n_v1_user guide
19100011989 tl wr945-n_v1_user guide19100011989 tl wr945-n_v1_user guide
19100011989 tl wr945-n_v1_user guide
 
Openstack InstallGuide.pdf
Openstack InstallGuide.pdfOpenstack InstallGuide.pdf
Openstack InstallGuide.pdf
 
Lenze 8400-motec-manual
Lenze 8400-motec-manualLenze 8400-motec-manual
Lenze 8400-motec-manual
 
Final paper0
Final paper0Final paper0
Final paper0
 

The Effect of CPU Clock Rate on Power Consumption

  • 1. The Effect of CPU Clock Rate on Power Consumption Investigation by Marc Gong Bacvanski 7’th Grade
  • 2. 1 Table of Contents 1. Introduction ..................................................................................................................4 1.1 Importance: saving energy used by computers ..........................................................4 1.2 Factors impacting power usage.................................................................................4 1.3 Our focus: CPU clock frequency.................................................................................5 1.4 Impact of CPU clock frequency on power usage.........................................................5 1.5 Objective of experiment...........................................................................................5 2. Research........................................................................................................................6 2.1 Power.......................................................................................................................6 2.2 Voltage.....................................................................................................................6 2.3 Current.....................................................................................................................6 2.4 Measuring Voltage, Current, and Power....................................................................6 2.5 Clock Rate ................................................................................................................7 2.6 Clock rate’s relationship to power.............................................................................7 2.7 PC Power management............................................................................................8 2.8 Raspberry Pi .............................................................................................................8 3. Hypotheses..................................................................................................................10 3.1 If the clock rate is increased, the power usage will increase.....................................10 3.2 If the clock rate is decreased, the power usage will decrease...................................10 4. Technologies Employed in This Experiment ................................................................11 4.1 Hardware ...............................................................................................................11 4.2 Software.................................................................................................................11 5. Materials/Software .....................................................................................................12 5.1 Toshiba Portege Laptop M780.................................................................................12 5.2 Raspberry Pi ...........................................................................................................12 5.3 Fluke 175 True-rms Multimeter...............................................................................12 5.4 Kill-A-Watt Power meter P4400...............................................................................12 5.5 Occidentalis operating system.................................................................................12 5.6 PiInstaller...............................................................................................................12 5.7 8GB Micro SD card & adapter..................................................................................12 5.8 Micro SD Card writer...............................................................................................13 5.9 Standard USB to mini USB cable..............................................................................13 5.10 5V, 1A power supply.............................................................................................13
  • 3. 2 5.11 Microsoft Natural Ergonomic Keyboard 4000 v.1. ..................................................13 5.12 Mouse M-UVDEL1.................................................................................................13 5.13 HDMI to VGA adapter...........................................................................................13 5.14 Dell 2001FP Monitor.............................................................................................13 6. Experiment Workflow: Laptop PC Measurements.......................................................14 6.1 Boot the laptop ......................................................................................................14 6.2 Install CPU-Z...........................................................................................................14 6.3 Set the clock rate....................................................................................................14 6.4 Measure the power................................................................................................16 6.5 Write a program to make the CPU go to 100% load..................................................17 6.6 Saturate the CPU to 100%. ......................................................................................17 6.7 Measure the power................................................................................................17 6.8 Repeat....................................................................................................................17 6.9 Plot the data collected on graphs. ...........................................................................17 6.10 Compare the data trends between the Raspberry Pi and the laptop PC..................17 7. Experiment Workflow: Raspberry Pi Measurements ..................................................17 7.1 Write Occidentalis operating system onto a SD card ................................................18 7.2 Splice the USB cable................................................................................................23 7.3 Connect the multimeter..........................................................................................23 7.4 Boot the Raspberry Pi at 700 MHz clock rate ...........................................................24 7.5 Measure the voltage...............................................................................................24 7.6 Run a program with a loop to increase the CPU load to 100%...................................24 7.7 Measure the voltage...............................................................................................24 7.8 Shut down the Raspberry Pi....................................................................................25 7.9 Change the multimeter contacts .............................................................................25 7.10 Boot the Raspberry Pi at the same clock rate.........................................................25 7.11 Measure the current.............................................................................................25 7.12 Increase the CPU load to 100% ..............................................................................25 7.13 Measure the current.............................................................................................26 7.14 Shut down the Raspberry Pi..................................................................................26 7.15 Repeat measurements with different clock frequencies.........................................26 7.16 Plot the data collected on graphs ..........................................................................26 8. Problems Encountered & Solutions .............................................................................26
  • 4. 3 8.1 Too low clock settings for Raspberry Pi resultedin non-working computer...............26 8.2 Pi cannot boot while using milliamperes setting on multimeter ...............................27 9. Results and Measurements .........................................................................................27 9.1 Laptop PC...............................................................................................................27 9.2 Raspberry Pi ...........................................................................................................30 10. Analysis .....................................................................................................................36 10.1 Laptop PC.............................................................................................................36 10.2 Raspberry Pi .........................................................................................................40 11. Summary...................................................................................................................44 11.1 On the PC.............................................................................................................44 11.2 On the Raspberry Pi..............................................................................................45 12. Acknowledgements...................................................................................................46 13. References ................................................................................................................46
  • 5. 4 1. Introduction In this project, we investigate how CPU clock rate of a computer impacts the computer’s power consumption. We test this on CPUs from normal laptop computers and those commonly used in mobile devices. Results of this experimentdetermine what frequency is best used for the least power consumption. 1.1 Importance: saving energy used by computers As the number of computers in our world rapidly increases, including both mobile devices and laptop computers, the issue of power consumption of these devices becomes crucial. To add to this, the cost of electricity is also rapidly rising, and the cost to run a computer for a certain amount of time also increases. Fortunately, there are many factors that can be changed in computers in order to save electricity; one of the most important factors is CPU clock frequency. 1.2 Factors impacting power usage 1.2.1 CPU clock frequency Inside every computer, the hardware chip that performs operations of the system is called the CPU (Central Processing Unit). The CPU circuitry performs many cycles per second to perform the operations. CPU clock frequency is how many cycles per second the CPU operates at. Within each cycle, power is used to perform a single calculation or operation. CPU clock rate greatly influencespower consumption. 1.2.2 Memory Memory includes the chips that store temporary information used by the CPU and other parts of the computer. Memory requires power to store information, although this power is minimal. Memory is not a significant factor for power consumption. 1.2.3 Hard drive / storage The hard drive or storage system stores long – term information for the user and operating system. It requires power to read and write data to the disk. 1.2.4 Display The display of a computer is where output from the computer is displayed to the user. Amongst other parts in a computer, the display draws a significant amount of power, especiallyin laptops and mobile devices. 1.2.5 External devices External devicesto a computer include keyboards, speakers, mice, and other accessories. These devices either do not consume much power, or they have an independent power source.
  • 6. 5 1.3 Our focus:CPU clock frequency CPU clock frequency is the focus in this experiment,since it is a major factor in overall power consumption. We will keep all other factors constant, and only change the CPU clock speed. The user, through an interface, can easilyinfluence CPU clock rate. 1.4 Impact of CPU clock frequency onpower usage Power usage is heavily influencedby CPU clock frequency, as shown in this formula. P is Power, C is capacitance of the CPU, V is Voltage, and f is the CPU frequency. If the CPU frequency increases and all the other factors stay constant, according to this law, the power usage should increase proportionally. 1.5 Objective of experiment In this experiment,we examine the exact relationship between clock frequency and power consumption. We use CPUs from personal computers and from mobile devices.
  • 7. 6 2. Research 2.1 Power 2.1.1 Physical laws for power Power is how you measure the work potential of electricity. It is measured in Watts. 2.1.2 Power = Voltage * Current To calculate power, multiply voltage and current together. 2.2 Voltage 2.2.1 Voltage gives free electrons a push to move Voltage is the difference in electric potential betweenpoints. Since differences want to equalize,this force gives free electrons a push to move from point A to point B. To visualize this, imagine a pipe. Voltage would be how quickly the water rushes through the pipe. Source: http://www.creighton.edu/green/energytutorials/electricitybasics/ 2.2.2 Voltage required to have current flow In order to have current flowing betweentwo points, voltage must exist betweenthe two points. 2.3 Current 2.3.1 Total charge per unit of time Current is the amount of electricity that flows in a unit of time. In a pipe analogy, where the speed of the water is voltage, current is how wide the pipe is. 2.3.2 Measured in Ampere Current is measured in Amperes. 2.4 Measuring Voltage, Current, andPower 2.4.1 Voltmeter Voltage is measured by a voltmeter. An ideal voltmeter draws no current and should have infinite resistance. A voltmeter is connected in parallel with the positive and negative wires. 2.4.2 Ampere meter Current is measured by an ampere meter (also called an ammeter). An ideal ampere meter has no resistance. An ampere meter is connected in series on one of the wires so that electricity must flowthrough the ampere meter.
  • 8. 7 2.4.3 Power Power is the amount of electricity used. In the pipe analogy, power is the volume of water flowing. 2.5 Clock Rate 2.5.1 How many cycles the CPU performs per second For a CPU to perform calculations, the circuits in the CPU execute instructions in cycles in the rhythm of the clock rate. In each cycle, one instruction of the CPU is performed. The clock rate determines how fast the instructions are executed. More complex operations may require several clock cycles. 2.5.2 Measured in MHz or GHz CPU clock rate is measured in MHz (Megahertz) or GHz (Gigahertz). One megahertz is 1,000,000 times per second (10^6), and one gigahertz is 1,000,000,000 times per second (10^9). If a certain CPU runs at 850 MHz, it means that it runs 850 * 1,000,000 cycles per second, or 850,000,000 cycles per second. If a certain CPU runs at 2.4 GHz, it means that it runs 2.4 * 1,000,000,000 cycles per second, or 2,400,000,000 cycles per second. 2.5.3 Underclocking Underclocking a CPU is to lower the clock rate of a CPU. Through that, the computer should be slower. Since a single clock cycle takes a certain amount of power and with a lower clock rate the CPU does not perform as many clock cycles per second, the computer in theory uses less power. 2.5.4 Overclocking Overclocking a CPU is to increase the clock rate of a CPU. The main goal of overclocking is to make the computer faster by having more clock cycles per second. With an increased clock rate, the computer runs faster, but also draws more power. 2.5.5 Limits to overclocking and underclocking There are limits to overclocking and underclocking. If a CPU is overclocked too much, it can burn out from the extra heat created. The heat can melt certain parts of the CPU and also can cause pieces to warp, thus destroying contacts on the chip and causing the CPU to fail. While underclocked, a CPU can go below its lowest operating frequency. If it does so, the capacitors in the chip lose their output charge before the other circuits in the chip use that charge to do useful work. Hence CPU is not able to function anymore. 2.6 Clock rate’s relationshiptopower 2.6.1 Power related to frequency Power draw of a CPU should be proportional to CPU clock frequency. This formula (P = CV2 f) calculates the power consumption of a CPU where P is Power, C is the capacitance of the CPU, V is the voltage, and f is the frequency of the CPU. Therefore, if the frequency
  • 9. 8 increases and all other factors stay the same, the CPU will draw more power, as seen in the illustration below. 2.7 PC power management 2.7.1 User can set some CPU settings On a PC, the user can customize power modes, such power saving, full performance, etc. One can set the CPU clock frequency. 2.7.2 Automatically adjusts clock within user set guidelines To adjust the clock rate of the CPU, the user can set a minimum and maximum percentage of the normal CPU clock rate. The CPU will then pick an optimum frequency between the user-set minimum and maximum settings. For example,if the user sets the minimum clock rate to be 50% and maximum to be 75% and the CPU runs at 1 GHz, the minimum clock rate will be 500 MHz (50% of 1 GHz) and maximum will be 750 MHz (75% of 1 GHz), assuming the CPU can attain the lower clock rate of 500 MHz. If the minimum and maximum percentages are set to be the same, the CPU executes at the given frequency. 2.7.3 System will not use unsafe settings for CPU After the user sets the percentage clock rate, the system checks the feasibilityof the user’s settings. If the CPU can run at that frequency, the system uses it. Otherwise, if the user’s setting cannot be attained, the system changes the CPU frequency to a frequency as close as possible to the user’s setting, but a still feasible frequency. This prevents the user from damaging the CPU through excessive overclocking and underclocking, and prevents the system from crashing under extreme underclocking. 2.7.4 Keeping the CPU at a constant rate If the user sets both the minimum and maximum CPU rate to be the same, the CPU stays at that set percentage of its full frequency. 2.8 Raspberry Pi 2.8.1 Small, $35 computer slightly larger than credit card 24 Power Consumption CPU Clock Rate
  • 10. 9 Designed by Broadcom in UK, this tiny microcomputer was intended as an educational device for computer classes. It provides the user many options for hacking and customizing hardware settings. 2.8.2 CPU The CPU on the Raspberry Pi is the same as that used in many smart phones and mobile devices, such as the Apple iPhone 3GS. On the Raspberry Pi,the user can control the CPU clock rate. 2.8.3 Hardware Settings on Pi To change the hardware settings on the Raspberry Pi, such as the CPU clock frequency, the user needsto access the file /boot/config.txt. It contains information for the CPU about how to boot and its clock frequency. Once the file is changed, the Raspberry Pi needs to be rebooted for the changes to take effect.
  • 11. 10 3. Hypotheses 3.1 If the clock rate is increased, the power usage will increase. Based on the law of power, if the clock frequency increases, the power usage also increases. 3.2 If the clock rate is decreased, the power usage will decrease. Based on the law of power, if the clock frequency decreases, the power usage also decreases. 24 Power Consumption CPU Clock Rate
  • 12. 11 4. Technologies Employed in This Experiment 4.1 Hardware To test the hypothesis on a general PC, a laptop PC is used. To test the hypothesis on the Raspberry Pi,which is representative of smartphones and mobile devices,a Raspberry Pi Model B is used. 4.2 Software For both the Raspberry Pi and the laptop PC, an operating system is used. In order to manage the power usage and manipulate the clock frequency on the laptop, a power management application is required.
  • 13. 12 5. Materials/Software 5.1 Toshiba Portege LaptopM780 The PC used in this experimenthas the specifications as follows: 8GB RAM, 512 GB SSD, Intel Core i7 620M CPU at 2.67 GHz. This laptop is representative of present-day PC laptops. 5.2 Raspberry Pi Model B The Raspberry Pi has the specifications as follows: 512 MB RAM, 8 GB SD card, ARM1176JZF-S (ARMv6k) CPU at 700 MHz. The Raspberry Pi, since the CPU is identical to those found on smartphones and mobile devices, represents how over/underclocking affects the power consumption in mobile devices. 5.3 Fluke 175 True-rms Multimeter The Fluke 175 True-rms Multimeter is used to measure the current and voltage drawn by the Raspberry Pi. True-rms means that the multimeter can measure non-sinusoidal waveforms. From those measurements, the power consumption of the Raspberry Pi can be calculated. 5.4 Kill-A-Watt Power meter P4400 This power meter is used to measure the laptop’s power usage. Since there is no access to the power supply for the laptop, this device, which plugs into the wall outlet and into which the laptop can be plugged in, is used. Its display gives information on the power usage of the device plugged into it. 5.5 Occidentalis operating system The Raspberry Pi requires an operating system in order to function. The operating system used in this experiment is called Occidentalis, which is a derivative of Linux. 5.6 PiInstaller PiInstalleris a program that will write to an SD card and do all the necessary opening and closing of files. It is used to write the Occidentalis operating system to the SD card. 5.7 8GB MicroSD card& adapter The Raspberry Pi’s method of long-term storage is an SD card. In this experiment an 8 Gigabyte micro SD card is used. In order that the micro SD card fits in the normal SD card slot that the Raspberry Pi has, a micro SD card adapter is used.
  • 14. 13 5.8 MicroSD Card writer To write to a micro SD card requires a special micro SD card writer. It plugs into a USB port and has a plug for the micro SD card. 5.9 Standard USB to mini USB cable The Raspberry Pi’s power cable goes through mini USB. At one end, where it is plugged in to the power supply, the cable is standard USB. At the other end, where it plugs into the Raspberry Pi, the cable is mini USB. 5.10 5V, 1A power supply The Raspberry Pi requires a steady power supply at 5 Volts, 1 Ampere in order to function correctly. This power supply plugs into the wall outlet and has a standard USB plug. 5.11 Microsoft Natural Ergonomic Keyboard 4000 v.1. The Raspberry Pi has no other devices attached to it; it is a single board microcomputer. Therefore, it is necessary to connect input devicessuch as this keyboard. This keyboard is selected because it is representative of the commonly used keyboard. 5.12 Mouse M-UVDEL1 As mentioned above, the Raspberry Pi has no other input devices attached to it, so it is necessary to provide a mouse. 5.13 HDMI to VGA adapter Since the Raspberry Pi has only an HDMI port to connect a display to and the display used in this experiment has only a VGA connection, this adapter from HDMI to VGA is used. 5.14 Dell 2001FP Monitor This is the monitor connected to the Raspberry Pi during this experiment.
  • 15. 14 6. Experiment Workflow: Laptop PC Measurements 6.1 Boot the laptop First, set up the laptop so that the battery does not affect the power consumption and set up the Kill-A-Wattpower meter. 1. Take the battery out of the laptop so that the battery does not affect the power consumption. 2. Plug the laptop power cord into the Kill-A- Watt power meter, and plug the power meter into a wall outlet. 3. Turn on the laptop. 6.2 Install CPU-Z CPU-Z is the CPU clock rate monitoring software used in this experiment. It is free and gives information about the CPU running in the computer. 1. Download CPU-Z, a CPU monitoring software, from http://www.cpuid.com/downloads/cpu-z/1.67-setup-en.exe 2. Go through the setup wizard. 3. Open up the CPU-Z application. 4. Note down the current CPU clock frequency: it’s under Clocks: Core Speed. 6.3 Set the clock rate Set the clock rate of the laptop through the control panel application. Even though the exact clock rate cannot be changed, the user can change two percentages, minimum and maximum state of the CPU. The minimum state means that at lowest, the CPU should be underclocked to that percentage of the highest CPU clock rate attainable. The maximum state means that at 100% load, the CPU should not reach above that percentage of the highest CPU clock rate attainable. However, the lowest or highest values may not change the clock below or above the minimum or maximum safe value. 26 Kill-A-Watt Power Meter
  • 16. 15 1. On the PC laptop, open up “Control Panel”, then “Hardware and Sound”, and “Power Options”. 2. Select the “High Performance” power option. 3. Click on “Change Plan Settings”.
  • 17. 16 4. Click on “Change Advanced Plan Settings”. 5. Open “Processor Power Management”. 6. Change the ‘Minimum Clock’ to 5%, and ‘Maximum Clock’ to 5%. 6.4 Measure the power Measure the power consumed by the laptop 5 times.
  • 18. 17 1. Set the Kill-A-Wattto measure Wattage. 2. Record the actual clock rate of the CPU using the CPU-Z application. 3. Measure and record the power consumption of the laptop 5 times. 4. Find the average of those measurements. 6.5 Write a program tomake the CPU go to100% load. This program contains a simple loop that runs in circles and therefore increases the CPU load to 100%. Although the program is different from that run on the Raspberry Pi, the result is the same as the CPU load goes to 100%. 1. Open up a text editor, such as Sublime Text 2. 2. Write a simple program that has a loop. My program is below. At the begin statement, it means to begin a loop. In the second line, goto :begin means to go back to the begin section of the loop. Save it in a file as loops.bat. begin goto :begin 6.6 Saturate the CPU to 100%. Run the loop program 5 times to completelysaturate the CPU. Since the CPU in the laptop has 4 cores, 5 instances of the program were run to completely saturate the CPU to 100%. With lessthan 5 instances, the CPU did not go fullyto 100%. 1. Open 5 Command Prompt windows. 2. In each of them, type loops.bat and press [enter]. 6.7 Measure the power Measure the power usage of the laptop when the CPU usage is 100%. 1. Using the Kill-A-Watt power meter set to Watts, measure and record the power consumption 5 times. 2. Find the average of those measures. 6.8 Repeat Repeat the steps to change the clock settings and measure the power consumption. 1. Repeat steps 7.2 – 7.6 2. Use clock settings as 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, and 100% of the full CPU for both minimum and maximum CPU states. 6.9 Plot the data collectedongraphs. 6.10 Compare the data trends betweenthe Raspberry Pi andthe laptop PC. 7. Experiment Workflow: Raspberry Pi Measurements These are the steps I followedto gather data on Raspberry Pi power usage.
  • 19. 18 7.1 Write Occidentalis operating systemontoa SD card First, we need to write the Raspberry Pi’s operating system onto an SD card, which the Raspberry Pi uses as its boot disk and storage. To write the operating system onto the SD card from a normal computer, it is necessary to use a micro SD card writer.
  • 20. 19 3. Download Pi Installer onto your computer from: https://github.com/RayViljoen/Raspberry-PI-SD-Installer-OS-X (for Mac only). This program makes writing the Raspberry Pi operating system to the SD card easy. 4. Unzip the program when it finishesdownloading. 5. Download the Occidentalis (version02) operating system image from http://adafruit-raspberry-pi.s3.amazonaws.com/Occidentalisv02.zip 6. Unzip that file as well. 7. In the directory where the Pi Installer is downloaded, paste the Occidentalis image. 8. Insert the micro SD card into the writer, and insert it into a USB port on your computer. 9. Open up the terminal application. Navigate to the folder where the installer and the image are in, using cd to change the directory. For example,if the path to the folder with the installer and image is: /PiBackup/Raspberry-Pi-SD-Installer-OS-X-master then to change the directory one would type: cd /PiBackup/Raspberry-Pi-SD-Installer-OS-X-master You will now be in the directory Raspberry-Pi-SD-Installer-PS-X-master/
  • 21. 20 10. Once you are in the directory where the operating system image and the Pi installer are, type in sudo ./install Occidentalis_v02.img and then hit enter. 11. Terminal may or may not prompt you for your computer’s password. If so, simply type it in and hit enter. 12. Pi Installer will then run, and ask you on what disk to install the operating system. 13. Select the disk on which to install Occidentalis. Make sure that you have got the right disk number; Pi Installer will not check, and will truncate all the data already existing on the disk you select.
  • 22. 21 14. Double check that you have got the right disk. In our case it is /dev/disk1s1, but yours might be different. Press Enter, and Pi Installer will do the rest. This operation may take a few minutes. When Pi Installer is finishedwriting, it will close up by ejecting the disk.
  • 23. 22 15. Pull out the SD card from the writer. It is not necessary to eject it because Pi Installer does so when it is done. 16. Insert the micro SD card into its adapter, and slide the whole thing into the SD card slot on the Raspberry Pi. 17. Plug the keyboard and mouse into the USB ports of the Raspberry Pi. 18. Plug the monitor into the VGA side of the VGA to HDMI adapter, and plug the other end of the adapter into the HDMI port on the Raspberry Pi. 19. Plug in the 5V, 1A power unit, and plug the standard end of the USB cable into the power supply and the mini USB end into the Raspberry Pi’s mini USB port. A red and green light will then light up, and the Raspberry Pi will boot. 20. Go through the first time configuration after the Raspberry Pi starts. Use the arrow keys to select the items you want. I used: Boot straight to desktop: TRUE; Enable SSH on bootup: TRUE; Keyboard: Generic, 101 key U.S. When done, exit the configuration. 21. Shut down the Raspberry Pi by typing sudo shutdown –h now. When the green status light on the Raspberry Pi flashes 4 times and then goes off, unplug the Raspberry Pi.
  • 24. 23 7.2 Splice the USB cable In order to access the power wires in the USB cable to measure the voltage and current consumed by the Raspberry Pi, it is necessary to cut the USB cable. 1. Carefully strip away the outer insulation on a section of the USB wire using a hobby knife. Take care not to cut the delicate data wires inside. Remove the shieldingmesh and metal so you can see the red, black, green, and blue wires inside. 2. Using wire snips cut the red and black leads and strip 5 mm off the insulation on each cut end of them. 3. Attach jumper wires to each end correspondingly so that the black jumper wires connect to the black leads, and the red jumper wires connect the red leads. This color-coding makes it easier to distinguish the positive and negative leads. 7.3 Connect the multimeter In order to measure voltage, it is important to connect the multimeter correctly. 1. Connect one of the red jumper wires to the red terminal of the multimeter. With another red jumper wire, connect the red terminal of the multimeter back to the red jumper wire connected on the USB cable. 2. Connect one of the black jumper wires to the red terminal of the multimeter. With another black jumper wire, connect the black terminal of the multimeter back to the 25 Fluke Multimeter + - V
  • 25. 24 black jumper wire connected on the USB cable. The circuit schematic should look like the one above, where the voltage meter is connected in parallel to one the load. 7.4 Boot the Raspberry Pi at 700 MHz clock rate Boot the Raspberry to measure power draw when its CPU is at idle usage. 1. Connect the standard USB side of the spliced cable to the 5V, 1A DC power supply, and the mini USB end of it to the Raspberry Pi. Do not plug the power supply in yet. 2. Turn on the Fluke 175 True-rms multimeter and set it to volts, DC (autoranging). 3. Plug in the Raspberry Pi power supply and measure the amount of time the Raspberry Pi takes to boot. When it finishesbooting, it should show a screen with some desktop icons. 7.5 Measure the voltage Measure the voltage used by the Raspberry Pi when the CPU is at idle. 1. The CPU clock frequency is at 700 MHz currently, which is the default. When the Raspberry Pi has finishedbooting and the CPU is at idle,measure and record the voltage drawn 5 times in order to make sure the tests are accurate. 2. Find the average of these measurements. 7.6 Run a program witha loop toincrease the CPUload to100% In order to test the CPU power consumption when the CPU is at 100% utilization,we will write and run a loop to increase the CPU load to 100%. This simulates a situation where the user isrunning applications that require a high CPU clock rate. 1. Open up LXTerminal by double clicking on the desktop icon. 2. Type in nano loops.py 3. Type in a python program with a loop to increase the CPU load to 100%. The program that I used is below. while True: newNum = 123456789 * 987654321 This program runs in a loop forever, and calculates a variable, newNum, which is 123456789 * 987654321. Since the condition for the loop is true, the condition will never be false, and the loop will never terminate unless the user terminates the program. 4. To save the program and exit,type [ctrl] x, y, then [enter] 5. To run the program, type python loops.py 7.7 Measure the voltage Measure the voltage consumed by the Raspberry Pi when the CPU is at 100% utilization.
  • 26. 25 1. Measure and record the voltage 5 times. 2. Find the average of those measurements. 3. Stop loops.py by typing [ctrl] c 7.8 Shut down the Raspberry Pi In order to change the multimeter contacts to measure current, the Raspberry Pi must be shut down first. Since reconnecting the multimeter in another circuit will temporarily cut off the power, it is crucial to power off the Raspberry Pi first. 1. Shut down the Raspberry Pi by typing in terminal: sudo shutdown –h now 7.9 Change the multimeter contacts In order to measure current, the multimeter must be set up in series with one of the power wires. 1. Change the contacts for the multimeter so that one red jumper wire from the USB wire connects to the red contact on the multimeter. 2. Connect the other red jumper wire from the USB wire to the black contact on the multimeter. 3. This connection is made to measure current, since to do so the multimeter needs to be connected in series with one of the power wires. The finished schematic should look like the one above. 7.10 Boot the Raspberry Pi at the same clock rate Boot the Raspberry Pi at the same clock rate that was used to measure idle CPU voltage and 100% CPU utilization voltage. 1. Set the multimeter to measure amperes. 2. Plug in the Raspberry Pi to the power supply to boot it at the same clock rate. 7.11 Measure the current Measure the current consumed by the Raspberry Pi. 1. Measure and record the current 5 times. 2. Find the average of those measurements. 7.12 Increase the CPU load to100% To measure the current consumed when the CPU utilizationis 100%, we will run the program with a loop to increase the CPU load. + - A
  • 27. 26 1. Open up LXTerminal by double-clicking on the desktop icon. 2. Type loops.py to increase the CPU load to 100%. 7.13 Measure the current Measure the current consumed by the Raspberry Pi when the CPU utilizationis 100%. 1. Measure and record the current 5 times. 2. Find the average of those measures. 3. Type in terminal [ctrl] c to stop loops.py 7.14 Shut down the Raspberry Pi Change the clock frequency to the next frequency to be tested before shutting down the Raspberry Pi and rewiring the multimeter circuit to measure voltage. 1. Before shutting down the Raspberry Pi, change the clock frequency to the next frequency to be tested – see the next step. 2. Type in terminal cd ../../boot/ 3. Type in terminal sudo nano config.txt 4. Find the line where it says #arm-freq=800 5. Delete the hash mark in front of the line, and change the number to the clock frequency (in MHz) you want to set the CPU to. The default clock frequency is 700 MHz. 7.15 Repeat measurementswithdifferent clock frequencies 1. Repeat steps 6.4 – 6.14. At 6.14, use clock frequencies at 600 MHz, 800 MHz, and 900 MHz. 7.16 Plot the data collectedongraphs 8. Problems Encountered & Solutions 8.1 Too lowclock settings for Raspberry Pi resultedinnon-working computer 8.1.1 Raspberry Pi does not boot at 500 MHz To test the lowest underclockable frequency, the clock rate was set to 500 MHz. When plugged in, the Raspberry Pi began to boot, but then stopped midway, the screen went all black, and the boot process began all over. At a low clock frequency, the capacitors in the chip lose most of their charge before that charge can be used for other parts of the chip. When the clock frequency is decreased, the amount of time between the capacitor discharge
  • 28. 27 and when the charge is actually obtained by another component is greater. Therefore, sometimes, by slight chance of a few nanoseconds, a part does not get the neededpower that it should get from the discharging capacitor. Thus, the chip and boot process crashes, and it starts right over again with the boot process. As this graph shows, as the time increases, the charge from the capacitor discharge decreases rapidly, and less and less voltage is received. Without enough voltage, the parts that require this nominal voltage cannot properly function, and the chip crashes. 8.1.2 SD memory card corrupted Since the Pi did not fullyboot, there was no way to change the boot setting to a more reasonable CPU clock frequency, so it was necessary to re-install the operating system image on the SD card. I followedthe exact same process as described in step 6.1 of the procedure. 8.2 Pi cannot boot while using milliamperes setting onmultimeter To measure current draw of the Raspberry Pi,I set the multimeter to measure milliamperes. However, when the Raspberry Pi was connected, the Pi did not even start to boot at all. Therefore, I tried to use the amperes setting on the multimeter,and the Raspberry Pi booted. 8.2.1 Multimeter drew too much current at milliamperes The reason why the Raspberry Pi could not boot when the multimeter was set to milliampereswas because the multimeter drew too much current. Therefore, the Raspberry Pi did not get enough current through the power cable in order to start booting. Although it is not certain exactly why the multimeter draws more current at the milliamperessetting than at the amperes setting, it is related to the internal circuitry of the multimeter. This is why on the multimeter there are several settings for a user to choose from to measure the same thing. 9. Results and Measurements 9.1 Laptop PC 9.1.1 Raw Data Tables The followingtables are the raw data obtained by sampling the Kill-A-Watt power meter at differentclock frequencies. At the top right hand corner of the tables is a percentage that corresponds to what percentage of the full clock rate the CPU was set at those measurements. The column of numbers underneath is the five trials (denotedT1, T2, etc.), and the average of those measurements (denotedAverage). These that follow are simply the data I collected; analysis of this data is in section 10.1. All units are in watts.
  • 29. 28 9.1.2 Graphs and Charts We will analyze the graphs that follow in section 10.1. All units are in watts. 9.1.3 Comparison This followingchart shows how idle CPU power consumption is related to percentages of full CPU clock usage. 27
  • 30. 29 This chart below shows how idle CPU power consumption is related to actual clock frequencies. The chart below shows how 100% CPU utilizationpower consumption is related to percentages of full clock speedused. The followingchart shows the same data as the above chart, except showing actual clock frequencies. This followingchart shows how the idle CPU power consumption compares to 100% CPU load power consumption in percentages of CPU clock.
  • 31. 30 This followingchart shows how the idle CPU power consumption compares to 100% CPU load power consumption in actual clock frequencies. 9.2 Raspberry Pi 9.2.1 Raw Data The followingtable shows the results I got from measuring the Raspberry Pi at different clock rates. There are no values for 500 MHz since the boot failedbecause of the low clock rate. At the very last row, I have measured the boot time as a measure of system performance at that clock rate. Voltage is in Volts, and current is measured in amperes.
  • 32. 31 9.2.2 Graphs We will analyze the graphs that follow in section 10.2. Voltage is in volts, current is in amperes, and power is in watts. 28
  • 33. 32 The followinggraph shows how, at idle CPU, voltage drawn by the Raspberry Pi isrelated to clock rate. The next graph shows how, at idle CPU, current usage is related to clock frequency.
  • 34. 33 This followinggraph shows how, at 100% CPU usage, voltage drawn by the Raspberry Pi is related to clock frequency. This graph below shows how, at 100% CPU usage, current drawn by the Raspberry Pi is related to clock frequency.
  • 35. 34 Following isthe chart for the power consumption of the Raspberry Pi when the CPU is at idle. Below is the chart for power consumption of the Raspberry Pi when the CPU is at 100% utilization.
  • 36. 35 This followingchart shows both the High CPU Voltage and Low CPU Voltage – voltage drawn by the Raspberry Pi when the CPU is at 100% and idle. This chart below shows both the High CPU Current and Low CPU Current – current drawn by the Raspberry Pi when the CPU is at 100% and idle.
  • 37. 36 Here is the chart that combines High CPU Power and Low CPU Power, power consumption by the Raspberry Pi when the CPU is at 100% utilizationand idle. As a measure of system performance, the graph for boot time follows. 10. Analysis 10.1 Laptop PC 10.1.1 Hypothesis holds true The data collected from the laptop PC supports my hypothesis. As the clock rate increases, the power consumption also increases. When the clock rate decreases, power consumption
  • 38. 37 decreases. The units are in watts. Each clock cycle takes a certain amount of power to perform, and when the number of clock cycles decreases by underclocking, the power consumption also decreases. 10.1.2 Underclocking at idle Since modern CPUs can turn off certain sections that are not in use when the CPU is at idle, the power usage is little affected by underclocking at idle CPU. The units are in watts. Even though it looks like a big difference on the graph, the increase is not actually very large; only the large increments make it seem significant. However, the main trend is that with an increased clock at idle CPU, only little power usage is increased. Another graph follows,but it has the actual clock frequenciesin Gigahertz listedand the power consumption. The units are in watts.
  • 39. 38 Notice how at the beginning of the X-axis, which is the CPU clock rate, all of them say 1.20, even though, as seen in the first chart, the frequency percentage is at 5%, then 10%, and so on until 50%. At 50%, the clock frequency becomes 1.33 GHz, and increases from there on. This means that the system cannot go below 1.20 GHz, so it puts it for 5%-40%, even though the percentage CPU should be lower. 10.1.3 Underclocking at 100% CPU utilization At 100% CPU utilization,at every cycle the CPU is busy doing an operation, which uses more power than simplyidling. When the CPU is underclocked and the CPU usage stays 100%, the power saving has a significant reduction. Units are in watts. The next graph shows the same data, but with the actual CPU clock as well. Units are in watts.
  • 40. 39 The general trend of the data is that as the clock rate is increased, the power consumption also increases. Note the fast growth on the chart after 1.16 GHz. 10.1.4 Comparison The graph that follows shows both trends for 100% CPU utilization(High CPU) and idle CPU. Units are in watts. The graph below shows the same data, except with the actual CPU clock rate.
  • 41. 40 Notice how the first 5 clock frequenciesall say 1.20, even though the percentage CPU set was different:5%, 10%, etc. The reason for that is because below 50% CPU, the CPU will not be able to function with a lower clock frequency than 1.20. If the CPU went below that frequency, the chip would crash, and the computer would become inoperable. Therefore, the operating system does not letthe CPU go below the minimum frequency threshold. The main trend in data is that as the clock rate increases, power consumption also increases. Underclocking at 100% CPU load is more effective than underclocking at idle CPU because at 100% load the CPU is actively using power for each cycle, and reducing the number of cycles effectivelyreduces the amount of power the CPU draws. With underclocking at 100% CPU load, over 15 watts of electricity were saved, with the full clock using over 45 watts, and the underclocked CPU using only 30. However, with underclocking at CPU idle,only 2-3 watts of electricity were saved, with the full clock using 26 watts, and the underclocked CPU used 23 watts. 10.2 Raspberry Pi 10.2.1 Hypothesis not supported The data graphs collected from the Raspberry Pi measurements were singularly peculiar. The power, voltage, and current measurements seemedto jump all over the place, as seen in these diagrams. Voltage is in volts, current is in amperes, and power is in watts.
  • 42. 41
  • 43. 42
  • 44. 43 10.2.2 Built-in energy management unit Further research was conducted after observing these singular diagrams, including consulting technical documentations about the chip. It was found that the Arm ARM1176JZF-S CPU, which is used in the Raspberry Pi, has an internal energy management unit built into the chip. Since this exact CPU is used frequently in mobile devices and phones, it includes an automatic energy management unit that would measure numerous chip factors, such as temperature, clock rate, load, etc., and regulate the voltage and current going to the CPU to optimize performance and reduce energy usage. Particularly, the energy management is critical for mobile devices such as phones since they would quickly run out of power without this unit. By manipulating input voltage and current going to the CPU, the energy management unit is able to control the energy usage of the chip as our measurements show. Surprisingly, the lowest power use is at the standard clock frequency, showing that this is an optimal setting for this CPU. 10.2.3 Overrides other CPU settings Even though the user can set up specific options and settings for the CPU, this energy management unit can automatically override many of those settings, among them voltage and current. The energy management unit is preprogrammed to optimize chip performance, reduce energy consumption, and reduce excess heat production by the CPU. 10.2.4 Buck Regulator The crucial part of the energy management unit, the Broadcom BCM2835, is the Buck Regulator. The schematic below shows how a Buck Regulator works. At the supply (circle), an input voltage is passed. When the switch is closed, the electricitygoes through the inductivity (coily thing),being the only way for it to travel. When an inductivity sees an increase in voltage, it builds up an electromagnetic field,thereby smoothening out the increase in input voltage and slowing down the change of voltage in time. When voltage is passed in from the source, the inductivity slows down the increase in voltage by building an
  • 45. 44 electromagnetic field. The voltage then goes through, in parallel, a capacitor (two parallel lines) and the load (rectangle). In our case, the load is the CPU because it causes resistance and uses power. The load gets power, but at a reduced power than at the source because of the slowdown of increase of voltage over time by the inductivity. At the second state, when the switch is closed, the capacitor wants to release all its electrons. However, the inductivity, being reluctant to change its state, smoothens out that sudden burst of electricity from the capacitor to make it useable to the load. The diode (triangle with a line on top) forces the electricity to go only that way, and does not let the electricity flow back. Therefore, when the switch opens, the inductor’s momentum (whenit converts the electromagnetic field back into electricity) does not burn out the switch. The load now gets power, at a reduced voltage, without any loss of power throughout the circuit! Then, when the switch closes again at state 1, the voltage slowly increases, the capacitor charges, and the load gets electricity at a reduced voltage than the source. Through regulating the switching by controlling the amount of time in each state, a different power can be given to the device,without any loss through heat! This is differentthan a normal regulator, as in a regulator the excess power is converted into heat, and in the Buck Regulator no electricity is lost due to heat or other losses. 11. Summary 11.1 On the PC Power usage on the PC significantlydecreases by reducing the clock rate. This is because each clock cycle requires energy to perform. By reducing the clock rate, we reduce the number of clock cycles per second; hence, power usage decreases. State 1: switch closed State 2: switch open
  • 46. 45 11.2 On the Raspberry Pi On the Raspberry Pi,power consumption decreased by reducing the clock rate and first increased by increasing the clock rate at 800 MHz, and then decreased significantlyby increasing the clock rate to 900 MHz. This erratic power usage is due to aggressive power management on the CPU by the built-inhardware power management system. As the power management system noticed the CPU was going at a higher clock rate, it decreased the power given to the CPU.
  • 47. 46 12. Acknowledgements I would like to thank my mom for her continued support of my project, and my dad for his practical advice and suggestions. 13. References Safari Books Online. Hacking Raspberry Pi. Retrieved from techbus.safaribooksonline.com/print?xmlid=9780133476637%2Fch18lev1sec3 on 2/1/14. Windows. Power Policy Configuration and Deployment in Windows. October 21, 2010. Safari Books Online. Practical Electronics for Inventors. Retrieved from techbus.safaribooksonline.com/print?xmlid=9780071771337%2Fch2_13_html on 2/1/14. Windows. Processor Power Management in Windows 7 and Windows Server 2008 R2. October 19, 2012. Wikipedia. Raspberry Pi. Retrieved from http://en.wikipedia.org/wiki/Raspberry_Pi on 2/1/14. Safari Books Online.Raspberry Pi User Guide. Retrieved from techbus.safaribooksonline.com/print?xmlid=9781118464496%2Fa2_10_9781118464496_ch 06_html on 2/1/14. Windows. Using PowerCfg to Evaluate System Energy Efficiency.March 26, 2010.