AN310 Energy optimization of a battery-powered device

Similar documents
Keysight Technologies Precise Current Profile Measurements of Bluetooth Low Energy Devices using the CX3300. Application Brief

A Solar-Powered Wireless Data Acquisition Network

Hello, and welcome to this presentation of the STM32L4 comparators. It covers the main features of the ultra-lowpower comparators and some

Debug and Analysis Considerations for Optimizing Power in your Internet of Things Design

The Mote Revolution: Low Power Wireless Sensor Network Devices

SAME 2013 Conference BLUETOOTH SMART LOW POWER SENSORS. Atef AL NUKARI, Pascal CIAIS, Insight SiP. Sophia-Antipolis, France

Low Power Microphone Acquisition and Processing for Always-on Applications Based on Microcontrollers

Making Sense of Wireless Sensor Power Consumption. Steven Lee Application Engineer

1. Introduction...Page Scope...Page Bluetooth Low Energy Wireless sensor nodes...page 2

EITF40 Digital and Analogue Projects - GNSS Tracker 2.4

FOR the wireless sensor network (WSN), one of the most

Datasheet. Tag Piccolino for RTLS-TDoA. A tiny Tag powered by coin battery V1.1

RX23T inverter ref. kit

TRF7960TB HF RFID Reader Module

Preliminary. 4-Channel RTD/4-20 ma Wireless Sensor Node SN24R420-4

Bridge Measurement Systems

AP CANmotion. Evaluation Platform with BLDC Motor featuring XC886CM Flash Microcontroller Version 2007/10. Microcontrollers

Power Consumption Measurement Techniques

Pixie Location of Things Platform Introduction

MEMS Oscillators: Enabling Smaller, Lower Power IoT & Wearables

CX3300 Series Device Current Waveform Analyzer

Keysight Technologies Accelerate Debug And Evaluation Of IoT Devices By Current Profile Analysis. Application Note

1 Chrono methods. The term Chrono methods includes all the measurements of electrochemical signals during a well-defined sequence of steps.

Designing with STM32F3x

BlueMesh: Mesh topology for smart home and smart building

Lab 1.2 Joystick Interface

12/31/11 Analog to Digital Converter Noise Testing Final Report Page 1 of 10

Figure 1. LDC Mode Operation Example

Touch Sensor Controller

The Mote Revolution: Low Power Wireless Sensor Network Devices

Intelligent and passive RFID tag for Identification and Sensing

Optimal Clock Synchronization in Networks. Christoph Lenzen Philipp Sommer Roger Wattenhofer

Beacon Indoor Navigation System. Group 14 Andre Compagno, EE. Josh Facchinello, CpE. Jonathan Mejias, EE. Pedro Perez, EE.

Cortex-M3 based Prepaid System with Electricity Theft Control

CHAPTER IV DESIGN AND ANALYSIS OF VARIOUS PWM TECHNIQUES FOR BUCK BOOST CONVERTER

White Paper Kilopass X2Bit bitcell: OTP Dynamic Power Cut by Factor of 10

Tel: Fax: Web:

INTRODUCTION. What is the LSN50

Application Note AN-1199

32-bit ARM Cortex-M0, Cortex-M3 and Cortex-M4F microcontrollers

Transient Current Measurement for Advance Materials & Devices

Triscend E5 Support. Configurable System-on-Chip (CSoC) Triscend Development Tools Update TM

Hello, and welcome to this presentation of the STM32G0 digital-to-analog converter. This block is used to convert digital signals to analog voltages

FAN5602 Universal (Step-Up/Step-Down) Charge Pump Regulated DC/DC Converter

Hardware Platforms and Sensors

AN0504 Tag Design with swarm bee LE

University of Jordan School of Engineering Electrical Engineering Department. EE 204 Electrical Engineering Lab

DATASHEET SMT172. Features and Highlights. Application. Introduction

Roland Kammerer. 13. October 2010

Sensors Fundamentals. Renesas Electronics America Inc Renesas Electronics America Inc. All rights reserved.

DC Motor and Servo motor Control with ARM and Arduino. Created by:

