Guide to reduce the Arduino Power Consumption

Guide to reduce the Arduino Power Consumption

In this guide I show you 3 hardware and 1 software measure that reduce the energy consumption of the Arduino microcontroller up to 89%.

The following measures are done in this tutorial:

  • Use a Smaller Microcontroller (Hardware)
  • Reduce Clock Speed (Hardware)
  • Reduce Operation Voltage (Hardware)
  • Use the Arduino Low Power Mode (Software)
Arduino Pro Mini Measurement

Table of Contents

Summary of the Results

The following table summarizes the results of all methods to reduce the power consumption and also shows the used microcontrollers in this article.

MicrocontrollerReference 9VReduce Clock Speed 9VReduce Clock Speed and Operation Voltage 3.3VEnable Low Power Mode 3.3VEnable Low Power Mode 9V
Result of measurementAbsoluteAbsoluteRelativeAbsoluteRelativeAbsoluteRelativeAbsoluteRelative
Arduino Nano22.1 mA18.5 mA-16%3.4 mA-85%3.4 mA-84%4.8 mA-78%
Arduino Pro Mini 5V14.6 mA10.0 mA-32%3.7 mA-75%1.6 mA-89%3.2 mA-78%
Arduino Pro Mini 3.3V5.1 mA3.8 mA-25%3.7 mA-27%1.6 mA-69%3.2 mA-38%
Arduino Uno98.4 mA42.8 mA-57%11.6 mA-88%11.5 mA-88%27.9 mA-72%
Arduino Mega73.2 mA61.8 mA-16%16.7 mA-77%11.9 mA-84%26.9 mA-63%
Average Reduction-29%-70%-83%-66%

From the table that summarizes the results of the power consumption measurements, the following key take-away can be derived:

  • The lowest current consumption after all possible methods for reduction has the Arduino Pro Mini with 1.58 mA. This is a reduction of 89% for the 5V version and 69% for the 3.3 Version of the Arduino Pro Mini.
  • The highest reference current consumption has the Arduino Uno with 98.43 mA. Even the Arduino Mega is a bigger PCB with more electrical components build on the board, the current consumption of the Mega is lower with 73.19 mA because the Arduino Mega runs not on 16 MHz but on 8MHz.
  • The lowest reference current consumption has the Arduino Pro in the 3.3V version with 5.13 mA. If you do not want to use any power saving modes and do not need a 5V supply, you should word with the Arduino Pro Mini 3.3V.
  • The best method to save energy is the to enable the Low Power Mode and reduce the clock speed so that the microcontroller can operate directly with 3.3V. With this method, the current consumption can be reduced by 83% on average compared to the reference measurement with 9V and no optimization.
  • After the enabling of the reduced clock speed and reduced operation voltage of 3.3V, the current consumption of the Arduino Pro Mini in the 5V version is the same as the 3.3V version of the microcontroller.

The following table gives you an overview of all components and parts that I used for this tutorial. If you want to support my work, you can buy something from the following links and I will earn a small commission. This does not affect the price you pay for the products.

If you are interested in components and parts that I used in other tutorials, visit the components and parts page.

 Arduino NanoAmazonBanggoodAliExpress
ANDArduino Pro Mini 3.3VAmazonBanggood 
ANDArduino Pro Mini 5VAmazonBanggood 
ANDArduino UnoAmazonBanggoodAliExpress
ANDArduino Mega R3AmazonBanggoodAliExpress
ANDUSB MultimeterAmazonBanggoodAliExpress
ANDLaboratory Power SupplyAmazonBanggoodAliExpress

The following sections I show you how to implement the techniques to reduce the Arduino power consumption.

Use a Smaller Microcontroller

In this article we cover different microcontrollers from large ones like the Arduino Mega up to smaller ones like the Arduino Pro Mini. The first think you have to keep in mind when you plan your project that needs a lower power consumption: every electrical device on the PCB needs power to operate. Therefore the first step to reduce the Arduino power consumption is:

Use the smallest microcontroller that fits to your project to remove unnecessary hardware.

For example if you want to build a weather station that needs only 5 digital inputs and 1 analog input, you choose the Arduino Nano (22.05 mA) or the Arduino Pro Mini (14.62 mA) instead of an Arduino Uno (98.43 mA).

The measurements are done with a USB multi-meter in idle state of the microcontroller after flashing an empty Arduino script to the microcontroller. The following picture shows the setup of the measurements.

Arduino Power Consumption Measurement Setup

Reduce Clock Speed

To reduce the power consumption further you can reduce the clock speed. The clock speed defines how many operations the Arduino can execute per second. The following table shows the default clock rate of the Arduino microcontrollers, analyzed in this article.

Arduino Board

Microcontroller

Default Clock Rate

Arduino Nano

ATmega328

16 MHz

Arduino Mini 5V

ATmega328

16 MHz

Arduino Mini 3.3V

ATmega328

8 MHz

Arduino Uno

ATmega328

16 MHz

