munotes®

How Long a Node Lasts: The Energy Budget Worked Out

Get access to whole semester resourcesSemester Pass

Chapter Nine

Syllabus topic Module 1, "Introduction and Overview of WSNs: Sensor node technology"

Pages 52 to 57 of 862

In one line

A node's lifetime is the charge its battery can deliver divided by the average current it draws, and the average current is each part's current weighted by the fraction of time it is on.

In the wording a student can write in an examination: if a node spends a fraction d of its time awake, drawing a current I(awake), and the rest asleep, drawing I(sleep), its average current is

I(avg) = d × I(awake) + (1 - d) × I(sleep)

and a battery of usable capacity C (in milliampere-hours) lasts C / I(avg) hours. The fraction d is the node's duty cycle. Lifetime is therefore set by three things: the duty cycle, the awake current (dominated by the radio) and, at low duty cycles, the sleep current.

Why this sum is worth learning

Because it turns every energy argument in the book into a number. S-MAC saves energy by sleeping is an assertion; S-MAC at a 10 per cent duty cycle lasts about ten times as long as an always-on radio is an answer. And the sum is the tool a designer actually uses to decide whether a network will last a season.

The method, in four steps

  1. List every state the node can be in and its current, from the datasheets.
  2. Find the fraction of time spent in each state, from how often the node wakes and how long it stays awake.
  3. Add up current times fraction to get the average current.
  4. Divide the battery's usable capacity by the average current, then check the answer against the battery's shelf life, because a battery also runs down while doing nothing.

Worked by hand: a 1 per cent duty cycle

The node is the Telos pair of parts, running from two AA cells at about 3 volts.

Step 1, the currents. Awake, the radio listens at 18.8 mA and the processor runs at 0.5 mA, so I(awake) = 18.8 + 0.5 = 19.3 mA. Asleep, the radio is powered down at 0.02 mA and the processor is in standby at 0.002 mA, so I(sleep) = 0.02 + 0.002 = 0.022 mA.

Step 2, the fractions. Awake 1 per cent of the time, d = 0.01, and asleep for the remaining 0.99.

Step 3, the average current.

I(avg) = 0.01 × 19.3 + 0.99 × 0.022

= 0.193 + 0.02178

= 0.21478

so the node draws 0.21478 mA on average.

Step 4, the lifetime. Two AA cells in series give 3 volts, but their capacity in mAh does not add: the same charge flows through both. The E91 alkaline cell's chart gives about 3,000 mAh at 25 mA; allowing for cold nights, for the cut-off voltage and for the cells' age, we allow ourselves 2,500 mAh. The lifetime is 2,500 / 0.21478, about 11,640 hours, which is about 485 days, or 1.3 years.

munotes.in52

How Long a Node Lasts: The Energy Budget Worked Out

Compare that with the 5.4 days the same node lasts with its radio always on, which is the first line of the program's output below. Sleeping 99 per cent of the time has bought about ninety times the lifetime.

The same sum, run across duty cycles

# Lifetime of a Telos-style node (CC2420 radio, MSP430F1611 processor)
# against its duty cycle. Currents in mA, from the two datasheets at 3 V.
RADIO_ON = 18.8      # CC2420 receiving (transmitting is 17.4, a little less)
RADIO_SLEEP = 0.02   # CC2420 power down, voltage regulator still on
CPU_ON = 0.5         # MSP430F1611 active at 1 MHz and 3 V
CPU_SLEEP = 0.002    # MSP430F1611 standby (LPM3) at 3 V and 25 degrees C
BATTERY = 2500       # mAh we allow ourselves from two AA cells in series

def average_current(duty):
    """Radio and processor awake for a fraction `duty` of the time."""
    awake = RADIO_ON + CPU_ON
    asleep = RADIO_SLEEP + CPU_SLEEP
    return duty * awake + (1 - duty) * asleep

print("duty cycle   average mA    lifetime")
for duty in (1, 0.1, 0.01, 0.001, 0.0001, 0):
    mA = average_current(duty)
    days = BATTERY / mA / 24
    if days < 365:
        life = "%.1f days" % days
    else:
        life = "%.1f years" % (days / 365)
    print("%9.2f %%   %10.4f   %s" % (duty * 100, mA, life))
duty cycle   average mA    lifetime
   100.00 %      19.3000   5.4 days
    10.00 %       1.9498   53.4 days
     1.00 %       0.2148   1.3 years
     0.10 %       0.0413   6.9 years
     0.01 %       0.0239   11.9 years
     0.00 %       0.0220   13.0 years

Read the lifetime column from the top, and three things stand out.

