# How to Reduce Power Consumption in a Circuit for Embedded Projects

When it comes to reducing energy in a circuit, many different techniques can be deployed. Whether it is replacing linear regulators with a switch mode, increasing the resistance of potential divider circuits, or clocking down processors, this video will look at the most common ways you can reduce your power consumption!

## The problem with power consumption

Imagine the scenario where you have been tasked to design an environmental IoT sensor that needs to be able to stream data to a remote server. This kind of task introduces a number of challenging elements including what network technology to use, what sensors are needed, and how to put it all together. But to then make things really complex, an additional requirement to the project is that the device must operate using a battery and operate over several weeks on a single charge! How on earth do you create a circuit that minimizes energy use, how do you measure this energy use over time, and what tricks can a maker use to minimize energy consumption?

Before we look into power reduction tips, we first need to know how energy is consumed in a circuit. Primarily, power consumption falls under one of two categories; static and dynamic. Static power is the power that is constantly used by a circuit regardless of its state while dynamic power is power consumed during some specific operation. However, static power can also be broken down into two other subcategories; leakage and waste. Leakage is power consumed as a result of reverse currents from diodes and transistors while waste power results from poor engineering that could otherwise be minimized using good engineering practices.

So, let’s take a more in-depth look into each power consumption type!

## What is Static Power?

Static power is consumed by devices simply for existing. A good example would be a 7805 regulator that provides 5V for powering external circuits. A larger voltage is fed in (such as 12V), and this is dropped down to 5V resulting in a voltage drop of 7V. If the 5V circuit is consuming 1A of current, then the wasted power (i.e., static power) is 7V x 1A = 7W. This power waste is essential to the operation of the 7805 and nothing can be done about it (except replacing the 7805 with a switch mode power supply).

## What is Dynamic Power?

Dynamic power is consumed as a result of a change in a circuit, and this is commonly seen in digital logic circuits, especially those based on CMOS technologies. For example, CMOS logic uses N and P type transistors to connect the output either to power or ground. Under static operation, the output is only connected to power or ground, but during a change (i.e. switching from on to off), both the N and P type transistors briefly turn on at the same time, and this sees a short circuit from power to ground (thus consuming large amounts of power). The slower this transition is, the more power is consumed.

## Power Reduction Tips

So, now that we have looked at the two main types of power waste, let’s look at different methods you can deploy to reduce power consumption in an embedded system as much as possible!

## Tip 1 – Use switch-mode power supplies!

By far the best option for engineers is to avoid the use of linear voltage regulators such as the 7805 and the AMS1117 and replace them with switch mode power supplies. By switching a larger voltage and averaging this voltage with the use of capacitors and inductors, efficiencies as high as 99% can be achieved which results in very little energy waste. Furthermore, this energy saving also results in less thermal heating of power components and allows for devices to be even smaller.

## Tip 2 – Use larger resistors

If possible, try to maximize the size of resistors in circuits whether it is for amplifiers, potential dividers, or LEDs. The current in a circuit is indirectly proportional to the resistance, and current is directly proportional to the power consumption meaning that double the size of a resistor will half the power consumed. Of course, this is not always possible (as too large resistance values can affect the performance of amplifiers), but even saving a few hundred microamps can mean a world of difference to the longevity of a battery-powered device.

## Tip 3 – Disable unneeded peripherals and devices

Just about every microcontroller in production contains some number of peripherals whether it is an ADC, DAC, I2C controller, UART, or PWM generator. While these can be useful in some projects, the chances of every single peripheral being needed is unlikely. As each of these peripherals can consume power, disabling them can help reduce the overall amount of power consumed. This is especially important with microcontroller platforms that integrate many peripherals (such as the PIC range of microcontrollers from Microchip).

## Tip 4 – Remove unneeded circuits

The vast number of development boards available to makers can help accelerate project development and prove concepts, but while these boards are easy to use, they come with many additional circuits that are simply not needed. These additional circuits consume power (such as analogue comparators, LEDs, and I/O level converters), which can be virtually impossible to remove through software means. As such, it may be a good idea to physically remove these circuits if they are unused, but be warned that this could damage your development kit!

## Tip 5 – Reduce MCU operating voltage

One major technique for reducing microcontroller power consumption is to reduce the voltage it operates at. As power consumption is directly proportional to voltage, reducing the voltage reduces the current in that circuit, and thus reduces the overall power consumed. The amount of power saved by operating at reduced voltages is by no means significant either; huge power savings can be made by reducing the operating voltage from 5V to 3.3V (in some cases, close to 50%).