Arduino Mega REF3

ATmega2560

8 MHz

The default clock speed for most Arduino microcontroller is 16 MHz crystal that equals 16 million instructions per second. But in most cases you do not need the full operation speed and therefore you can change the clock speed.

Reduce the clock speed from 16 MHz to 8 MHz

But there is also one downside if you reduce the clock speed. If you switch to a power saving mode for a certain time after the script is finished, the Arduino microcontroller takes a longer time to run the script and the time in the power saving mode is reduced. For example if the script runs 4 seconds on 16 MHz and you pause the script for 10 seconds in the power saving mode, the same script takes 8 seconds on 8 MHz and therefore the time in the power saving mode is reduced to 6 seconds. In exceptional circumstances the current consumption can rise when you reduce the clock speed.

The following picture shows how the execution and sleep blocks over time on 16 MHz and 8 MHz.

Arduino difference in clock speed

To reduce the clock speed you can use the system clock prescaler that reduces the clock speed by a dividing factor. The reduced clock frequency affects the CPU and all synchronous peripherals like I/O pins, analog to digital converter (ADC) and the flash.

Because there is a locking mechanism that prevents the change of the clock frequency, there is a special two step write procedure that must be followed to change the frequency by the CLKPS bits:

  1. Write the clock prescaler change enable (CLKPCE) bit to one and all other bits in CLKPR to zero.
  2. Within four cycles, write the desired value to CLKPS while writing a zero to CLKPCE.

You can find the detailed explanation in the datasheets of the microcontrollers (for example for the ATmega328P on page 32) In the table above I linked the datasheet for every ATmega microcontroller:

The following table shows how the Clock Prescale Register (CLKPS) is build so that we know which bits do we have to set to 0 or 1.

Bit

7

6

5

4

3

2

1

0

Definition

CLKPCE

    

CLKPS2

CLKPS1

CLKPS0

Now we have to know how to set the CLKPS bits in order to define the clock division factor. The following table shows the possible prescaler and their CLKPS3 bit combination.

CLKPS3

CLKPS2

CLKPS2

CLKPS0

Clock Division Factor

0

0

0

0

1

0

0

0

1

2

0

0

1

0

4

0

0

1

1

8

0

1

0

0

16

0

1

0

1

32

0

1

1

0

64

0

1

1

1

128

1

0

0

0

256

The last step is to transfer write procedure that must be followed into the setup function of the Arduino Code.

void setup() {
  CLKPR = 0x80; // (1000 0000) enable change in clock frequency
  CLKPR = 0x01; // (0000 0001) use clock division factor 2 to reduce the frequency from 16 MHz to 8 MHz
}

void loop() {
  // put your main code here, to run repeatedly:

}

Reference Operation Voltage Arduino Nano

Reference Operation Voltage Arduino Pro Mini

Reference Operation Voltage  Arduino Uno

Reference Operation Voltage Arduino Mega

Every microcontroller is supplied with 9V due to a laboratory power supply. The digital multi-meter is connected in series to measure the current consumption. All measurements are inserted into the table on top of the article and the following results are shown:

  • The highest relative reduction in current consumption sees the Arduino Uno with a reduction of 56.56%.
  • The lowest relative reduction has the Arduino Mega with 15.62%.
  • On average the reduction of current consumption for these Arduino microcontrollers is 29% but strongly depends on every individual Arduino board.

Reduce Operation Voltage

The last step of the hardware actions is to reduce the operation voltage. When the operation voltage is reduced, the power consumption is also reduced (P=V*I). But if you want to reduce the operation voltage you have also to reduce the clock speed, that we already did in the previous section.

The dependency between the operation voltage and the clock speed can be found in the datasheet of the Arduino microcontrollers. The following pictures shows this dependency for the ATmega328 and ATmega2560.

ATmega328

ATmega328p Speed Grades

ATmega2560

ATmega2560 Speed Grades

The following table gives you an overview about the considered Arduino boards, the build in microcontroller, the reduced minimum supply voltage with the belonging clock speed and also the normal minimum supply voltage with the standard clock speed.

Arduino Board

Microcontroller

Reduced Minimum Supply Voltage

Normal Minimum Supply Voltage

Arduino Nano

ATmega328

2.7V (8 MHz)

4.5V (16 MHz)

Arduino Mini 5V

ATmega328

2.7V (8 MHz)

4.5V (16 MHz)

Arduino Mini 3.3V

ATmega328

2.7V (8 MHz)

Arduino Uno

ATmega328

2.7V (8 MHz)

4.5V (16 MHz)

Arduino Mega REF3

ATmega2560

1.8V (4 MHz)

2.7V (8 MHz)

For the measurement of the current consumption, I connect the Arduino boards on the 3.3V pin directly to the power supply and reduce the supply voltage from 9V to 3.3V. The following pictures show the different wiring for the 3.3V setup.

Reduce Operation Voltage Arduino Nano

Reduce Operation Voltage Arduino Pro Mini