Always on is hopeless. 5.4 days, which is what [The Challenges of Wireless Sensor Networks] found with a rougher sum.

At first, every tenfold cut in duty cycle buys almost tenfold life. From 100 to 10 per cent, and from 10 to 1 per cent, the lifetime grows by nearly ten each time, because the awake current is almost the whole average.

Then the curve flattens. From 0.1 per cent to 0.01 per cent the lifetime does not grow tenfold, and even a node that never wakes at all (the last line) lasts only 13 years. That ceiling is set by the sleep current alone: 2,500 mAh divided by 0.022 mA. Below about 0.1 per cent, making the node sleep even more hardly helps; making its sleep deeper does.

A real cycle, item by item

Meera's vineyard node wakes every 15 minutes for 60 milliseconds. What it does in that time is an assumption about the software, stated here so the reader can change it: the sensors are powered for 20 ms at 1 mA, the radio listens for 40 ms (waiting for the channel, for the acknowledgement and for a neighbour's packet to forward) and transmits for 4 ms. The listing adds up the charge of each item, in milliampere-milliseconds, and compares two ways of putting the radio to sleep.

munotes.in53

How Long a Node Lasts: The Energy Budget Worked Out

# One 15-minute cycle of the vineyard node, item by item.
# Charge is current (mA) times time (ms); dividing the total by the cycle
# length gives the average current the battery must supply.
CYCLE_MS = 15 * 60 * 1000
AWAKE_MS = 60

def budget(radio_sleep):
    items = [
        ("processor awake",     0.5,   AWAKE_MS),
        ("sensors powered",     1.0,   20),
        ("radio listening",     18.8,  40),
        ("radio transmitting",  17.4,  4),
        ("processor asleep",    0.002, CYCLE_MS - AWAKE_MS),
        ("radio asleep",        radio_sleep, CYCLE_MS - AWAKE_MS),
    ]
    total = sum(mA * ms for _, mA, ms in items)
    for name, mA, ms in items:
        share = 100 * mA * ms / total
        print("  %-19s %7.3f mA × %6d ms = %9.1f   %5.1f %%"
              % (name, mA, ms, mA * ms, share))
    average = total / CYCLE_MS
    years = 2500 / average / 24 / 365
    print("  total %.1f mA ms; average %.5f mA; lifetime %.1f years"
          % (total, average, years))

print("Radio powered down between cycles (20 microamperes):")
budget(0.02)
print()
print("Radio's voltage regulator off as well (0.02 microamperes):")
budget(0.00002)
Radio powered down between cycles (20 microamperes):
  processor awake       0.500 mA ×     60 ms =      30.0     0.1 %
  sensors powered       1.000 mA ×     20 ms =      20.0     0.1 %
  radio listening      18.800 mA ×     40 ms =     752.0     3.6 %
  radio transmitting   17.400 mA ×      4 ms =      69.6     0.3 %
  processor asleep      0.002 mA × 899940 ms =    1799.9     8.7 %
  radio asleep          0.020 mA × 899940 ms =   17998.8    87.1 %
  total 20670.3 mA ms; average 0.02297 mA; lifetime 12.4 years

Radio's voltage regulator off as well (0.02 microamperes):
  processor awake       0.500 mA ×     60 ms =      30.0     1.1 %
  sensors powered       1.000 mA ×     20 ms =      20.0     0.7 %
  radio listening      18.800 mA ×     40 ms =     752.0    28.0 %
  radio transmitting   17.400 mA ×      4 ms =      69.6     2.6 %
  processor asleep      0.002 mA × 899940 ms =    1799.9    66.9 %
  radio asleep          0.000 mA × 899940 ms =      18.0     0.7 %
  total 2689.5 mA ms; average 0.00299 mA; lifetime 95.5 years

The first budget is the surprise of this chapter. The radio's listening and transmitting, the part everyone worries about, is about 4 per cent of the charge. The radio asleep, at 20 microamperes, is 87 per cent, because it is asleep for 899,940 of every 900,000 milliseconds. At this duty cycle the job is no longer to sleep more but to sleep deeper.

munotes.in54

How Long a Node Lasts: The Energy Budget Worked Out

The second budget switches the radio's voltage regulator off as well, the CC2420's 0.02-microampere state, which costs only a slightly longer wake-up (up to 0.6 ms, from [The Radio, the Sensors and the Power Supply of a Node]). The average current falls from about 0.023 mA to about 0.003 mA, nearly eight times less, and now the processor's standby is the largest item.

