Download Lecture 07 Power, Batteries, and Sleep - iesc-s2!

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of electric power transmission wikipedia , lookup

Power engineering wikipedia , lookup

Rectifier wikipedia , lookup

Stray voltage wikipedia , lookup

Grid energy storage wikipedia , lookup

Opto-isolator wikipedia , lookup

Buck converter wikipedia , lookup

Alternating current wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Voltage optimisation wikipedia , lookup

Mains electricity wikipedia , lookup

Rectiverter wikipedia , lookup

Electric battery wikipedia , lookup

Transcript
3/21/17
6.S08:Interconnectedembeddedsystems
Lecture07
Power,Batteries,andSleep
JoelVoldman
JoeSteinmeyer
March21,2017
AdministrativeNotes
• L06BandL07Bthisweek(power)
• EX07outsoon,due4/02/2017(SundayafterSpring
Break)
• FinalProjectTeamsduebythisFriday
• GPSisworkingagainin38-500
1
3/21/17
Motivation
ManyIoT sensornodesarebatterypowered
Wantthemtolastalongtime
Power
• Voltage:(JouleperCoulomb):
• PEdropperunitcharge
• Current:(Coulombspersec):
• Chargeperunittime
• Powerconsumed:
• ProductofVoltageacross and
Currentthrough adevice
𝑃 =𝑉$𝐼
𝑃=
𝐽𝑜𝑢𝑙𝑒
𝐶𝑜𝑢𝑙𝑜𝑚𝑏 𝐽𝑜𝑢𝑙𝑒
$
=
= 𝑊𝑎𝑡𝑡
𝐶𝑜𝑢𝑙𝑜𝑚𝑏
𝑠𝑒𝑐
𝑠𝑒𝑐
2
3/21/17
Energy
• IntegralofPower
Consumedovertime
9
𝐸(𝑡) = 6 𝑃 𝜏 𝑑𝜏
:
𝑃(𝑡) = 𝑉(𝑡) $ 𝐼(𝑡)
9
𝐸(𝑡) = 6 𝑉(𝜏) $ 𝐼(𝜏)𝑑𝜏
:
• IfVoltageandCurrent
areconstantovertime:
𝐸 = 𝑉 $ 𝐼 $ Δ𝑡
Where/Howmuchenergy?
• Transistorsinelectronicsconsume
energy
• Turningon/offatransistoris
effectivelychargingacapacitor!
• 50%ofenergyislostduringcharging
G
VHI
Conductor
Conductor
Insulator
3
3/21/17
Power&EnergyConsumption
Dynamicdissipation
Numberof
EnergyPer
“SwitchActions”
Switch
toCompleteTask
TotalEnergy
Consumed
𝐸< = 𝑁 $ 𝐸> + 𝑃@ $ 𝑇
PowerLostto TimetoComplete
Task
Leakage
Staticdissipation
Powerorenergybudget
• WewantourIoT devicetolastalongtime
• Howlong?
• Dependsonapplication
• AppleWatch:~1day
• Unattendedbuildingsensor:>1yr
• Implantedpacemaker:5-10yrs
• Threewaystoincreaselifetime
• Increaseenergysource
• Decreasedemand
• Harvestenergyfromenvironment
4
3/21/17
Batteries
• Voltagesourceswithfiniteenergystorage
• Widedifferencesin
•
•
•
•
•
•
Nominalvoltage
Currentcapability
Energycapacity
Energydensity(J/kgorJ/m3 orWh/m3)
Dischargecharacteristics
Renewableorone-time
Batterychemistries
• Primary(nonrechargeable)
• Alkaline
• Lithium
• Secondary(rechargeable)
• Li-Ion&Li-Poly
• NiMH
http://batteryuniversity.com/learn/article/primary_batteries
5
3/21/17
Batteryvoltage
• Dependsonchemistry
• NiMH:1.2V
• Alkaline:1.5V
• Lead-Acid:2.10V
• Copper-zinc-lemon:1.5V
• Lithium-manganesedioxide:3.0V
• Li-IonandLi-Poly:3.7V
• Canincreasebatteryvoltageby
placingcellsinseries
Batteryself-discharge
• Self-dischargerates
• Howmuchcapacityislostdueto
internalresistance
• Alkaline~5yrs
• Lithium-Ion~2-3%/mo
• NiMH~30%/mo
• Lithium:~1%/yr
• Youdon’twantself-dischargetolimit
yoursensornodelifetime!
6
3/21/17
Batterycapacity
Alkalinebatteries
• Dependsonchemistry
andsize
• LiAA:2500-3400mAh
• CR2032
• ~200mAh
• LiPoly
• Varietyofsizes
• iPhone6:1810mAh
• Applewatch:205mAh
http://www.techradar.com/us/news/wearables/apple-watch-battery-size-mah-1291964
OurBatterySymbol
• Thisseemssonice
andeasytothink
about…3.7Vwhen
itison,0Vwhenit
isoff
• Butinreallifeit
isn’tsocleanand
nice!
+
Li-Poly
350𝑚𝐴𝐻
3.7V
-
7
3/21/17
Batterydischargecurves
• Ratedcapacitydependsonhowquicklythe
cellisdischarged
• Discharge(andcharging)ratesinunitsof“C”
• 1C=discharge1× capacityin1hr
• 2C=discharge2× capacityin1hr
• Etc.
2000mAh cell
• Differentbattery
typesvaryinmax
dischargecurrent
http://www.richtek.com/battery-management/en/designing-liion.html
Batterydischargecurves
• Differentchemistrieshavedifferentdischargecurves
• Voltagewillchangeovertime…itisnotconstant
• Canusebatteryvoltagetoestimateremainingcapacity
• Systemmustbeabletoaccommodatevaryingvoltage
8
3/21/17
BatteryDataSheet
Battery
• Togetthemostoutofabattery,youwantto
useitmoderately.
• Themorecurrentyoupullfromit,theless
you’llgetoverall.
• Batterymanagementboard
(Powerboost1000C)willhelpwiththissome,
butyourusageisalsoimportant
9
3/21/17
LithiumPolymerBattery
Safety
Safety
• NeveruseourLiPoly batteries
otherthanwithPowerboost
board!
• BatteryplugsintoboardsJST
connector
• Onlychargebatterythrough
powerboostboard(ideally
whenyou’veremoveditfrom
breadboard)
Battery
Powerboost
10
3/21/17
LiPoly Video(ShortingBattery)
• DirectlyconnectingawiretoaRawLi-PolyBatteryis
verydangerous.Donodothis:
LithiumPolymerBatteries:
SafetyRulesfor6.S08
SAFETY NOTICE: Never leave a battery unattended while charging. Only
charge the battery when it is in your 6.S08 fire-retardant pouch. When not
using, disconnect the battery and store in fire-retardant bag.
SAFETY NOTICE: Never directly connect your battery to anything but the
PowerBoost 1000C JST socket. No wires, etc…
SAFETY NOTICE: If your battery is bulging, hot, or damaged, don’t use it!
Put it in your fire-retardant bag and contact staff
SAFETY NOTICE: DO NOT CRUSH OR DROP YOUR 6.S08 KIT WITH
THE BATTERY. DO NOT SIT ON YOUR 6.S08 KIT. DO NOT SHOVE IT
AT THE BOTTOM OF YOUR BOOKBAG UNDERNEATH BOOKS
MAINTENANCE NOTICE: Battery connectors are fragile. Insert and
remove carefully. If yours breaks, tape the bare wires to prevent shorts
and bring it to lab for assistance in fixing or replacing it.
Adaptedfrom2.007
11
3/21/17
More,(somerepeated)general
warningsandadvice
•
DoNOTimmersethebatteryinwaterorotherliquids.Keeporstorethebatteryinacoolanddryplace/environment.
•
DoNOTuseorstorethebatterynearanysourceofheat.
•
Useachargerthatisclearlyspecifiedtobecompatibleforchargingthebatteryandhasappropriatechargingprotection(voltage,current,temperature)
•
DoNOTinstallthebatteryinreversepolarity.
•
DoNOTconnectthebatterytoanelectricaloutletorotherincompatiblepowersource.
•
DoNOTdiscardthebatteryinfire.
•
DoNOTshortcircuitthebattery.DoNOTconnectthepositiveandnegativeterminalstoeachotherwithmetallicobject(s)or otherconductivematerial(s).
•
DoNOTtransportorstorethebatterytogetherwithmetalobjects,suchashairpins,necklaces,oranyotherconductiveobjectormaterial.
•
DoNOTstrike,crush,puncture,disassemble,orthrowthebattery.
•
DoNOTdirectlysolderthebatteryorbatteryterminals.
•
DoNOTpiercethebattery.
•
Lithiumbatteriesshouldbeusedonlywithpropervoltage,current,andtemperatureprotectioncircuitryandprotection.
•
DoNOTuseorleavethebatteryinahightemperatureenvironment(forexample,underdirectsunlightorinavehicleinhotweather).Failuretotakethisprecautioncanleadto
overheatingofbatteryand/orfireorexplosion.Also,performanceofbatterywilldegradeandlifetimewillbereduced.
•
DoNOTusebatteryinalocationwherethereishighstatic-electricityormagneticfields,otherwisesafetydevicesmaybedamagedwhichcannotbevisible.
•
Ifthebatteryleaksandtheelectrolytegetintotheeyes,doNOTrubeyes.Instead,rinseandwasheyeswithcleanwater,andimmediatelyseekmedicalattention.
•
Itthebatterygivesoffanodor,generatesheat,becomesdiscoloredordeformed,orinanywayappearsabnormalduringuse,recharging,orstorage,immediatelyremoveitfrom
thedeviceorbatterychargerandstopusingit.
•
Incasethebatteryterminalsaredirty,cleantheterminalswithadryclothbeforeuse.Otherwise,poorperformancemayoccurduetothepoorconnectionwiththeinstrumentor
device.
•
Beawarethatdiscardedbatteriesmaycausefireorexplosion.Therefore,applyanon-conductivetapetothebatteryterminalstoinsulatethembeforediscarding.
*fromAdafruit
Onlyinteractwiththebattery
throughthePowerBoost Board!!!
• Preventsover-charging
• Preventsshorting
• Preventsover-discharging
PhysicalDamageisotherrisk:
• Neverstab/bend/juggleyourbattery
• Donotbendtheyellowtopofthebattery
• Respectandkeepbatterysafeinthefire-retardantbagand
disconnectedwhennotinuse
• Donotcrushyoursetup
12
3/21/17
StabbingBattery
• Demonstratingriskofphysicaldamage(DONOTDO
THIS):
UsingBatterieswith
Electronics
13
3/21/17
Batteryvoltageandsystemvoltage
• Batteriescomein1.2,1.5,3.0,3.7V,etc.
• Ourcomponentsarepoweredat3.3Vor5V
• Howtoconnect?
• Eitherplacebatteriesinseries(end-to-end)
• Voltagesadd
• Canalsoplacebatteriesinparallel(side-by-side)
• Capacitiesadd
• Mostcomponentshaverangeofallowablesupply
voltage
• IMU:1.9V..3.6V
• FreescaleK20microcontroller:1.71V..3.6V
• ESP8266:3.0...3.6V
PowerRegulators/Converters
• Ifbatteryvoltageishigherthanneeded,mustconvertdown
• Ifbatteryvoltageislowerthanneeded,mustconvertup
• Twotypesofconverters:
• Linear(Traditional):
•
•
•
•
ConstantCurrentDevice
Lessefficient
Oftencheaper
Canonlyconvertfromhighervoltagetolower
• Non-Linear(SwitchingSupply):
•
•
•
•
•
ConstantPowerDevice
Moremoderndevelopment
Generallymoreefficient
Usuallynotascheap
Canconvertupanddown
14
3/21/17
LinearRegulator
• ConstantCurrentDevice(KCLmaintained)
• Canonlyregulatedowninvoltage
𝑣canvary
𝑅𝑒𝑔
[email protected]𝑉
𝐶𝑖𝑟𝑐𝑢𝑖𝑡
Supply
𝑖
Efficiency=
𝑣: = 0
𝑎𝑚𝑜𝑢𝑛𝑡𝑔𝑜𝑖𝑛𝑔𝑡𝑜𝑤ℎ𝑎𝑡𝑤𝑒𝑤𝑎𝑛𝑡
𝑡𝑜𝑡𝑎𝑙𝑎𝑚𝑜𝑢𝑛𝑡𝑢𝑠𝑒𝑑
If𝑖 = 50𝑚𝐴 andsupplyvoltageisat𝑣 = 5.0𝑉 whatistheefficiencyofthissystem?
(i.e.howmuchpowerisconsumedbythecircuitandnottheregulator?)
Efficiency=
Z.Z[$\:]^
\.:[$\:]^
≈ 67%
LinearRegulatorsin6.S08Device
• ConstantCurrentDevice(KCLmaintained)
• Canonlyregulatedowninvoltage
TeensyDevBoard
Underside
of
GPS
ESP8266
15
3/21/17
SwitchingSupply(non-lineardevice)
• ConstantPowerDevice(𝑝ef9 = 𝜀 $ 𝑝gh )
• 𝜀 isefficiencyand0 ≤ 𝜀 ≤ 1
[email protected]𝑉
𝑣canvary
𝑖gh
𝒑𝒊𝒏 𝒑𝒐𝒖𝒕 𝑅𝑒𝑔
Supply
𝐶𝑖𝑟𝑐𝑢𝑖𝑡
𝑖ef9
𝑣: = 0
𝑣: = 0
If𝑖ef9 = 50𝑚𝐴,𝑖gh = 35𝑚𝐴,andsupplyvoltageisat𝑣 = 5.0𝑉 whatistheefficiency?
(i.e.howmuchpowerisconsumedbythecircuitandnottheregulator?)
Efficiency=
Z.Z[$\:]^
\.:[$Z\]^
=
ij\]k
il\]k
≈ 94%
SwitchingSupply
• SwitchingSuppliescanincrease(boost)ordecrease
(buck)voltage
• Linearregulatorscan’t!
3.2𝑉 ≤ 𝑣 ≤ 4.2𝑉
[email protected]𝑉
𝑖gh
3.7V
1200mAH
LiPoly
(with
protection
circuit)
𝑣: = 0
𝒑𝒊𝒏 𝑅𝑒𝑔
𝒑𝒐𝒖𝒕 𝐶𝑖𝑟𝑐𝑢𝑖𝑡
𝑖ef9
𝑣: = 0
16
3/21/17
PowerBoost 1000C
• BatteryManagementcharges/discharges/protects
batteryelectrically
• Switchingsupplyconvertsbattery’svaryingvoltage
to~5.0Voutput
SwitchingSupply
BatteryManagement
Howefficientisourentire6.S08system?
[email protected]𝑉
3.2𝑉 ≤ 𝑣 ≤ 4.2𝑉
3.3𝑉𝑅𝑒𝑔
[email protected]𝑉
𝑖gh
3.7V
1200mAH
LiPoly
𝒑𝒊𝒏 𝑃𝑜𝑤𝑒𝑟𝐵𝑜𝑜𝑠𝑡
𝑅𝑒𝑔
(90%)
𝒑𝒐𝒖𝒕 6. S08
𝐶𝑖𝑟𝑐𝑢𝑖𝑡
𝑖ef9
𝑣: = 0
𝑣: = 0
Efficiency≈ 0.9 $ 0.66soabout60%
17
3/21/17
UsingLessPower
Sleep
• Evenifit’snot“doinganything”,akadelay(100),
themicrocontrollerconsumesenergy
• JustfrombeingON(Staticdissipation)
• Andeveryclockcycle(Dynamicdissipation)
• Wecansaveenergyby
•
•
•
•
•
Loweringsystemvoltage
Loweringoperatingfrequency*
Disablingclocktoregionsofchip
Sleepingcore
Using“backup”
𝑃~𝑉 ‡ 𝑓
*DoubleEdged-SwordThough…tooslowandstaticpowerconsumptioncanstarttodominate
18
3/21/17
Sleep
• ARMCortexspecifies3powermodes
• Freescale(nowNXP)K20microcontrollerbreaks
themdowninto13differentpowermodes
CortexM4
Freescale/NXPK20
microcontroller
Teensy
Sleep
• 13differentpowermodes
• Normal
• Run:normalmode
• Wait:CPUcoreinsleep
• Stop:CPUcoreindeepsleep
• VeryLowPower(VLP)
• Run,Wait,Stop
• Runscoreatlowerfrequency(4MHz)
• Low-leakagestop(LLS)
• LLS,VLLS3,VLLS2,VLLS1
• Disableorshutdownperipherals
• LessandlessSRAMon
• BAT(batterybackup)
• Uses32kHzreal-timeclock(RTC)to
keeptime
Mode
Typicalcurrent
(@3.0V)
Run
34mA
Run(peripheral
clocksstopped)
30mA
Wait
12.5mA
Stop
0.35mA
VLPR
1.46mA
VLPW
0.61mA
VLPS
5.9 µA
LLS
2.6µA
VLLS3
1.9µA
VLLS2
1.59µA
VLLS1
1.47µA
BAT
0.19µA
19
3/21/17
Sleep
• Choosethelowestsleepthatretainsfunctionality
• Forexample,canstilldoUART,I2C,ADCinsomesleepmodes
Sleep
• Alsoconsidertime-to-wakeup
• Deepersleepusuallymeanslongerwake-up
• EspeciallyifyoushutdownoscillatorsorsaveSRAMtoFlash
Deepersleep
• Takestimetostartuposcillatorsandre-loadSRAM
20
3/21/17
Dutycycling
• Thekeytoalonglifeissleep!
• Example
• FreescaleK20
• BATmode0.19µA
• Runmode34mA
𝑑𝑢𝑡𝑦𝑐𝑦𝑐𝑙𝑒 =
𝑡Š‹
𝑡Š‹
=
𝑇
𝑡Š‹ + 𝑡>@ŒŒ•
• Wanttorun1monthoncoincell(200mAh)
• IftON=1sec,whatisminimumT?
T
tON
tSLEEP
time
Dutycycling
• Thekeytoalonglifeissleep!
• Example
• FreescaleK20
• BATmode~0.19µA
• Runmode34mA
• Wanttorun1monthoncoincell(200mAh)
• IftON=1sec,whatisminimumT?
• 720h/mo è 0.28𝜇𝐴 maxaveragedraw
i
34𝑚𝐴
<
+
<•i
0.19𝜇𝐴
<
= 0.28𝜇𝐴 ⇒ 𝑇~6𝑚𝑖𝑛
21
3/21/17
Dutycycling
• Greatforinfrequentevents
•
•
•
•
Monitoringtemperature,humidityinroom
Wildfiremonitoringinfield
Corrosioninpipelines
Etc.
Asynchronousevents
• Allofourcodethusfarisin
repeatedloops
•
•
•
•
Measureorientationevery50ms
ReadGPSevery10sec
Senddataevery10sec
Etc.
• Thislimitsresponsiveness
• Canbeupto50ms fromsensing
input
• Andlimitssleep
• Cannotsleeplongerthan50ms!
• Eveniforientationhasn’t
changed,orGPSisthesame,etc.
22
3/21/17
Asynchronousevents
• Alternativelycoulduse
interrupts
• Runsapieceofcode
asynchronously
• Suchasinresponsetoabutton
press,accelerometerthreshold,
datainUART,etc.
• Wewillnotuseinterrupts
explicitlyin6.S08
• Thoughtheyareinseveralofour
libraries
• ButifyoucontinueinIoT,
microcontrollers,etc… youwill
wanttolearnthem!
Energy-efficientmicrocontrollers
• Increasingimportanceofenergyefficiencyhasgiven
risetomicrocontrollerswithever-lowerpowerusage
• FreescaleK20
• Run:472µA/MHz
• BAT:190nA
• SiliconLabsEFM32Gecko
• Run:180µA/MHz
• Shutoff:20nA,160µsec wakeup
• ATMELSAML21
• Run:95 µA/MHz(downto35µA/MHZ)
• Deepsleep:200nA
23
3/21/17
Communications
• WiFi modulealsosleeps
• Innormaloperation,sleeps
andwakesperiodically
whenconnectedtoAP
Transmit
• Wakestomaintain
connectiontoAP
• WakeintervalcalledDTIM
DTIM
• ~100’sms
• ChallengeswithESPare:
• deepsleeprequires
reconnectionwithAP
• Maxcurrentsarehigh(170
mAormore)
http://jeelabs.org/book/1526f/
IDLE
Low-powerwireless
• BluetoothLowEnergy(BLE),
Zigbee,etc.arespecifically
designedforlowpowerusage
• Lowerpeakcurrent
• Fastwakeupandauthenticate
• Briefheaders
• Lookintoforfinalprojects
maybe
24
3/21/17
HarvestingEnergyfrom
Environment
Energyharvesting
• Couldalsoscavengeenergyfromenvironment
• Solar
• Heat
• Mechanical
• Usetopowersystemdirectlyorrechargebattery
• Useasenergycomesin
• Storeenergyfromtimesofplentyanduselater
• Potentially“limitless”lifetime
25
3/21/17
Energyharvesting
• Solarphotovoltaic
• Photonsturnintocurrentin
asemiconductor(usuallySi)
• Generatevoltage~0.7V
• Canbeincreasedbystacking
cellsinseries
• Currentincreaseswithon
area
• Outputdependsonincident
lightintensity!
2.2inchesdia
5V@40mA
https://www.adafruit.com/products/700
http://electronicdesign.com/content/content/73937/73937-fig2.gif
Energyharvesting
• Thermo-electricgenerator
• Thermoelectricmaterial
convertstemperature
differenceintovoltage
40Ktempdifference
1.8V@368mA
https://www.adafruit.com/products/700
http://electronicdesign.com/content/content/73937/73937-fig2.gif
26
3/21/17
Systemdesignissues
• Inaconnectedsystem,canchoosewhattodo
locallyversusserver-side
• Tradeoff
• communicationspowervs.CPUpower
• Limitedlocalstoragevs.infiniteserverstorage
27