
Arduino Sleep Mode, also referred to as Arduino Power Save Mode or Arduino Standby Mode, is a feature that allows users to stop or turn off unused modules in the microcontroller, significantly reducing power consumption. This is particularly useful when the Arduino is battery-powered or when it needs to be placed in a remote location where plugging into a power grid is not an option. There are six different sleep modes, and an Arduino can be woken up from sleep mode through various sources, including internal or external interrupts or a reset. This tutorial will provide an introduction to Arduino Sleep Mode, including how to configure wake-up sources and the different sleep modes available.
Arduino Sleep Function Characteristics and Values
| Characteristics | Values |
|---|---|
| Use case | To save power when the Arduino is not in use, especially in battery-powered projects or when logging data in remote locations |
| Number of sleep modes | Six low power modes |
| Sleep mode types | Idle, ADC noise reduction, Power-Down, Power-Save, Standby, External Standby |
| Wake-up sources | Timer function, external interrupt, internal interrupt, Real Time Clock (RTC), reset |
| Sleep mode control | SM [2:0] in the SMCR (sleep mode control) register |
| Sleep mode entry | Enable the sleep bit in the Sleep Mode Control Register (SMCR.SE) and select the sleep mode using the sleep mode select bits |
| Example code | #include "LowPower.h"void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); delay(2000); digitalWrite(13, LOW); LowPower.powerDown(SLEEP_2S, ADC_OFF, BOD_OFF);} |
Explore related products
What You'll Learn

When to use the sleep function
The sleep function is useful when your Arduino project is battery-powered, allowing you to create a power-efficient and user-friendly project. This is especially relevant when your Arduino is in a remote location, and plugging it into a power grid is not an option.
For example, if you need to log data at a remote site or only require your Arduino to be active for short intervals, the sleep function can be beneficial. You can set your Arduino to log data at specific intervals or to respond to predetermined events, and then return to sleep mode.
The sleep function also allows you to reduce the power consumption of your Arduino, which can make your product smaller and extend the life of its batteries.
There are six different sleep modes available, also known as low power modes. These modes allow you to stop or turn off unused modules in the microcontroller, reducing power consumption. The specific modes are Idle, ADC noise reduction, Power-Down, Power-Save, Standby, and External Standby. Each mode offers different functionalities in terms of which modules remain active.
Mastering Auto Sleep: A Guide to Better Rest
You may want to see also
Explore related products

How to put Arduino to sleep
Arduino Sleep mode is also referred to as Arduino Power Save mode or Arduino Standby Mode. Sleep modes allow users to stop or turn off unused modules in the microcontroller, significantly reducing power consumption. This is especially beneficial when the Arduino is battery-powered.
There are six different sleep modes or low power modes. To enter any of the sleep modes, the sleep bit in the Sleep Mode Control Register (SMCR.SE) must be enabled. The sleep mode select bits then select the sleep mode among Idle, ADC noise reduction, Power-Down, Power-Save, Standby, and External Standby.
To enter Idle sleep mode, write the SM [2,0] bits of the controller to '000'. This mode stops the CPU but allows the SPI, 2-wire serial interface, USART, Watchdog, counters, and analog comparator to operate. Idle mode stops CLKCPU and CLKFLASH. The Arduino can wake up at any time through an external or internal interrupt.
Another example is the Extended Standby mode, which is similar to Power-Save mode, except the oscillator keeps running. Writing the SM [2,0] pin to '111' will put the device into Extended Standby mode. The device will take six clock cycles to wake up from this mode.
The timer function is a synchronous wake-up event, as the user plans when to wake up the Arduino before putting it to sleep. In contrast, an external wake-up event is asynchronous, as the user does not know when the event will occur. When the event occurs, the Arduino performs a particular job and then goes back to sleep.
Amitriptyline for Sleep: Dosage, Benefits, and Side Effects
You may want to see also
Explore related products

How to wake up Arduino from sleep mode
There are several ways to wake up an Arduino from sleep mode, and the method you choose will depend on the specific project you are working on. Here are some common approaches:
Using a Timer Function:
The Timer function is a valuable way to plan a wake-up event. This involves setting a specific time interval after which the Arduino will automatically wake up. This can be achieved using the sleep modes in the SMCR (Sleep Mode Control) register. The Timer function is a synchronous event, allowing you to plan the Arduino's wake-up time before putting it to sleep.
External Wake-up Event:
An Arduino can be configured to wake up in response to external stimuli or events. For example, you can use an external button to wake up the Arduino. This can be set up using the LowPower_LowPowerLab library, where you can define a specific pin as the wake-up pin. When the button is pressed, it triggers an interrupt, and the Arduino wakes up.
Internal Interrupts:
Internal interrupts such as timer overflow or UART transmission complete can also be used to wake up the Arduino. These events can be configured as wake-up sources, and the Arduino will respond accordingly when these events occur.
Power Management:
The Power-down mode (SLEEP_MODE_PWR_DOWN) is the most power-efficient mode, maximizing battery life. However, it has a slower wake-up time due to the clock stabilization process. To wake up the Arduino from this mode, an external influence is required, such as a physical nudge or trigger.
Watchdog Timer:
The Watchdog Timer is another approach to waking up an Arduino. While it may not be the most accurate method, it can be used to set a time interval after which the Arduino will wake up.
It's important to note that the availability of these methods may vary depending on the specific Arduino model and its MCU (Microcontroller Unit). Always refer to the MCU datasheet and documentation for detailed information on the sleep modes and wake-up methods supported by your particular Arduino board.
Sleep Mode: CPU Time Usage?
You may want to see also
Explore related products