But neither lifetime can be believed as it stands. 12.4 years and 95.5 years are longer than the batteries themselves last on a shelf: the E91 datasheet gives its shelf life as 10 years at 21 degrees C, the L91 lithium cell's as 25 years. When the electronics draw this little, the battery's own chemistry, not the node, sets the lifetime. A designer who stopped at the program's last line would promise the farmer a century.

What the model leaves out

A good answer names the limits of its own sum.

  • Forwarding. This node sends only its own packet. A node near the sink also receives and forwards everyone else's, so it listens and transmits many times longer and dies first. The network's lifetime is set by those nodes, which is why [Optimization Goals: Quality of Service, Energy Efficiency and Lifetime] defines lifetime in several ways.
  • Retransmissions and collisions, which add radio time whenever the channel is busy or a packet is lost.
  • The battery's behaviour: the rate-capacity effect on the radio's 18 mA bursts, the effect of heat and cold, and self-discharge over the years.
  • Start-up energy, the milliseconds of oscillator start-up at each wake-up; small here, larger for a node that wakes very often.
  • The cut-off voltage, which decides how much of the battery the electronics can actually use.

Distinctions

Node lifetimeNetwork lifetime
IsHow long one node's battery lastsHow long the network does its job
Set byThat node's duty cycle and currentsThe nodes that work hardest, usually those near the sink
Worked hereYesIn the optimization goals chapter
Duty cycleWhat limits the lifetime
High, 1 per cent and aboveThe awake current, above all the radio listening
Low, around 0.1 per centBoth the awake and the sleep currents
Very low, below 0.01 per centThe sleep current, then the battery's shelf life

What it does not mean

Halving the radio's active current does not double the lifetime at low duty cycles. Once the sleep current dominates, the active current hardly matters, as the vineyard budget showed.

Two cells in series do not double the mAh. They double the voltage; the charge that flows is the same through both.

munotes.in55

How Long a Node Lasts: The Energy Budget Worked Out

A computed lifetime longer than the battery's shelf life is not a real lifetime. It means the chemistry will expire first.

The node's lifetime is not the network's. A relay near the sink may last a tenth as long as a node at the edge of the field.

Quick revision

  • I(avg) = d × I(awake) + (1 - d) × I(sleep); lifetime = C / I(avg).
  • Telos parts at 3 V: I(awake) = 18.8 + 0.5 = 19.3 mA; I(sleep) = 0.02 + 0.002 = 0.022 mA.
  • 1 per cent duty cycle: 0.21478 mA; 2,500 mAh lasts about 1.3 years. Always on: 5.4 days.
  • Every tenfold cut in duty cycle buys nearly tenfold life until the sleep current takes over; with no waking at all, the ceiling is 13 years.
  • Vineyard cycle: radio asleep is 87 per cent of the charge; switching its regulator off too cuts the average about eight times.
  • Then the battery's shelf life (E91 10 years, L91 25 years) is the real limit.

Test yourself

1. A node draws 19.3 mA awake and 0.022 mA asleep, and is awake 1 per cent of the time. Find its average current and its lifetime on 2,500 mAh. 0.01 × 19.3 + 0.99 × 0.022 = 0.193 + 0.02178 = 0.21478 mA. Lifetime 2,500 / 0.21478, about 11,640 hours, about 1.3 years.

2. The same node is left with its radio always on. How long does it last, and what does the comparison show? 2,500 / 19.3, about 130 hours, 5.4 days. The 1 per cent duty cycle buys about ninety times the lifetime, which is why sensor network radios are switched off almost all the time.

3. Why does cutting the duty cycle from 0.01 per cent to 0.001 per cent hardly change the lifetime? Because at such low duty cycles the sleep current makes up almost all of the average current, and it is not affected by how often the node wakes. Only a deeper sleep state helps.

4. In the vineyard budget, what fraction of the charge goes on the radio while it is asleep, and why? About 87 per cent. The radio draws only 20 microamperes asleep, but it is asleep for 899,940 of every 900,000 milliseconds, while it listens and transmits for only 44.

5. The program predicts 95.5 years. What is wrong with that answer? It ignores the battery's own limits. An E91 alkaline cell has a shelf life of about 10 years at 21 degrees C, so the chemistry, not the node's consumption, sets the lifetime. The prediction also ignores forwarding, retransmissions, temperature and the cut-off voltage.

munotes.in56

How Long a Node Lasts: The Energy Budget Worked Out

6. Two AA cells of 2,500 mAh are connected in series. What voltage and what capacity does the node see? About 3 volts, and still 2,500 mAh: series connection adds voltages, not charge.

munotes.in57

The rest of this subject

These notes are cut from the University's printed syllabus. Open the syllabus itself for the same subject.

Issue
Done!