27
Erno Salminen - Nov. 2008 TKT TKT - - 3500 3500 Microcontroller Microcontroller systems systems Lec Lec 12 12 Power consumption Power consumption Erno Salminen Erno Salminen Department of Department of Computer Systems Computer Systems Tampere University of Technology Tampere University of Technology Fall 2008 Fall 2008

TKT-3500 Microcontroller · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Embed Size (px)

Citation preview

Page 1: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008

TKTTKT--3500 3500 Microcontroller Microcontroller systemssystemsLec Lec 1212 –– Power consumptionPower consumption

Erno SalminenErno Salminen

Department ofDepartment of Computer SystemsComputer SystemsTampere University of TechnologyTampere University of Technology

Fall 2008Fall 2008

Page 2: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#2/49

SourcesSources

Thanks to Mikko Kohvakka

Page 3: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#3/49

ContentsContents

Power vs. energyBatteries and other power sourcesPower measumentPower saving modes

Page 4: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#4/49

Power Power PP and energy and energy EEPower measures the amount of work done in unit time

Rate of energy consumptionSymbol P; unit Watt, WProduct of voltage and current: P = U * I = U * (U/R)PIC uses <1 W of power

Energy E means the total workSymbol E; unit Joule, JE = P * t = (U*I) *t, where t denotes timeSometimes given in Watt-hours, Wh or volt-Ampere-hours VAh

Battery stores some amount of energy E that is spent at certain rate P

Page 5: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#5/49

BatteriesBatteries

Combination of two or more electrochemical cells

Cells store chemical energy which can be converted into electrical energy

1. Primary batteries irreversibly (within limits of practicality) transform chemical energy to electrical energy.

When the initial supply of reactants is exhausted, energy cannot be readily restored to the battery by electrical means

2. Secondary batteries can be rechargedCan have their chemical reactions reversed by supplying electrical energy to the cell, restoring their original composition

Page 6: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#6/49

Battery capacityBattery capacityCapacity of a battery depends on the discharge conditions, such as

the magnitude and duration of the currentthe allowable terminal voltage of the battery, temperature and other factors

Theoretically, a battery should provide the same amount of energy regardless of the discharge rate

t = Q / I, where t is duration of operation, Q is the charge, and I is discharge current

In real batteries, internal energy losses cause the efficiency of a battery is different at different discharge rates

If a battery is discharged at a relatively high rate, the available capacity will be lower than expected E.g.a battery rated at 2000 mA·h may not sustain a current of 1 A for the full two hours.

Page 7: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#7/49

Battery disharge curvesBattery disharge curvesDischarge curve often S-shapedCurrent affects also to voltage

in addition to capacityCapacity expressed assuming 1C load current

1Ah battery: 1C = 1A, 2C = 2A…

Page 8: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#8/49

VoltageVoltage –– current curvecurrent curve

Best power U*I achieved at specific currentVoltage drops to ~80% of open-circuit voltage

Max. power point

Open circuit voltage

Short-circuit current

Page 9: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#9/49

SelfSelf--disharge disharge

Batteries leak current even not usedBattery type affects strongly on the lifetime

Page 10: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#10/49

Voltage regulatorsVoltage regulators

Maintains a constant voltage level automatically even if supply voltage variesMicrocontrollers assume DC voltage

Especially analog parts!Practically always use need some regulation

Many simple DC power supplies regulate the voltage using a shunt regulator

such as a zener diode, avalanche breakdown diode, or voltage regulator tube. Begins conducting at a specified voltageWill conduct as much current as required to hold its terminal voltage to that specified voltage

Page 11: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#11/49

Voltage regulator exampleVoltage regulator example

Zener is special diode as it conducts backwardsVout is the reverse breakdown voltage or zener voltage. This voltage regulator can only step down the voltage, not up (V > Vz)Even if the current through the diode fluctuates, the voltage remains fairly stableR limits the current so that power loss over zener is low enough, e.g. < 1W

Schematic symbol

Regulation using Zener diode

I

Page 12: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#12/49

Energy harvesting/scavenging: Energy harvesting/scavenging: Solar cellSolar cell

Trasform the energy in photons in electricitySun radiates ~100 mW/cm2 on a bright summer day

1. Silicon cellsEfficiency 6% - 10%Heavy, fragile glass Expensive, old technology

2. Thin film cells Copper-Indium-Gallium-Selene (CIGS), Copper-Indium-Selene (CIS)Efficiency 5% - 8%, (up to 20% in laboratory)Light, durable ja flexible (muovirakenne)Cheap (especially as manufacturing matures)

3. Organic cellsEfficiency 1% – 3%Still in its infancy (research usage only) Light, flexibly, cheapestCan be even “printed” on the material’s surface Huge potential for mass production

Page 13: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#13/49

