Arduino Sleep Mode for Power Savings

게시자

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.

최신 뉴스

Sorry, your filter selection returned no results.

개인정보 보호정책이 업데이트되었습니다. 잠시 시간을 내어 변경사항을 검토하시기 바랍니다. 동의를 클릭하면 Arrow Electronics 개인정보 보호정책 및 이용 조건에 동의하는 것입니다.

당사의 웹사이트에서는 사용자의 경험 향상과 사이트 개선을 위해 사용자의 기기에 쿠키를 저장합니다. 당사에서 사용하는 쿠키 및 쿠키 비활성화 방법에 대해 자세히 알아보십시오. 쿠키와 추적 기술은 마케팅 목적으로 사용될 수 있습니다. '동의'를 클릭하면 기기에 쿠키를 배치하고 추적 기술을 사용하는 데 동의하는 것입니다. 쿠키 및 추적 기술을 해제하는 방법에 대한 자세한 내용과 지침을 알아보려면 아래의 '자세히 알아보기'를 클릭하십시오. 쿠키 및 추적 기술 수락은 사용자의 자발적 선택이지만, 웹사이트가 제대로 작동하지 않을 수 있으며 사용자와 관련이 적은 광고가 표시될 수 있습니다. Arrow는 사용자의 개인정보를 존중합니다. 여기에서 당사의 개인정보 보호정책을 읽을 수 있습니다.