Reduce Operation Voltage Arduino Uno

Reduce Operation Voltage Arduino Mega

I use the same Arduino script like for the reduced clock speed.

The reduction of the supply voltage has also another positive effect if your power source for the Arduino microcontroller is a battery. The battery voltage is reduced until the minimal voltage of the microcontroller is reached. If you reduce the operation voltage of the microcontroller, the time until this threshold is reached is extended, see the following picture.

Discharging Curve

Because the inbuilt voltage regulator need a higher voltage to operate, you have to bypass the external voltage regulators and connect the power supply directly to the 3.3V pin. If you want to know how to bypass the voltage regulator or use an external voltage regulator with a lower minimal voltage, visit the Arduino battery power tutorial.

All results are written to out master table and we see that the current consumption is further reduced for the Arduino microcontrollers.

  • The reduction of the operation voltage has the highest impact on the hardware site, because you can reduce the voltage on average by over 70% in combination with the reduction of the clock speed.
  • The Arduino Nano and Arduino Mega had only a small reduction by the reduced clock speed with around 16% decrease in current consumption but saw a high reduction after the supply voltage drops to 3.3V. Therefore the current consumption reduces by 84.54% for the Arduino Nano and by 77.13% for the Arduino Mega.
  • Because the only difference for the Arduino Pro Mini in the 5V and 3.3 version is the clock speed and the operation voltage, the current consumption is the same after the measures with 3.73 mA.

Use the Arduino Low Power Mode

After the three hardware techniques to reduce the Arduino power consumption, we use the Arduino Low Power Mode to reduce the power consumption even further. The Low Power Mode disables all of the following functions that use power to run:

Turned On

  • Two-wire interface
  • Watchdog
  • External interrupt

Turned Off

  •  Timer 0, 1, 2 timers
  • External oscillator
  • SPI and UART communication

You can also disable two other features of the ATmega microcontroller but the settings of the library that we use lets you decide if you want to enable or disable the functionality.

  • Analog to digital converter (ADC): The analog to digital converter are used at the digital I/O pins of the Arduino board. An analog input voltage between 0V and VCC is converted to a digital value by a 10-bit converter for example. Therefore the voltages are converted to a digital value between 0 and 1023.
  • Brown-out detector (BOD): The brown-out detector monitors the system voltage and makes sure that in case the system voltage drops under a threshold, the Arduino microcontroller is powered down until the system voltage increased above the threshold.

To enable the Low Power Mode we use the Low-Power library from rocketscream. You can not add the Low-Power library like a standard library in the Arduino IDE but the following 3 steps add the library manually to the Arduino IDE. 

  1. Download the library as ZIP folder from the official github page from rocketscream.
  2. Unzip the downloaded folder and add the folder to the library root folder
  3. Rename the folder so that there is no version name

In the following section I explain the Arduino code. Note that we make two different measures per microcontroller:

  1. Lower Power Mode with 3.3V
    If we want to use the reduced supply voltage we have to combine all measures that we did before. Therefor we connect the power supply to the 3.3V pin and reduce the clock frequency in the Arduino code.
  2. Lower Power Mode with 9V
    If we only want to test the low power library we connect the VIN pin to the power source and in the code we comment the lines that reduce the clock speed.

The following lines show the Arduino code for both measurements (comment out the lines in the setup function for the 9V measurements).

#include "LowPower.h"

void setup()
{
  CLKPR = 0x80; // (1000 0000) enable change in clock frequency
  CLKPR = 0x01; // (0000 0001) use clock division factor 2 to reduce the frequency from 16 MHz to 8 MHz
}

void loop() 
{
  delay(4000);
  LowPower.powerDown(SLEEP_2S, ADC_OFF, BOD_OFF);
}

In the first line we include the low power library from rocketscream. You already know the setup function where we reduce the clock frequency. In the loop function I wait for 4 seconds until the Arduino board enters the low power mode for 2 seconds where we also disable the analog to digital converter and the brown-out detector to further reduce the current consumption.

There is also the possibility to configure the low-power library that the microcontroller wakes up by an external trigger. But if you define a time for the sleep time, you can’t just arbitrarily choose how long to sleep for. The watchdog timer only has specific periods (defined by dividing the clock by a set amount) that it can sleep for:

enum period_t
{
    SLEEP_15MS,
    SLEEP_30MS,
    SLEEP_60MS,
    SLEEP_120MS,
    SLEEP_250MS,
    SLEEP_500MS,
    SLEEP_1S,
    SLEEP_2S,
    SLEEP_4S,
    SLEEP_8S,
    SLEEP_FOREVER
};

The following picture shows the current measurement for the Arduino Pro Mini.

Arduino Pro Mini Measurement

You see that the microcontroller enters periodically the power down mode and reduces the current from 5.25 mA to 1.58 mA.

If you have any questions regarding the reduction of current consumption for Arduino boards, please use the comment section below to ask questions. I will answer them as soon as possible.

Leave A Comment