Energy harvesting/scavenging:Energy harvesting/scavenging: VibrationVibration

Piezo electric generator is the simples harvester

Piezoelectric materials transform mechanical strain energy into electrical chargePiezo fiber + weigthVibration causes strain to piezo fiber

MEMS technology is also attractive due to small size and high precision

Fig. MEMS VDRG (micro electro-mechanical system velocity damped resonant generator)

[Mitcheson, JMEMS, 2004]

Page 14: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#14/49

Energy harvesting/scavenging: Energy harvesting/scavenging: TemperatureTemperature

Heat difference can be transformed into electricity E.g. Peltier element

Junction of two different metalsWorks in both directions: creates temperature difference when current applied (local cooling)

Page 15: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#15/49

Comparison of energy sourcesComparison of energy sources

Lähde: S. Roundy, Power Sources for Wireless Sensor Networks

Page 16: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008

Power consumption in Power consumption in embedded systemembedded system

Page 17: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#17/49

Sources of power consumptionSources of power consumption

Dynamic power in CMOS: P = a * f * C * Vdd2

a = activity, toggle rate, rising edges per periodf = frequencyC = capacitanceVdd = supply voltage

Minimize any/all of the termsVoltage reductions has biggest impact

Reducing fdelays processing, energy remains the sameallows smaller voltage!

Page 18: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#18/49

Measuring powerMeasuring power

1. MultimeterApplicable when changes in current are smallPoor accuracy with spiky currents

2. OscilloscopeMeasurement need small series resistorMuch more accurate than multimeterCan sample over long period and calculate averageNoise affects very in measuring low-power devices

measured system

+-

shunt R

Page 19: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#19/49

Measuring power with capacitorMeasuring power with capacitorMost accurate but laboriousPower supply from capacitor

E.g. 1F super capacitor and faster tantal/ceramic capacitors in parallel

Measure the change in voltage in unit timeIt is easy to calculate power when C and slew rate are known

U’ is “normal” supply voltage if device has linear regulatorU’ is voltage over capacitor if device has switching power supply (chopper, hakkuri) in which case the current depends heavily on voltage

'UP CUt

∆=

Change rate of voltage (V/s)

measured low-power

system +-

Page 20: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#20/49

Watchdog timer (WDT)Watchdog timer (WDT)

Page 21: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#21/49

(PIC24)

Page 22: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#22/49

Page 23: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008

Final wordsFinal words

Page 24: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#24/49

ExamExam

Total about 30 pointsBonus points apply with passed exam

1. Explain the terms, á 2 pointswathcdog, saturating arithmetic, volatile, text/data/bss, brown-out, magic number, servo, I2C, SPI, USART, clamp diodes...

2. Small essays, á 3-4 pointsPWM, serial vs. parallel communication, C vs. assembly, PCBN design rules, errors source in ADC, timer basics...

3. Small design task, á 4-6 pointsHow to connect push button to micorcontroller, real-time clock, pulse width measurement, I2C with PIC + two slaves, C code analysis... Use pseudo-code, figures, timing diagrams

Page 25: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#25/49

Give feedbackGive feedback

Course had a couple of changes this yearNew lecturerNew assistantsNew bookNew lecture slidesNew exercises

Tell your opinion (via Kaiku/email)What went fine and what did not?What we should improve?Bonus available for detailed feedback

Lecture by lecture, exercise by exercise

Page 26: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#26/49

TKT:n syventTKT:n syventäävväät kokonaisuudett kokonaisuudet

appapp

os

hw

...

...

appapp

os

hw

appapp

os

hw

appapp

os

hw

appapp

os

hw

appapp

os

hw

mem

mem

mem i/o i/o... mem

Thread 1 [activated]

statemachine

scheduler

Thread 2 [inactive]

statemachine

scheduler

Thread 3 [activated]

statemachine

scheduler

Signal queue

Signal passing functions RTOS API

Application

Device drivers

eCos kernel

CPU

router

local memories

Lähde: www.nsf.gov/news/newsmedia/robotics05/

Lähde: ww

w.sange.fi

Lähde: Alberto Sangiovanni-Vincentelli. “Embedded System Desiign: Modells, Valliidatiion and Synthesiis”. EE249. Luentokalvot

Lähde: http://www.kalinskyassociates.com/Wpaper1.html

Lähde: http://news.ecoustics.com/bbs/messages/10381/381011.html

Lähde: http://regmedia.co.uk/2006/09/26/nokia_n95_1.jpg

Lähde: http://www.cs.princeton.edu/~gewang/ee464/product.html

Terminal with UI

Data storage

Gateways to other networks

Sensor elements

Inspected phenomenon

Node’s Hardware architecture

Wireless links

Exter

nal n

etwor

k

CommunicationComputingSensing

Radio

Sensor

Power

