Arduino Sleep Mode for Power Savings

Published By

Arduino boards are excellent tools for experimentation and prototyping, especially when power is abundant. But what if power is an issue? Whether you're running on limited battery or working in a remote monitoring scenario using solar power, sometimes every milliamp counts. Your device's power draw―when in use and at rest―can make a huge difference in your application.

Power Draw

Let's look at a few popular options in the world of microcontroller boardsWhen running normally with a blank program (as in, what you get when you open a new blank file on the Arduino IDE), we observed the following power consumption values.

  • Arduino Uno (ATmega328P):47mA
  • Sparkfun Pro Micro 5V (ATmega32U4): 36mA
  • Arduino Pro Mini 5V (ATmega328P): 16mA

These values don't sound like much power, but consider that an Arduino Uno would theoretically suck the power out of a 750mAh 3.7V LiPo in under 12 hours, neglecting conversion losses and other inefficiencies. Even the comparatively efficient Pro Mini only lasts about 35 hours in perfect conditions. In a real application, both times would be significantly shorter. There must be a better solution.

Arduino Sleep Mode

As it just so happens, there is something called sleep mode. In fact, several types of low power sleep modes are available via the Arduino IDE:

  • SLEEP_MODE_IDLE
  • SLEEP_MODE_ADC
  • SLEEP_MODE_PWR_SAVE
  • SLEEP_MODE_STANDBY
  • SLEEP_MODE_PWR_DOWN

We arranged this list beginning with the least power savings and most active functionality and ending with most power savings. In SLEEP_MODE_PWR_DOWN, most processor functions are turned off. For a quick test of the SLEEP_MODE_PWR_DOWN, I used code found here, listed below:

#include <avr/sleep.h>

void setup ()

{

set_sleep_mode (SLEEP_MODE_PWR_DOWN);

sleep_enable();

sleep_cpu ();

}  // end of setup

void loop () { }

With that code loaded into our respective boards, we see the following:

  • Arduino Uno: 24mA
  • Sparkfun Pro Micro 5V: 5mA
  • Arduino Pro Mini 5V: .63mA

Putting the Uno to sleep saves about half its power consumption. That's better, but not great, since the Uno still has to power a USB interface chip, voltage regulators, and a power LED. The Pro micro sees its power consumption cut by around a factor of 7 to 5mA, likely owing much of its sleep efficiency to the fact that the chip entering sleep mode also handles USB interface.

The Pro Mini, however, is exceptionally efficient in sleep mode. At just .63mA, the Pro Mini has just 2.6 percent of the power usage of sleeping Uno. You'll need to supply your own FTDI device, which makes this board a bit harder to program. But for projects that need to sip power, the Pro Mini is the clear winner.

On the other hand, if you need extremely low power, the ATTiny85 in its V variation, running at 1.8V and 1 MHz, only draws:

  • Active: 300μA, or .3mA
  • Power-down mode: in.001μA. or .003mA

The ATTiny85 uses half the current consumption of the sleeping 5V Pro Mini when active and fully functional. If you're interested, I outlined how to get started with this fantastic chip.

Arduino Wake Up

Sleep modes can be beneficial for applications with intermittent tasks. For instance, a sensor or real-time clock (RTC) module could ping an interrupt to wake up when it needs to perform a task. It can also use the reset pin to restart the system, allowing it to do its duty, then go back to sleep. While you won't need it for every project, being able to put your microcontroller to sleep is an excellent skill to have in your microcontroller programming toolbox.

Related news articles

Latest News

Sorry, your filter selection returned no results.

We've updated our privacy policy. Please take a moment to review these changes. By clicking I Agree to Arrow Electronics Terms Of Use  and have read and understand the Privacy Policy and Cookie Policy.

Our website places cookies on your device to improve your experience and to improve our site. Read more about the cookies we use and how to disable them here. Cookies and tracking technologies may be used for marketing purposes.
By clicking “Accept”, you are consenting to placement of cookies on your device and to our use of tracking technologies. Click “Read More” below for more information and instructions on how to disable cookies and tracking technologies. While acceptance of cookies and tracking technologies is voluntary, disabling them may result in the website not working properly, and certain advertisements may be less relevant to you.
We respect your privacy. Read our privacy policy here