## Tip 6 – Reduce MCU operating frequency

Just as reducing the operating voltage of a microcontroller reduces the overall static power consumption, reducing the operating speed reduces dynamic power. Just like voltage reduction, clock reduction can yield impressive power reduction results which is why battery-powered devices should try to operate as slow as possible. For example, PIC microcontrollers can see power consumption increase by 40 times when operating at their slowest speed to their highest.

## Tip 7 – Use sleep mode

By far one of the best methods for reducing power consumption of peripherals and microcontrollers is to take advantage of sleep mode. Devices that enter sleep mode configure themselves to consume as little power as possible, and this can be shockingly low (especially for microcontrollers). Furthermore, many microcontrollers support auto-wakeup procedures from onboard peripherals that can wake up the device upon detecting an event. This allows IoT devices to remain operational for extended periods of time on a single charge.

## The Nordic Power Profiler Kit 2 (PPK2)

So now that we have looked at numerous power management and power reduction techniques it’s time to look at the Nordic Power Profiler Kit 2 (PPK2), and how it can be used to help reduce power consumption in a circuit.

The Nordic PPK2 is a combined volt and ammeter that can be used to stream live readings to a connected computer. At the same time, the PPK2 can also provide external circuits with power and control the output voltage via software. Additionally, the PPK2 also integrates an 8-channel logic analyzer which can be tied in with voltage and current readings to compare the state of logic signals to power consumption.

The resolution of the onboard ammeter is approximately 200nA, and can provide a maximum current of 1A, and a voltage output range of 0.8V to 5V. Power for the PPK2 is provided via two micro-USB connectors with one also providing USB connectivity (the second power cable is only needed when operating above 500mA). As the PPK2 can monitor both current and voltage simultaneously, it can also determine the power consumption with the multiplication of the two (P = VI).

The PPK2 is supported with the use of free Nordic software that provides device controls, graphic elements for viewing power consumption, and logic state graphs for viewing the status of each digital input.

## How the PPK2 can be used to help reduce power consumption in a circuit

Using two multimeters can demonstrate the instantaneous power of a project, but what the PPK2 does differently is that it is software powered via a computer link (which in itself allows for advanced testing), and logs the instantaneous voltage, current, and power consumption over time. This allows for makers to see how their power consumption changes over time, how the power consumption relates to changes in logic signals (via the logic port), and better understand how even portions of their code relate to power consumption.

## Demonstrating Peripheral Power Usage

An excellent example of how to use the PPK2 for power reduction can be seen in the third example shown in the video below. A PIC chip is configured in software to turn off and on the onboard DAC peripheral. Despite being unused, the PPK2 shows how the DAC was able to consume around 200uA which can be significant for battery-powered devices over extended periods of time.

## Demonstrating Sleep Mode

Another example showing how the PPK2 can be used to monitor and identify power consumption is in the fourth example demonstrating sleep mode shown in the video below. Not only does the power consumption graph produced by the PPK2 demonstrate how much current is being used between sleep mode and idle, but it also shows the current consumption caused by the LED. As such, this example shows that if the resistor connected to the LED is increased in size, then the power consumption can also be reduced.

## Debugging Code

A more novel use for the PPK2 can be for debugging hardware. One such example is given in the video below whereby the ESP32 power consumption is monitored to check that the Wi-Fi module is indeed working. As radio modules consume large amounts of power (relative to the processor), they show up extremely clearly on power graphs produced by the PPK2. Therefore, we can confirm that the Wi-Fi module is at least activating and drawing power. If our module refuses to connect to the internet and we observe no power spikes, then it could be assumed that something in the hardware has failed (or at least incorrectly configured). Furthermore, Wi-Fi modules periodically turn on and communicate with the connected access point, and as such we should expect to see frequent pulses of power consumption.

## Wrapping things up, and going further

The Nordic Semiconductor PPK2 presents numerous opportunities for those looking to do power analysis on their projects, especially for those involved with IoT and other remote designs. The ability to perform long-term tests logging data in real-time allows makers to observe the relationship between hardware and software with power consumption while the 8-input logic input allows for monitoring of critical signals such as interrupt lines, bus activity, and even sensor outputs.

Taking the PPK2 further, it presents itself as an ideal candidate for portable electronics workstations mounted in a travel case or container due to its small profile and low weight. The ability to connect to USB also introduces the possibility of providing power via an external USB power bank. But most important of all, the PPK2 supports Linux which means that it can be connected to a Raspberry Pi which is also an ideal candidate for portable equipment.