Battery Regulators

AD

C

Sensor

Application server

MCU

1.

3. 4.

5.

2.

6.

Ohjelmoitavat alustat ja laitteet

Tietokone- ja prosessoritekniikkaDigitaalisten piirien suunnittelu

Paikannus ja navigointi

Sulautetut järjestelmät

Langattomat sensoriverkot

Page 27: TKT-3500 Microcontroller  · PDF fileTKT-3500 Microcontroller systems Lec 12 – Power consumption ... unit Watt, W zProduct of voltage ... zPIC uses

Erno Salminen - Nov. 2008#27/49

DI-tutkinto 30 opDI-tutkinto 30 opesitiedot esitiedot kandidaatin tutkinto 25 opkandidaatin tutkinto 25 op

Yksinkertaistetut kurssien esitiedot 08/09Yksinkertaistetut kurssien esitiedot 08/09

TKT-1100 DigTeknPer.

3 op (s1)

TKT-1100 DigTeknPer.

3 op (s1)

TKT-1202 DigSuunn5 op (s2)

TKT-1202 DigSuunn5 op (s2)

TKT-1212 DigJärjTot8 op (k3)

TKT-1212 DigJärjTot8 op (k3)

TKT-1220 Aritmetiikka

4 op (s3)

TKT-1220 Aritmetiikka

4 op (s3)

TKT-3200 Tietokonetekn. I

5 op (s1)

TKT-3200 Tietokonetekn. I

5 op (s1)

TKT-1110 Mikroprosess.

5 op (s3)

TKT-1110 Mikroprosess.

5 op (s3)

TKT-2431 SoC-Suunn

5 op (s1)

TKT-2431 SoC-Suunn

5 op (s1)

TKT-1230 Laboratorio

3 op (k5)

TKT-1230 Laboratorio

3 op (k5)

TKT-3400 Tietokonetekn II

5 op (k4)

TKT-3400 Tietokonetekn II

5 op (k4)

TKT-1400 ASIC I

5 op (s1)

TKT-1400 ASIC I

5 op (s1)

TKT-1410 SunnVarm5 op (s3)

TKT-1410 SunnVarm5 op (s3)

TKT-3541 Soc-Alustat

5 op (s3)

TKT-3541 Soc-Alustat

5 op (s3)

TKT-1500 ASIC II

5 op (k4)

TKT-1500 ASIC II

5 op (k4)

TJT-1566 DigDesign III

5 op (s2)

TJT-1566 DigDesign III

5 op (s2)

TKT-2511Form.Toim.V

5 op (k4)

TKT-2511Form.Toim.V

5 op (k4)

TKT-2410 Soc-Mallinn

5 op (k4)

TKT-2410 Soc-Mallinn

5 op (k4)

TKT-1510Testattavuus

3 op (k4)

TKT-1510Testattavuus

3 op (k4)

TKT-1530Asynkroniset P

5 op (s1)

TKT-1530Asynkroniset P

5 op (s1)

TKT-3516 Signal proc.

5 op (s1)

TKT-3516 Signal proc.

5 op (s1)

TKT-3500 MIkrokontroll.

5 op (s1)

TKT-3500 MIkrokontroll.

5 op (s1)

TKT-3520ProsSuunn

5 op (s3)

TKT-3520ProsSuunn

5 op (s3)

TKT-2520 Projektityö

5-8 op

TKT-2520 Projektityö

5-8 op

TKT-2530SatellPaikann

5 op (s1)

TKT-2530SatellPaikann

5 op (s1)

TKT-9616ScientificPubl

4-5 op (s1)

TKT-9616ScientificPubl

4-5 op (s1)

TKT-2540PaikannMen

3 op (k5)

TKT-2540PaikannMen

3 op (k5)

TKT-9606OrPostGrad4-5 op (k4)

TKT-9606OrPostGrad4-5 op (k4)

ELE-1010 ElePer 13 op (s1)

ELE-1010 ElePer 13 op (s1)

=

pakollinensuositeltava

Kaikkia kurssien välisiä suhteita ei ole merkitty. Tarkista opinto-oppaasta

1. Ohj. alust

4. Dig. piirit

3. Pros.tekn

5. PaikannusTKT-2556

Inertial nav. 5 op (k5)

TKT-2556Inertial nav.

5 op (k5)

TKT-2300 Lang. sens.v sov. 4 op (s2)

TKT-2300 Lang. sens.v sov. 4 op (s2)

TKT-2450 Wireless.sens

. 5 op (k4)

TKT-2450 Wireless.sens

. 5 op (k4)

6. Sens.verk

Syventäväkok:

2. Sul.järj

2. Sul. järj.

2. Sul. järj.

Mitä opiskella kontrollerien

jälkeen

Mitä opiskella kontrollerien

jälkeen