We just launched a new product: Collectives on Stack Overflow. How do they work? Listen to learn more.

Questions tagged [sleep]

Sleep refers to a form of power management, where the processor can be instructed to enter various levels of "sleep". Use this tag for discussions about sleep mode.

Filter by
Sorted by
Tagged with
13
votes
2answers
12k views

Put ATmega328 in very deep sleep and listen to serial?

I have investigated the sleeps options of the ATmega328, and read a few articles about it, and I would like to understand if there are more options. So I would like to get as low current as possible, ...
8
votes
1answer
12k views

How to generate hardware interrupt in mpu6050 to wakeup arduino from SLEEP_MODE_PWR_DOWN mode?

I am using Arduino UNO and has kept in SLEEP_MODE_PWR_DOWN mode & want it to wakeup using MPU6050 hardware INT pin (which should send a signal when MPU is in motion). I have used the article https:...
6
votes
1answer
565 views

Choosing right Sleep state

I'm planning on building an LED clock, but I want it to be lit only when I press the POWER button on my remote control. Using an IR receiver, which Arduino sleep mode should I use to reduce the ...
5
votes
2answers
2k views

How to deep sleep ATtiny/ATmega (to run for years with batteries) but still detect a button press?

Question (TL;DR): what is the optimal method to deep sleep (to run an ATtiny45 or ATmega on batteries for 1+ year) but still be able to detect a button press? Is it possible to deep sleep until a ...
5
votes
4answers
3k views

How to keep accurate millis() while using ADC_sleep mode?

millis() uses timer0 (linked to CPU clock) to count time, but ADC_sleep mode stops the CPU clock, therefore millis() will drift (lag behind) after each ADC conversion performed in ADC_sleep mode. ...
5
votes
1answer
120 views

Converting a standard setup/loop sketch to a low power application?

Suppose I have a typical setup/loop style sketch, such as this one which turns on an LED when a button is pressed. How do I modify this so that it enters low power mode, awakes on the button press, ...
5
votes
2answers
2k views

How can I use PWM in power saving mode (ATmega328)?

