You are on page 1of 18

GS-AN008

Measuring SOC Power Consumption

INTRODUCTION

describes a method for measuring the typical power consumption of a Sensor Node based on the GainSpan System-On-Chip (SOC), currently exemplified by the GS1011. The measurements described here use the GainSpan MIP or MEP Evaluation Boards (EVK). These boards are GainSpan SOC reference designs that can be powered by two 1.5V AA-sized batteries. They include all of the peripheral circuitry required to power and clock the SOC, as well as on-board light and temperature sensors. The MIP EVK board uses the SOCs internal RF power amplifier for its 802.11 radio, while the MEP EVK board adds an external RF power amplifier. Both of these boards can be used with a small 2.4 GHz whip antenna attached to their RF connector. Using either of these boards and the TLS and Serial 2 WiFi reference firmware applications simplifies measurement of both Standby and Operating power consumption.
HIS DOCUMENT

GAINSPAN SOC POWER MANAGEMENT STATES


The power consumption of the EVK boards is dominated by that used by the SOC itself. The current consumed by the SOC depends on what exactly its various system components are doing. Note that the SOC Standby and Deep Sleep states are distinguished from other states by the deactivation of the highspeed 44 MHz reference clock, which both saves power in the clock oscillator and terminates high-speed switching in the remainder of the chip. In the Standby state, only the low-frequency (32 kHz or 131 kHz) RTC module and associated circuitry are operating, and power consumption is greatly reduced. Power consumption is computed by multiplying measured voltage and current. Current consumption is typically measured by placing a small current measuring resistor in series with the power supply. This resistor must be scaled appropriately to provide enough gain to measure the current with sufficient accuracy, while at the same time, not dropping enough voltage to affect the experiment. The current consumption of the GainSpan GS1011 SOC varies over 5 orders of magnitude (from 5 A to 100 mA) since different methods being used for measuring Standby, Deep Sleep and operating current. The methods to be used for performing measurements of each of these current draws are provided by the following sections of this document.

GS-AN008

PAGE 1 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

Measuring Standby Current


To measure standby current, an ammeter is placed in series with the DC Power Supply (Figure 1). This ammeter must be set to measure currents in the A range. The standby current can then be directly read from the ammeter display when the GS1011 is in the Standby state.

Figure 1: Experimental setup for measuring EVK board Standby current.

GS-AN008

PAGE 2 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

To perform this experiment, set up the experimental apparatus as follows: 1. Configure the EVK Board with GainSpan Serial to WiFi (S2WiFi) Application Firmware (AFW), as provided with the Evaluation Kit. Loading of the Serial 2 WiFi firmware can be done under battery power. When complete, remove the battery. 2. Set the DC supply output voltage to 3.6V. Set the current limit to 500 mA. 3. Turn off the DC supply. 4. Set the jumpers and connectors of the EVK board as shown in the following table:

Jumper J4 J6

Setting Pins 2 and 3 connected together (through jumper) Pins 2 and 3 connected together (through jumper) Disconnected

Description DB9 disabled. Standby (DC_DC CNTRL disconnects components when GS1011 goes into standby mode). No external power source connected through here (power supply connected through battery compartment). GS1011 module connected voltage regulator on board. to

J7

J8 J9 J10

Pins 1 and 2 connected together (through jumper) Pins 2 and 3 connected together (through jumper) Disconnected (no jumper)

External battery compartment used as battery source. No SPI Select

5. Connect the positive rail of the DC power supply to the positive (+) battery terminal right below the DB9 connector of the EVK board. 6. Connect the negative rail of the DC power supply to the COM terminal of the ammeter. 7. Connect the negative () battery terminal right below the DB9 connector of the EVK board to the current-measuring input of the ammeter. If there are multiple current measuring inputs, choose the one that measures currents in the mA or A range. 8. To correct for any voltage drop in the ammeter or connections, connect a voltmeter across the battery terminals. 9. Turn on the DC supply.

GS-AN008

PAGE 3 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