Active RFID System with Wireless Sensor Network for Power

A Time-Saving Method for Analyzing Signal Integrity in DDR Memory Buses

APPLICATION NOTE. ATA6629/ATA6631 Development Board V2.2 ATA6629/ATA6631. Introduction

Product Datasheet P MHz RF Powerharvester Receiver

Energy harvester powered wireless sensors

Rohde & Schwarz EMI/EMC debugging with modern oscilloscope. Ing. Leonardo Nanetti Rohde&Schwarz

Low Power with Long Range RF Module DATASHEET Description

DATASHEET. SMT172 Preliminary. Features and Highlights. Application. Introduction

6. HARDWARE PROTOTYPE AND EXPERIMENTAL RESULTS

DEMO CIRCUIT 1461A QUICK START LTC3616 GUIDE LTC A, 4MHz, MONOLITHIC SYNCHRONOUS DC/DC STEP-DOWN CONVERTER DESCRIPTION

Electrical current measurement system for energy harvesting applications

Using an MSO to Debug a PIC18-Based Mixed-Signal Design

Catalog

Round shape, white case with 3M adhesive sticker, including 2pcs ER12450 battery and industrial package, special for indoor location, RoHS

Characteristic Sym Notes Minimum Typical Maximum Units 2, 3 or 4-wire 100 ohm Platinum RTD Sensor Inputs

DIO6010 High-Efficiency 1.5MHz, 1A Continuous, 1.5A Peak Output Synchronous Step Down Converter

The sensor network targeted for temperature and humidity monitoring within buildings, based on the BMS architecture

The ilab Experience. Smart Space Orchestration (s2o) Part I: Hardware Nov 29, you set the focus. a blended learning hands-on course concept

MicroMag2 2-Axis Magnetic Sensor Module

ECU with emulated partial networking functionality

MAXREFDES73#: WEARABLE, GALVANIC SKIN RESPONSE SYSTEM

Course Introduction. Content: 19 pages 3 questions. Learning Time: 30 minutes

Gate Drive Optimisation

Energy Harvester Produces Power from Local Environment, Eliminating Batteries in Wireless Sensors Michael Whitaker

Cortex-M3 based Prepaid System with Electricity Theft Control

High Performance Laser Diode Driver

Brian Hanna Meteor IP 2007 Microcontroller

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Lab Timer: Blinking LED Lights and Pulse Generator

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC 180A DIGITAL SYSTEMS I Winter 2015

IOT Based Intelligent Traffic Signal and Vehicle Tracking System

Turn-Off Characteristics of SiC JBS Diodes

INF8574 GENERAL DESCRIPTION

EEE118: Electronic Devices and Circuits

Project Name: SpyBot

2520 Pulsed Laser Diode Test System

ZigBee Wireless Sensor Nodes with Hybrid Energy Storage System Based On Li-ion Battery and Solar Energy Supply

Purpose. Table of Contents. Purpose...1. Introduction...2. General Product Information...2. Key Performance Summary Table...3

PNI MicroMag 3. 3-Axis Magnetic Sensor Module. General Description. Features. Applications. Ordering Information

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Application Circuits 3. 3V R2. C4 100n G PI O. 0 G PI O S e t u p d a ta G PI O. 5 G PI O M o t i o n I n t G PI O. 4 G PI O.

PN5180 The best full NFC frontend on the market

Basic Logic Circuits

Revision History. Rev. No Issued Date Page Description Summary. V Initial Release

Dual-Axis, High-g, imems Accelerometers ADXL278

Effects of Initial Conditions in a DRSSTC. Steven Ward. 6/26/09

Figure 1. Low Voltage Current Sense Amplifier Utilizing Nanopower Op-Amp and Low-Threshold P-Channel MOSFET

Optimize Wireless Device Battery Run-time

NFC Readers Easy Implementation in Challenging Environments. Dan Merino Application Engineer

Training Schedule. Robotic System Design using Arduino Platform

Transcription:

Energy optimization of a battery-powered device AN 310, May 2018, V 1.0 feedback@keil.com Abstract Optimizing embedded applications for overall efficiency should be an integral part of the development process as it is important to understand how peripherals, software algorithms, and power saving modes work together. This application note describes the power consumption analysis of an L-Tek FF1502 Bluetooth Low Energy (BLE) beacon with ULINKplus. Beacons are typically low power devices, which sleep most of the time and wake-up briefly to broadcast a message to nearby portable electronic devices (such as mobile phones for example). We ll show how to analyze the battery lifetime of an application running on the beacon by using the ULINKplus debug adapter that enables high-precision power analysis together with Arm Keil MDK. The findings are used to improve the hardware design and to implement software changes that lead to reduced power consumption and longer battery life. Contents Abstract...1 Summary...2 FF1502 a Bluetooth Low Energy beacon...3 Application...3 Measurement setup...3 Reference design...4 Triggering sensors...4 Reading sensor data...5 Broadcasting...6 Sleeping...7 Software investigations...8 Redesigned software...8 Triggering sensors...9 Reading sensors... 10 Broadcasting... 10 Sleeping... 10 Hardware investigations... 11 Battery life calculation... 13 Conclusion... 13 1

Summary In this application note, we show how to use ULINKplus to dramatically reduce the power consumption of a battery-driven IoT application. Using this versatile debug probe together with the latest debug features of µvision, it is possible to increase the battery lifetime from just under a year (358 days) to nearly two and a half years (863 days). Figure 1 shows the power profile of the original HW and SW design. The active time of the application is 51 ms and requires a total charge of 131 µas. : Figure 1 Power measurement for the reference design After optimization, these values reduce dramatically. The overall active time is reduced to 38 ms and the required charge is only 31 µas as can be seen on Figure 2: Figure 2 Power measurement for the optimized hard- and software The next chapters explain the details about the application and the soft- and hardware changes that made this possible. 2

FF1502 a Bluetooth Low Energy beacon The L-Tek FF1502 is a Bluetooth Low Energy (BLE) based sensor tag which operates as a broadcaster, i.e. beacon. Beacons are typically low power devices which sleep most of the time and wake-up briefly to broadcast a message to nearby portable electronic devices (such as mobile phones for example). The small form factor and XBee compatible pin-out make the FF1502 a perfect building block for IoT end node applications. The device can be powered by a single CR2032 coin cell battery or via USB. It is based on the Nordic nrf51822 microcontroller (Arm Cortex-M0-based) with an integrated Bluetooth radio. Various sensors are connected to the microcontroller via I2C: temperature & humidity (Si7020-A20) light (BH1750) accelerometer (MMA8653FC) gyroscope (FXAS21002C) magnetometer (MAG3110)). The USB connector and CR2032 battery are connected to a DC/DC switch which provides power to the complete circuit (including the capacitor network). Application While running, the application idles most of the time with the MCU and all sensors being in low power mode. Every ten seconds, the device wakes-up and reads the sensor data (temperature/humidity/light). This data is then broadcasted via BLE. Then, the device goes back to sleep again. Measurement setup Figure 3 FF1502 block diagram The ULINKplus debug adapter supports shunt-based power measurement. In this setup, ULINKplus measures the battery voltage and total current provided to the device. A 33.2 Ohm external shunt (10 ma range) is used for measuring during application execution, while only the ULINKplus internal shunt (2.5 ma range) is used for measuring the MCU s low power mode. Using the internal shunt in active mode results in a voltage drop that is too large for the MCU to run. All measurements are done in the new Energy Measurement without Debug mode of µvision. This mode is specifically useful for low-power targets as the debug circuitry and connection consume additional energy that is skewing the measurement results in the standard debug mode. In the Energy Measurement without Debug mode, the Arm CoreSight unit within the microcontroller is not active and thus only the energy of the application is measured. The System Analyzer window in the µvision IDE displays timing and energy information alongside to the markers and cursors in the current and voltage lines. ULINKplus offset calibration for very low current measurements Before starting to measure the currents, you need to calibrate your set up. The ULINKplus user s guide (available at www.keil.com/-fos) explains how to do this. 3