Synchronous vs asynchronous wake-up events
Arduino's sleep function is a powerful tool for reducing power consumption and optimizing battery life in projects. When it comes to waking up an Arduino from its sleep mode, there are two main types of events: synchronous and asynchronous wake-up events. Understanding these wake-up sources is crucial for creating responsive and power-efficient projects.
Synchronous wake-up events are those that occur at specific, predefined times. This means that the Arduino will wake up after a certain amount of time has passed or at a specific time in the future. For example, you can set the Arduino to wake up after a few hours or at an exact time, such as seven days from now. This type of wake-up event is useful when you want the Arduino to perform a task at regular intervals or at a specific time.
Asynchronous wake-up events, on the other hand, are triggered by external sources or events. These can include various sources, such as external interrupts, timers, or touch. For instance, you can use a switch to wake up the Arduino by opening or closing the circuit. Another example is using a timer to wake up the Arduino at predefined periods. Asynchronous wake-up events offer flexibility and responsiveness, allowing the Arduino to react to its environment or specific conditions.
The ATmega328P, found in Arduino UNO, Nano, and Pro-mini, offers six different sleep modes, each with its own set of potential "wake-up calls." Depending on the chosen sleep mode, different methods can be used to wake up the Arduino. For instance, the LowPower library allows you to configure wake-up options accordingly before putting the Arduino to sleep. Additionally, the ESP32 offers multiple power-saving modes, including light sleep and deep sleep, each with its own set of wake-up sources.
It's important to note that the choice between synchronous and asynchronous wake-up events depends on the specific requirements of your project. Synchronous events are ideal for tasks that need to be performed at regular intervals or specific times, while asynchronous events provide responsiveness to external stimuli or conditions. By leveraging the different sleep modes and wake-up sources, you can create power-efficient Arduino projects that suit your specific needs.
Muscle Relaxers: A Risky Sleep Solution
You may want to see also
Explore related products

Arduino sleep modes
There are six different Arduino sleep modes or low power modes, offering varying levels of power savings and functionality. The most commonly used mode in real-world scenarios is the Power-down mode (SLEEP_MODE_PWR_DOWN). This mode turns off all unnecessary components, reducing power consumption in the MCU (Microcontroller Unit). When in this mode, the Arduino can only be awakened by an external influence or interrupt, such as a physical nudge or a pre-configured wake-up event.
To configure sleep modes, you can use the SM [2:0] in the SMCR (Sleep Mode Control) register. It's important to refer to the MCU datasheet to understand the specific methods available for the particular MCU you are using. Additionally, you can utilize libraries like "LowPower.h" to facilitate the implementation of sleep modes and wake-up events.
One example of using the sleep mode is by blinking the onboard LED on the Arduino Uno every 2 seconds. Instead of using the conventional method with a delay function, you can put the Arduino to sleep for those 2 seconds, significantly saving battery life. This can be achieved using the following code:
Cpp
#include "LowPower.h"
Void setup() {
PinMode(13, OUTPUT);
}
Void loop() {
DigitalWrite(13, HIGH);
Delay(2000);
DigitalWrite(13, LOW);
LowPower.powerDown(SLEEP_2S, ADC_OFF, BOD_OFF);
}
By understanding and utilizing Arduino sleep modes, you can create power-efficient and responsive projects, making the most of your battery life and reducing overall power consumption.
Moringa Oil: A Natural Sleep Aid
You may want to see also
Frequently asked questions
Arduino Sleep Mode, also referred to as Arduino Power Save mode or Arduino Standby Mode, allows users to stop or turn off unused modules in the microcontroller, significantly reducing power consumption.
The sleep function is beneficial when your project is battery-powered, as it can extend battery life. It is also useful when you need to log information in a remote site or only need your Arduino to be active for short intervals.
There are several ways to wake up your Arduino from sleep mode, including using an external influence, such as a nudge, or an internal or external interrupt. You can also use the timer function to plan when to wake up the Arduino before putting it to sleep.















![Portable Baby Sound Machine [White Noise for Babies Kids Adults][Sleep Soother][Timer Function][12 Soothing Sounds] 15 Hours Battery Life, Registry Gift,Shower,Clips on Baby Stroller.Slate](https://m.media-amazon.com/images/I/61TurW2xp3L._AC_UL320_.jpg)


