10. Connect the EVK board to your computer through a USB to UART cable and, through a serial terminal program such as Teraterm, HyperTerminal or Putty. Issue the following command to the Serial 2 WiFi firmware on the board: AT+PSSTBY=99999 This will set the board into standby mode for a period of 99,999 milliseconds, which will provide enough time for the ammeter and voltmeter measurements to settle. 11. The voltmeter should read only slightly less voltage at the EVK board battery connector than the DC Supply Voltage setting. The typical value for EVK board Standby current (regardless of whether it is an MIP or MEP board), when powered from a 3.6-V DC Supply is 8 A, which implies P = V x I = 3.6 x 8 A = 28.8 Watts. Note that with a typical AA battery capacity of around 2,000 mA-h, with this current drain, the board could be supported for 250,000 hours, or more than 28 years that is, the Standby current consumption is so small that it is quite negligible compared to ordinary battery leakage.

Measuring Deep Sleep Current


To measure deep sleep current, the same physical setup as for measuring standby current will be used (See Figure 2). For this measurement, the ammeter must also be set to measure currents in the A range. The deep sleep current can then be directly read from the ammeter display when the GS1011 is in the deep sleep state.

Figure 2: Experimental setup for measuring EVK board Deep Sleep current.

GS-AN008

PAGE 4 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

To perform this experiment, set up the experimental apparatus as follows: 1. Configure the EVK Board with GainSpan Serial to WiFi (S2WiFi) Application Firmware (AFW), as provided with the Evaluation Kit. Loading of the Serial 2 WiFi firmware can be done under battery power. When complete, remove the battery. 2. Set the DC supply output voltage to 3.6V. Set the current limit to 500 mA. 3. Turn off the DC supply. 4. Set the jumpers and connectors of the EVK board as shown in the following table: Jumper J4 J6 Setting Pins 2 and 3 connected together (through jumper) Pins 2 and 3 connected together (through jumper) Disconnected Description DB9 disabled. Standby (DC_DC CNTRL disconnects components when GS1011 goes into standby mode). No external power source connected through here (power supply connected through battery compartment). GS1011 module connected voltage regulator on board. to

J7

J8 J9 J10

Pins 1 and 2 connected together (through jumper) Pins 2 and 3 connected together (through jumper) Disconnected (no jumper)

External battery compartment used as battery source. No SPI Select

5. Connect the positive rail of the DC power supply to the positive (+) battery terminal right below the DB9 connector of the EVK board. 6. Connect the negative rail of the DC power supply to the COM terminal of the ammeter. 7. Connect the negative () battery terminal right below the DB9 connector of the EVK board to the current-measuring input of the ammeter. If there are multiple current measuring inputs, choose the one that measures currents in the mA or A range. 8. To correct for any voltage drop in the ammeter or connections, connect a voltmeter across the battery terminals. 9. Turn on the DC supply. 10. Connect the EVK board to your computer through a USB to UART cable and, through a serial terminal program such as Teraterm, HyperTerminal or Putty . Issue the following command to the Serial 2 WiFi firmware on the board: AT+PSDPSLEEP This will set the board into deep sleep mode.

GS-AN008

PAGE 5 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

11. The voltmeter should read only slightly less voltage at the EVK board battery connector than the DC Supply Voltage setting. The typical value for an EVK board deep sleep current will be a little bit lower than 200 A. The observed power consumption for an EVK board will thus be: P = V x I = 3.6 V x 200 A = 900 Watts For MEP EVK boards, it should be noted that deep sleep current measurements for these boards should be carried out with WFW firmware 2.0.24 included in GEPS 2.2.10 release or later to obtain the optimized deep sleep current. Older firmware, such as the WFW-2_0_21.bin provided with GEPS 2.2.4 will show deep sleep current draws of 2 mA with MEP EVKs.

GS-AN008

PAGE 6 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

Measuring Operating Current


The first task in measuring typical operating current is defining what exactly is meant by this phrase. In this document, we define typical operating current as the average current consumed during the period of time when the EVK board has awakened from Standby to do the following things: Case 1: For a data transmission period: 1. Boot the system 2. Take a temperature sensor measurement 3. Take a light sensor measurement 4. Take a Vdd_rtc voltage measurement 5. Package data into a Data Message 6. Send the Data Message to the Data Sink (typically on the Host computer) using UDP/IP; 7. Go to Standby. Case 2: For an open security association period: 1. Boot the system 2. Perform an active scan for the AP to which the client intends to associate (by transmitting a probe request and waiting for the probe response from the AP) 3. Transmit authentication and association frames to the AP and wait for the corresponding frames from the AP