I fail to use PWM in power saving mode. The output behaves erratically. This should be possible, I guess. The following is a minimal working example: /* MWE: Cannot use PWM in any power saving ...
4
votes
2answers
1k views

SIM800L and Arduino Sleep - getting whimsy Serial output after 5 calls

i'm working on project where i'm trying to achieve that arduino parse caller ID so i can use it later to send SMS with sensor reading data. Somehow i made that code (with much googling) and it works ...
3
votes
2answers
4k views

How best to power down an Arduino for ~5 minutes at a time?

Reading over the datasheet it appears the longest it can shutdown for is 8s so should I just keep a counter in the loop method that checks if it's run 38 times and then execute the code I want? Would ...
3
votes
2answers
7k views

IR Receiver interrupt and arduino sleep mode

I need to put my arduino into the sleep mode in order to consume less power. My arduino receives IR data and do some work with it, but I need to make it sleep until there is no data. If the data has ...
3
votes
1answer
731 views

Why does my Arduino keep waking up?

This is my first post. Please excuse me if this is a repost, but I couldn't find a similar question via search. I have some experience with Arduino and I'm looking to utilize AVR's sleep mode in a ...
3
votes
1answer
1k views

Why does using ESP8266 in deep sleep mode still drain the battery quickly?

I've made a "weather station" using the ESP8622. To save battery I'm using sleep mode but still the battery is drained after a couple of days. According to this post it should last at least a year. I ...
3
votes
2answers
732 views

Is there a way to set an interrupt to go off after a certain period of time?

I'm trying to save power by putting my device to sleep once it has run through the code once and turn it back on every 33 milliseconds. So basically, if the code finishes executing in 20 milliseconds ...
3
votes
1answer
1k views

Accelerometer Interrupt Meaning - Wakeup Function

I am working with an LSM9DS1 IMU, and now specifically trying to program a wakeup feature into the system. My idea is to set the accelerometer at the lowest possible read rate, then when the ...
3
votes
2answers
930 views

Trouble with sleep mode and interrupts

Context I am building a small battery powered counting device. As with many other projects like this, saving power is critical. I am therefore trying to utilise the sleep mode wherever possible. This ...
3
votes
2answers
356 views

Unstable system when controlling power to serial peripheral devices and sleeping

In the process of trying to make a small system that will last a while on 4 AA batteries, I've reduced my Arduino project to a barebones system that when asleep draws a tiny amount of current from the ...
3
votes
0answers
50 views

ESP8266 requires two resets to wake up from deep sleep

I'm working with the following circuit using a NodeMCU: I have the solder jumper bridged between RST and BTN. In addition to what's in the schematic, pins 2, 3, and 4 of J1 are connected to the ...
3
votes
1answer
255 views

How to wake up Arduino with an rtc?

I am doing a data logger with an Arduino Mega2560 and I want to use a code to make it sleep when no measure is needed and wake it up with an RTC when time comes. The reason I want this is because I ...
2
votes
2answers
2k views

Attiny85 appears to be drawing 0.2mA current but battery running down more quickly

I am trying to get a temperature sensor (tmp36) working with an Attiny and if possible I would like it to run for several weeks. I have tried to power down the Attiny and it appears to be drawing only ...
2
votes
1answer
5k views

ESP.deepSleep() - over and over?

Important note: the esp.deepsleep function uses microseconds, not milliseconds. I posted another question here asking for clarification on how an RTC can be used to put a NodeMCU 12 to sleep for a ...
2
votes
1answer
603 views

WDT and RadioHead with delay()

The core I use is this one The chip I use is an ATtiny85 I run this using the Arduino IDE 1.8.2 RadioHead ASK library (slimmed down) What I want to do is: deep sleep wake up every minute turn on ...
2
votes
3answers
2k views

Arduino Project Power Consumption Calculations

I have built an automated window blind controller that will adjust the angle of a servo based on the value received via a light dependent resistor. Once every 10 minutes the MCU wakes up, gets the ...
2
votes
2answers
556 views

Works for 2-3 hrs, then LED blinks rapidly - Sleep Mode and Watchdog timer wakeup

I hope somebody can shed some light on this problem. I've researched the internet and forums and noticed that others have experienced similar problems. This sketch runs fine for a couple of hours......
2
votes
1answer
154 views

Push and hold on/off switch for arduino

Many electronic devices turn on/off, or more correctly on/sleep, by pressing a button and holding it for two or three seconds. I would like to put this ability into a project using an Adafruit Feather ...
2
votes
1answer
74 views

Using external reset to trigger radio receipt

I am designing a low-power RF application using an ATTiny (Adafruit Trinket). When the system receives a radio signal, it needs to read some sensors, and transmit with that data. Because I am short ...
2
votes
1answer
778 views

Attiny45 wake by Software Serial

I would like to wake Attiny45 from sleep by Serial communication. RX is connected to pin 7 (D2). When I try to use PCINT0_vect routine, I get an error "multiple definition of `__vector_2'" so it looks ...
2
votes
2answers
351 views

Millis() does not back to zero after woke up from deep sleep mode

I am going to make a project that needs four boards of Arduino which synchronization in time is needed. The project is about capturing the timestamp (in ms resolution) whenever something is crossing ...
2
votes
1answer
2k views

PIR sensor and sleep (interrupt) on Mega2560

So I was starting to gain some knowledge on the PIR sensor and how to let the Arduino 'sleep' while there is no movement detected by the PIR. I found the following code somewhere and looked fairly ...
2
votes
1answer
139 views

ESP8266 wakeup from deep sleep: Both by timer and button?

In a project powered by batteries, the ESP8266 should go to deep sleep for long time, having RF disabled. After some number of sleep cycles, it shall restart with RF enabled, synchronize time via NTP, ...
2
votes
0answers
143 views

Wake up from a pin, Sleep when work is done

I have a project which needs to sleep most of the time, and when a button gets pressed, it does its thing which is producing a fading sound wave (using interrupts) until it's time to sleep again. The ...
2
votes
1answer
649 views

attiny85 reset itself instead of wakeup procedure

I have a digispark attiny85, and I am using SLEEP_MODE_PWR_DOWN to sleep, and wake-up with external interrupt on pin2. I am trying to count number of interrupts received with the code below. Problem ...
2
votes
0answers
520 views

Is it possible to put ATtiny85 to sleep while using TinywireS?

I have an arduino uno as the master I2C device talking to an ATtiny85 as the slave. What I want to do is have the Attiny85 receive a message from the UNO to tell it to power off which will then ...
2
votes
0answers
163 views

Hacking a Chinese Audio Selector Board: IRLib2 with Low Power Sleep Issue [closed]

I have an issue getting an arduino based hacked-board to sleep whilst performing ir remote commands properly. What am i hacking? Exactly this: tl;dr it's a 4 in 1 out audio selector with motorised ...
2
votes
0answers
284 views

Sleep mode Arduino Due through IR receiver control

I need to put my Arduino Due into sleep mode in order to consume less power. My Arduino Due receives IR data and does some work with it, but I need to make it sleep until there is no data. If data ...
2
votes
2answers
2k views

Reduce current consumption on ATtiny85

I am trying to reduce current consumption on my project. Right now it is using ~1.28mAh, it should be possible to get it much lower (I am using AA batteries as the power source). The ATtiny85 has its ...
1
vote
2answers
195 views

Can I set pin 13 to output 5v, then put arduino mini pro to sleep?

Can I set pin 13 to output 5v, then put arduino pro mini to sleep and it maintains 5v going through pin 13 while in sleep mode? I know there are various "levels" of sleep - can a voltage be ...
1
vote
2answers
133 views

Store value in EEPROM to perform different actions on reset?

I want the same button to wake up (reset) and put it to sleep but this is hard if the button is tied directly to the rst pin. My thought was to read and store a value in EEPROM so tell the chip what ...
1
vote
3answers
3k views

Sleep mode and months of operation on small battery

In context of getting the MCU on Pro Mini and ATMega2560 (chip is ATmega328 and ATMega 2560) to sleep and power down modes, so as to run on one set of battery for months, appreciate idea and comment. ...
1
vote
1answer
531 views

Is SRAM erased when putting Arduino into sleep_mode_pwr_down?

Question In the interest of reducing power consumption, I am putting the Arduino into sleep mode between taking sensor readings. However, the data from readings are stored in arrays, and must not be ...
1
vote
1answer
1k views

Waking Arduino from sleep by holding button for more than 3 seconds

I am working on a battery powered Arduino project, where I need to put a standalone Arduino in sleep mode (to save some battery). My aim is to put Arduino in sleep mode by holding a button for 3 ...
1
vote
1answer
457 views

Power consumption issue. I made project using atmel-328p

I made project using atmel-328p. I want to run it over a year. I am using power_down mode & 5500 mAh li-ion battery still battery discharges in 1 day. I am using standard code as explain on ...
1
vote
1answer
26 views

How to get time from RTC after wake up from sleep?

I have a setup with an Arduino Pro Mini, a DS1307 RTC, a microSD shield and a microswitch. I've set an interrupt to the microswitch, so it'll wake up the Arduino when it changes status. Here is some ...
1
vote
1answer
84 views

Knowing if ESP32 wakes up itself or manually

I have a project where I put an ESP32 to deep sleep for a certain amount of time, eg: 1h To be able to self-awaken a cable must be connected from GPIO 16 to the reset pin, so basically the ESP pulls ...
1
vote
1answer
66 views

Input Capture with Sleep Enabled on ATM32u4 board only works every second reading in SLEEP mode

In short: I have an Input Capture code and a Power-Saving code combined into one program. Both are adapted from Nick Gammon's examples that work fine independently. When I combined them into one ...
1
vote
1answer
854 views

How ro re-enable 32u4 USB controller after sleep mode?

I've run into quite the problem with my 32u4, I can't get it to reconnect to the computer upon wakeup from a sleep mode! So I have an Arduino Pro Micro featuring the 32u4, and I'm also designing a ...
1
vote
1answer
107 views

Why can I wake Arduino only once with this code?

This is my enhanced code for a daylight alarm on Arduino UNO with an added MP3-Player. The device is supposed to sleep all the time except when I hit the play button (then it is supposed to play music)...
1
vote
2answers
3k views

Sleep power down mode with change interrupt

I want to use to use an IR sensor as an interrupt to wake up my Arduino Uno R3 from the deep sleep power mode and then go back to sleep after changing the state of the relay. Lets say if I press a ...
1
vote
1answer
667 views

ATTiny85 433Mhz with sleep

I would like to micromize my Arduino project and move it to ATTiny85. The first step was using sleep functions because I just want it to run once a day. Now I need to connect the 433Mhz stuff but I'm ...
1
vote
1answer
31 views

Receiver sleep mode RDA5807M

Good afternoon guys! I have a radio receiver connected to an arduino and I want it not to work all the time, but to turn on by the arduino timer for a certain time, and the rest of the time the ...
1
vote
1answer
2k views

NodeMCU 12E V2 Power Saving

I'm powering a NodeMCU with 4 x AA batteries (6v, ~9,600mAh). I am running ESP.deepSleep([milliseconds]) to minimize power consumption. Even with deepSleep I am seeing a precipitous drop off in ...