Reference design In the following, the original hardware and software design is called "reference design". The initial power measurement (see Figure 1) shows a power intensive active cycle (with a duration of 51 ms) which is repeated periodically (every ten seconds). According to µvision s System Analyzer, the total electrical charge for the active cycle is: Q ref_active = 131 µas The cycle can be divided into the following phases: triggering sensors over the I2C bus to start a single measurement reading sensor data over the I2C bus broadcasting the sensor data over BLE sleeping before and after Triggering sensors Sensor measurement is triggered by issuing commands over the I2C bus and waiting until the data is ready. Figure 4 Power consumption profile on the reference design when triggering on-board sensors There is a 4.2 ma current spike at the beginning when the MCU is running at full speed (48 Mhz), communicating over I2C. This is expected since 4 ma is the typical MCU run current (according to the MCU's datasheet). After that, the MCU should wait for around 20 ms in low power mode. The expected current is around 300 µa which is the current required by the sensors during measurement (according to the sensor datasheets). Therefore, the actual current of around 1.6 ma seems to be too high and should be investigated. The total electrical charge for triggering sensors according to the reading in µvision s System Analyzer is: Q ref_triggersensors = 32.2 µas 4

Reading sensor data Sensor data is read over I2C in polling mode. Figure 5 Power consumption profile on the reference design when reading sensor data The MCU is active during the entire read process which matches the measured average current of 4.6 ma. However, the whole read process takes about 19 ms which seems to be long due to the small amount of executed I2C transfers. Therefore, the read time needs to be investigated and it should also be considered to use event-driven I2C communication rather than polling mode. Total electrical charge for reading sensors: Q ref_readsensors = 81 µas 5

Broadcasting Sensor data is broadcasted using the Bluetooth Low Energy (BLE) protocol. Figure 6 Power measurement profile on the reference design while broadcasting data First, the active MCU prepares the data and configures the BLE. This explains the first smaller current spike. After that, BLE broadcasts the data over 3 channels. This explains the three similar 10 ma current spikes. Total electrical charge for broadcasting: Q ref_broadcast = 17.8 µas 6

Sleeping After the data has been broadcasted, the MCU and all sensors go back to low power mode and should draw as little current as possible. Figure 7 Power measurement profile on the reference design during sleep phase The entire system is powered by a battery. However, it is not connected directly, but through a DC/DC switcher (which has a better efficiency than a linear regulator). The switcher introduces current pulses with an average 4.9 ms period. The residual 4.5 µa current seems strange and should be investigated. Total electrical charge for a single pulse: Q ref_sleeppulse = 67 nc Average pulse period: t ref_sleeppulse = 4.9 ms Average current during sleep: I ref_sleep = Q ref_sleeppulse / t ref_sleeppulse = 13.7 µa The expected sleep current is around 8 µa (total for all chips: MCU, sensors, DC/DC switcher). The actual sleep current is roughly 5 µa higher (same as the residual value) and should be investigated. 7

Software investigations Unexpected high current during sensor trigger phase Due to a bug in the software, an extra I2C write operation was issued which lead to increased sensor current. After removing that code, the current dropped from around 1.6 ma to the expected 300 µa during the sensor trigger phase. This reduces the electrical charge for the Triggering Sensors phase from 32 µc to 6.5 µc. Long I2C transfer time during sensor read phase The long I2C transfer time was caused due to the same software bug which not just increased the sensor current but also caused I2C clock stretching by the sensor. The read phase is drastically shortened after removing the extra I2C write. This significantly reduces the electrical charge for the Reading sensor data phase from 81 µc to just 7.3 µc. Event-driven I2C transfers vs. polling mode Using event-driven I2C transfers enables the MCU to go to sleep while waiting for the I2C transfer to complete (rather than running at full power while polling the I2C transfer state). This further reduces the required current during the Reading sensor data phase. However, the impact is small due to the already shortened I2C transfer time. Redesigned software The software of the reference design was updated based on findings from the software investigations. The I2C write operation bug was fixed and event-driven communication was introduced. The newly measured power profile shows the updated power intensive cycle (which is much shorter now with 38 ms): The total electrical charge for the active cycle is now: Q active = 31 µas Figure 8 Power measurement profile after software redesign 8

Triggering sensors Triggering the sensors and waiting until data is ready takes the same times as in the reference design. However, the current during measurement is much smaller (264 µa instead of 1.5 ma) due to a smaller sensor current: Total electrical charge for triggering sensors: Q triggersensors = 6.2 µas Figure 9 Power measurement profile for triggering sensors after software redesign 9

Reading sensors Reading the sensor data is much faster than in the reference design due to removed clock stretching (3 ms instead of 19 ms): Figure 10 Power measurement profile for reading sensors after software redesign The total electrical charge for reading sensors is: Q readsensors = 6.6 µas Broadcasting The broadcasting phase has not changed in comparison to the reference design. Sleeping The sleeping phase has not changed in comparison to the reference design. Average current during sleep: I sleep = 13.7 µa 10

Hardware investigations The Sleeping phase measurements show an average current of 13.7 µa which is higher than the expected 9 µa (based on the datasheets). To isolate the problem, the application was modified so that the MCU immediately entered low power mode without any other functionality (no sensor read or BLE broadcast). In this mode, current pulses occur with an average 4.9 ms period (same as in the application). The residual 5 µa current still exists. The total electrical charge for a single pulse is: Q test_sleeppulse = 67 nas Average pulse period: t test_sleeppulse = 4.9 ms Average current during sleep: Figure 11 Power measurement profile for the sleeping phase before optimization I test_sleep = Q test_sleeppulse / t test_sleeppulse = 13.7 µa Despite the slightly smaller peaks, the pulses are a bit wider and carry the same electrical charge. So, the average sleep current for the application or the low power test is the same (DC/DC switcher and the capacitor network only influence the waveforms but not the average value). 11

To investigate further, the off state of test application has been measured: Figure 12 Power measurement profile for the "off" state The expected current is zero. However, the actual measured current is 4.9 µa. This hints to a hardware issue which is addressed in the hardware redesign. Hardware redesign The hardware design was analyzed to determine the source of the additional 5 µa current consumption. The analysis showed that this was caused by the reverse current of the protection diode D2. Figure 13 Original schematic Replacing the original D2 diode PMEG4005EJ with PMEG6010CEH almost eliminates this current (< 0.2 µa). This leads to an average current during sleep: I sleep = 8 µa 12

Battery life calculation The FF1502 runs from a CR2032 battery with the following capacity: C battery = 230 mah The FF1502 samples and broadcasts sensor values every 10 seconds: t broadcast_interval = 10 s Reference design I ref_active = (Q ref_active - I ref_sleep * t ref_active ) / t broadcast_interval = 13.8 µa I ref_total = I ref_sleep + (Q ref_active / t broadcast_interval ) I ref_total = 13.7 µa + (131 µas / 10 s) = 26.8 µa t ref_batterylife = C battery / I ref_total = 358 days Redesigned software and hardware Q active = 31 µas I total = I sleep + (Q active / t broadcast_interval ) I total = 8 µa + (31 µas / 10s) = 11.1 µa t BatteryLife Conclusion = C battery / I total = 863 days Today you can find a rich portfolio of Cortex-M based microcontroller devices. Well suited for low-power and battery operation, these devices combine fast computing and comprehensive peripherals with multiple power saving modes. Optimizing embedded applications for overall efficiency should be an integral part of the development process as it is important to understand how peripherals, software algorithms, and power saving modes work together. To simplify this task, we developed ULINKplus, a universal debug and trace adapter that supports power measurement. Together with Keil MDK, this debug unit gives you unparalleled insight into the operation of your microcontroller applications. It shows which parts of the application code consume more power and helps you to verify the usage of low-power configurations. ULINKplus is designed for software engineers and is easy to connect to the target hardware. Compared to oscilloscopes, it does not require complex configuration settings and shows a higher dynamic range allowing you to spot small current differences. It even synchronizes the power measurement data with the program execution information when using trace or event annotations. In this example, we demonstrated that the overall energy used by an existing application can be well optimized through improvements to software and hardware. The original battery life was more than doubled as a result of optimization. 13