4. Go to Standby. Case 3: For a WPA2 security association period: 1. Boot the system 2. Perform an active scan for the AP to which the client intends to associate (by transmitting a probe request and waiting for the probe response from the AP) 3. Transmit authentication and association frames to the AP and wait for the corresponding frames from the AP

4. Perform EAPOL key packet exchange with AP to establish secure link with it 5. Go to Standby.

GS-AN008

PAGE 7 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

This experiment assumes that:


For both the data transmission and WPA2 association period measurements, the EVK board has

already cold booted at least once, to perform one-time initializations.


For the data period measurements only, the EVK board has done the following

Scanned for, authenticated to, and associated with a WLAN. Obtained an IP address either statically or through DHCP. Discover a route to the Data Sink using ARP.

The experimental setup is shown in Figure 3. A two-channel oscilloscope is used to monitor the instantaneous current and voltage provided to the EVK board. Since events of interest take place on millisecond time scales, the scope does not need to be particularly fast, but the ability to capture and analyze the acquired data is essential.

Figure 3: Experimental setup for measuring EVK board operating current.

GS-AN008

PAGE 8 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

To perform an accurate measurement of operating current: 1. Configure the EVK Board with GainSpan TLS Application Firmware (AFW), as provided with the Evaluation Kit. Configure the WLAN Access Point and Host computer as recommended in the Evaluation Kit User Manual [1]. Configuration can be done under battery power. When complete, remove the battery. 2. Set the DC supply output voltage to 3.6V. Set the current limit to 500 mA. If the DC supply has optional grounding, ground the negative () terminal to avoid current flow between the scope and supply ground connections. 3. Turn off the DC supply. 4. Set the jumpers and connectors of the EVK board as shown in the following table: Jumper J4 J6 Setting Pins 2 and 3 connected together (through jumper) Pins 2 and 3 connected together (through jumper) Disconnected Description DB9 disabled. Standby (DC_DC CNTRL disconnects components when GS1011 goes into standby mode). No external power source connected through here (power supply connected through battery compartment). GS1011 module disconnected from 3.3V voltage regulator on board. External battery compartment used as battery source. No SPI Select

J7

J8

Pins 1 and 2 disconnected GS1011 module disconnected from voltage regulator (remove jumper from J8) Pins 2 and 3 connected together (through jumper) Disconnected (no jumper)

J9 J10

5. Connect the positive rail of DC power supply to the positive (+) battery terminal of the EVK board that is right under the DB9 connector of the board. 6. Connect the positive rail of DC power supply to pin 2 of connector J8 of EVK board (the pin in connector J8 that is closest to the GainSpan MEP or MIP module). 7. Connect the negative rail of the DC power supply to a 1 resistor with a power rating of at least 5 Watts. This will typically be a leaded resistor or a decade box set to 1. 8. Connect the EVK Board negative () battery terminal that is right under the DB9 connector of the board to the other terminal of the resistor.

GS-AN008

PAGE 9 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

9. Attach the channel 1 oscilloscope probe across the 1 resistor. The ground connector of this probe must be connected to the DC power supply ground side (the negative terminal from step (1) above), and the probe tip connected to the EVK Board side. 10. To correct for any voltage drops in the resistor or connectors, connect the channel 2 scope probe tip to the EVK Board + battery terminal. DO NOT ATTACH THE GROUND CONNECTOR OF THIS SCOPE PROBE TO THE EVK BOARD BATTERY TERMINAL! Doing so will short out the channel 1 probe. 11. Optionally, connect a third probe (channel 3) to the DC_DC_CTL trace. To do this, simply connect the third oscilloscope probe to pin 3 of J6 on the EVK board. This trace shows the boundary between Standby and Operational Current. The EVK board is in Standby when this trace is low, and not in Standby when it is high. This makes a good trace on which to trigger. 12. Turn on the DC power supply. 13. Use GSDemo to read the GEPS Version field and close and re-open the MIB set/get window of GSDemo after doing so. This will populate all the available MIB elements for the SoC into GSDemo and allow you to configure it properly. 14. Use GSDemo to disable the LED in the EVK board by setting the App Power measurement Mode variable to 1 15. Use GSDemo to set the channel number and SSID settings for the AP to which the client will connect (if this hasnt been done before in point 1). 16. Use GSDemo to set LinkUp Trap Frequency to 0 (disabled) 17. Use GSDemo to set App Data Freq to 5 (5 seconds). 18. Use GSDemo to set Config Trap Frequency to 60 (60 seconds). 19. Reboot or power cycle the EVK. 20. With the above settings the SOC will wake up from Standby every 5 seconds to take sensor measurements and transmit them to the Data Sink (on the Host computer). 21. Either leave the oscilloscope free-running with a long capture period (5 seconds per division will be a good selection for this purpose), or configure the oscilloscope trigger on the DC_DC Ctrl line being fed into the oscilloscope Channel 3 (if done) so that it will start capturing at the moment the GainSpan chip comes out of standby. To do so, simply set the trigger to rising edge and set the triggers threshold to a voltage somewhere between a logic 0 and 1 to trigger the measurement when the DC_DC Cntrl line goes high and wakes up the SoC (1.25 V is a good selection for a trigger threshold for this purpose).

