Flashing Lights and Power Management

The other day my niece asked me why bicycle headlights sometimes flash during the day. I explained that they need to be much brighter during the day than at night to be seen from a distance, and that by flashing they get noticed more easily and also save a lot of power so the batteries last longer and the lights don’t overheat. (NiteRider calls this Daylight Visible Flash, as seen above.) That got me thinking more about a favorite topic, how to optimize power management and battery life in electronic products.

Power versus Energy

First, some definitions. Power is a measure of how much work can be done in a given amount of time, and in electronics it is typically measured in Watts. It is an instantaneous value that can change over time, such as when a house’s electric power meter spins at different rates as various appliances turn on and off. Energy, on the other hand, is a total of power multiplied by time. In the case of your house, energy is a count of how many times the electric power meter wheel spins around, totaled up on those little dials the electric company reads to know how much to bill you. In small electronic devices the power is much smaller than your house, often measured in milliwatts (one thousandth of a watt) or even microwatts (millionths of a watt) or less, but the principles are the same.

Shorter power bursts = less energy = lower average power

Power management diagram: 120W for 1 out of 24 hours = 5 Watts average
Energy = area under the Power vs. Time curve

Since power can change over time, energy readings provide only an average or total of the power readings. For example, if you turn on a 120 W lamp for only an hour a day, the total energy for the day is 120 Watt-hours, and the average power was 5W = 120W-hrs / 24 hours.  As you can see in the plot above, the area of the actual power usage plot (black) and the average power plot (red), since they represent the same total energy.  The shorter the burst of power, the less it contributes to the average.  Thus your toaster might use a whopping 1500 W, but if it is only used for a few minutes, then it might raise your average daily power usage very little, less than a Watt.

Which brings us back to the main reason for the flashing bicycle light… At night a bicycle headlight can produce a steady beam to allow the rider to see the road and obstacles. And the power level required is low enough that a good battery has enough energy to keep the light burning long enough for most rides. But during the day in the bright sunlight, when the main goal is to be seen by cars, the required power may be tens or hundreds of times higher than at night. That causes two big problems: The battery would run down in a few minutes. And the LED, battery and other circuitry could possibly overheat and burn up.

Average Power calculations

The solution is to turn the light on for very brief periods. If the light is on for only 1/100th of each second (1% duty cycle), but the power is 100 times higher for that split second than the night time steady level, then the average power is the same! Result: good battery life and a bright enough flash to be seen.

1% * 100 = 100%

The calculations can be extended to more complex cases. Suppose, for example, that you want a nighttime mode where the headlight has a steady beam AND flashes. If the base steady level is X Watts, and the flash power is X*100 Watts  for 1/1000th of each second (a quicker flash than during the day), then the average power is:

99.9% * X + 0.1% * X * 100 = (99.9% + 10%) * X = 109.9% * X

In other words, adding the quick flash to the steady beam will increase power (and decrease battery life) by about 10% in this case.

Applying power switching to complex circuits

On a more complex electronic circuit design, this power management technique of briefly turning devices on only as needed is a good way to save energy, and can bring a host of benefits such as extending battery life, keeping the device cooler (which can extend life, reduce cooling costs, etc.), reducing power supply costs and so forth. But is it as simple as turning an LED on and off? Unfortunately no.

First of all, some devices have built in power switching, while others will require external transistors or other switching circuits. Thus while selecting the components there can be tradeoffs to consider in cost, board size, complexity, reliability, and more. And one big issue that is often overlooked is timing, as illustrated by this example:

Suppose you have a need for an Analog to Digital converter (A/D) to read various sensors on your board (accelerometer, temperature, pressure, light). You narrow the parts choice down to two competing A/D converters that have virtually the same specifications in terms of cost, speed of conversion, resolution, noise level and so forth, and they both have a pin to power them down when not in use to save energy. The only difference you really notice is that chip A one draws half as much power as chip B when it is turned on. You should choose A, right?

It’s a matter of timing

Well, not so fast (hint, hint). Both of these use successive approximation type A/D circuits and serial ports, and these complex modules require internal digital clocks to coordinate the timing of the conversion steps and serial port signals. Clock circuits take some time to start up and stabilize after a chip is powered up, and the amount of time can vary greatly depending on the cleverness and goals of the chip designer.

Suppose that both chips can perform an A/D conversion in 1 microsecond (1 millionth of a second), but chip A requires 100 microseconds for its clock circuit to stabilize before you can do a conversion, while chip B is ready in only 5 microseconds. If P is the power draw of chip A, and chip B draws 2*P, then the amount of energy to start up and perform N analog to digital (A/D) conversions for the two chips is:

Chip A energy = (100 + N) * P
Chip B energy = (5 + N) * 2 * P

Even though chip A uses half the power to perform a single A/D conversion, from the time it turns on through the first A/D conversion it will burn 101P, while chip B uses only 12P, over 8 times less energy! If the requirement is to take 1000 A/D readings per second, one every millisecond, then chip B is the clear winner. (The chip would be on for 6 microseconds of every 1 millisecond, or only 0.6% of the time, while chip A would be on for 10.1% of the time.)

Chip B uses twice the power, but for much less time.
Chip B uses twice the power, but for much less time, so less total energy.

On the other hand, if the circuit needs to take 100 sensor readings at a time every time the A/D chip is powered up (i.e.- N = 100), then the total energy is 200P for chip A versus 210P for chip B. Chip A wins in this unusual case of so many sensors, but not by much.

Power isolation

If the circuit designer isn’t careful, some power management choices can lead to hidden problems that might cause mysterious failures and reduced product life, and higher than expected power drain.  For example, shutting power off to an integrated circuit while it still has voltage signals applied to some of its input pins from another part of the circuit board can cause unexpected power flow through the input pins and internal damage to some ICs.  Proper isolation or component selection can avoid these problems.

Analog and Power circuits

Analog circuitry also prevents challenges and new considerations for good power management.  Filter and amplifier circuits need time to stabilize and may not work properly if switched on and off rapidly, but clever design can find the right combination of components and circuit topologies to make drastic cuts in power consumption here as well.

Finally, the components that control the power flow, from discrete transistors to special power distribution chips all have their quirks and tradeoffs that need to be considered to make sure that they don’t waste energy themselves or cause other problems such as adding noise, glitches or voltage drops to the power supplying sensitive analog circuitry.

Good power management can produce remarkable results

This just scratches the surface of some of the things you need to think about to minimize average power levels in order to maximize battery life, but the results of a careful design can be amazing.  Our iBike power meter bike computer design, for example, takes thousands of sensor readings and performs many thousands of complex calculations per second, yet through careful power management it can run off a single tiny CR2032 coin cell battery for many months to a year.

iBike computer with advanced power management for incredible battery life
iBike Bicycle Power Meter