GS-AN008

PAGE 10 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

22. Configure the oscilloscope to the following settings:

Oscilloscope Channel No. 1

Signal measured on Oscilloscope channel Current drawn by board under test (voltage seen across 1 Ohm resistor)

Setting

50 mV per division 5 V per division 5 V per division

2 3 All

Input voltage to board under test DC-DC control trace

Timescale 5 seconds per division (50 seconds total across screen)

Trigger

Oscilloscope set to trigger off channel 3 using a threshold set to a voltage higher than 1 V (basically to trigger when a logic high voltage is seen on the DC-DC control trace).

23. Take a look at Channel 2, which shows the DC Supply voltage. Note that a regulated DC power supply will attempt to keep the supply voltage constant for a changing load. 24. Compute instantaneous current consumption, I = ch1/ 1. The total current consumption is the integral of the instantaneous current over the interval during which the board is active. 25. Compute the voltage across the EVK board. This voltage is the difference between channel 1 (current measuring resistor) and channel 2 (EVK board + terminal): V = ch2 ch1. To compute the power consumed during this operation, multiply the instantaneous current by the voltage across the EVK board: P = I * V = [ch1/ 1] * [ch2 ch1]. The energy consumed is the time integral of the instantaneous power over the period during which the node is active.

GS-AN008

PAGE 11 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

As a reference, the traces provided in this section of the application note were obtained with the above procedure and the following equipment: Oscilloscope: Access Point: GainSpan Evaluation Board: Agilent MS06034A Netgear WGR614 v9 with firmware version V1.2.2_14.0.13NA GS1011 EVB Rev 1.0 with either MIP or MEP module

GainSpan Wireless Firmware: 2.0.24 GainSpan Application software: GEPS 2.2.4 TLS Application Location of Evaluation Board And Access Point: The provided power profile curves were obtained with both the access point and evaluation board under test located inside of an RF enclosure

GS-AN008

PAGE 12 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

Figure 4 shows an oscilloscope measurement taken following the procedure described previously, with the current drawn by the GainSpan evaluation board shown in channel 1, the input voltage to the board shown in channel 2 and the DC_DC_control line shown in channel 3. Figures 5, 6 and 7 (on the following pages) will provide more details as to what is happening at each point in time for the duration of each of the following events within the TLS application: 1. Transmission of temperature and light sensor data in a UDP packet sent over the Wi-Fi link established between the EVK board and an access point. 2. Association of the EVK board to an access point in open security mode. 3. Association of the EVK board to an access point in WPA2 security mode. The measurements provided by figures 5, 6 and 7 do not include the DC_DC_Control line and Input voltage measurements as are shown in figure 4. This is done to be able to provide a cleaner pictorial description of each of the events that compose the full timeline for any of the TLS events (association or data transmission) in question.

Figure 4: Example of Operating Current measurement following provided procedure

GS-AN008

PAGE 13 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

In figure 5, the oscilloscope has captured the GS1011 running the TLS code at a point where a data trap occurs. At this point, the following sequence of events will occur: 1) The board will come out of standby, the DC_DC control line will be asserted high and a current spike will be seen for the 3.3 V regulator being turned on 2) The module will wait for close to 13 mSec for the 44 MHz crystal and for the voltage provided by the 1.8 V regulator to stabilize 3) The Green Hills real time operating system will boot up. 4) The TLS application will be started, running both CPUs at 22 MHz 5) The system will go into deep sleep mode for a period of 100 milliseconds to wait for the boards temperature and light sensors to stabilize. During this time, the full power 44 MHz oscillator is off. 6) The system will then wake up and wait for the 44 MHz crystal to stabilize 7) After the 44 MHz crystal is stable, the data from the temperature and light sensors will be read and, along with the modules RSSI (Received Signal Strength Indicator) and Vdd_RTC voltage will be placed into a UDP packet which is encapsulated in a Wi-Fi frame and readied for transmission over the Wi-Fi link. This UDP packet is 96 byte long, with a 32 byte payload and will be transmitted at 2 mbps using a long preamble. 8) The modules radio is powered-up and calibrated. 9) The UDP packet including sensor data, RSSI and Vdd_RTC voltage is transmitted over the Wi-Fi link to the access point for transport to the server. 10) The radio is left powered on in receive mode, awaiting reception of the MAC-layer ACK packet that corresponds to the transmitted UDP packet. 11) After reception, demodulation and decoding of the MAC-layer ACK frame, the TLS application saves the sequence number and required sensor data into RTC RAM and saves any modified configuration into flash memory (This is shown as Application Execution and Save State in figure 4). 12) After the systems state is saved in the previous step the module then goes back to standby mode and draws around 5 microamperes.

GS-AN008

PAGE 14 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

Figure 5: Oscilloscope capture showing a TLS application data trap period occurrence in an EVK MIP board

GS-AN008

PAGE 15 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

The events occurring during open security and WPA2 association periods are shown below respectively by figures 6 and 7. Each of the two shown oscilloscope screenshots provides a brief description of the events that take place in the respective current consumption timelines.

Figure 6: Oscilloscope capture showing a TLS application in an EVK MIP board during association to an AP using open security

Figure 7: Oscilloscope capture showing a TLS application in an EVK MIP board during association to an AP using WPA2 security

GS-AN008

PAGE 16 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

REFERENCES
1. GS1010 Evaluation Kit User Manual, GS1010-EK-UM, GainSpan Corporation 2. 802.11 Packet Sniffer, GS-AN001, GainSpan Corporation.

Version 1.0 2.0

Date 7 July 2008 3 Dec 2008

Remarks Initial release. Improved and updated Figure 3. Add table 2 describing TLS operation sequence.

3.0 4.0

5 October 2009 22 October 2009 14 February 2011

Update GainSpan HQ address. Update for GS1011. Add note regarding gratuitous ARP in TSL 2.x. Modified current measurement procedures to use EVK MIP and EVK MEP boards instead of TLS board. (The operating current procedure is updated to use the EVK boards, but the measured operating current and its graph have been left as what was measured for the TLS board, due to the fact that the current iteration of the EVK boards has an additional startup delay caused by the voltage monitor circuit in these boards. This additional delay will be fixed in the next revision of the boards. At that time, this document will be updated with the operating current measured for those boards. Added procedure to measure deep sleep current. Provided measurements for deep sleep, standby and operational current draws Replaced all references to TLS board for EVK MIP and MEP boards

5.0

5.1

17 March 2011

Updated Operating Current measurement section with the following changes: Changed test setup to bypass the two regulators in series as used in Rev 1.0 of the EVB board Provided details on the used trigger settings on the oscilloscope Provided information on the hardware, software and test location that was used to perform the oscilloscope traces shown in that section.

5.2

15 April 2011

Correct table on page 9 used to describe the jumper settings.

GS-AN008

PAGE 17 OF 18

CONFIDENTIAL

AN 008: MEASURING GS1011 POWER CONSUMPTION

GainSpan Corporation 125 South Market Street, Suite 400 San Jose, CA 95113 U.S.A. +1 (408) 673-2900 info@GainSpan.com www.GainSpan.com
Copyright 2009-2011 by GainSpan Corporation. All rights reserved.

GainSpan and GainSpan logo are trademarks or registered trademarks of GainSpan Corporation. Other trademarks are the property of their owners.

Specifications, features, and availability are subject to change without notice.

SP 5.2 15-Apr-11

GS-AN008

PAGE 18 OF 18

CONFIDENTIAL