Skip to main content

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
2 answers
14k 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, ...
Curnelious's user avatar
8 votes
1 answer
19k 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:...
bandejiya's user avatar
  • 307
6 votes
3 answers
11k 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 ...
Basj's user avatar
  • 398
6 votes
1 answer
622 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 ...
Paolo Zanchi's user avatar
5 votes
1 answer
138 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, ...
Mark Harrison's user avatar
5 votes
4 answers
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. ...
FarO's user avatar
  • 339
5 votes
2 answers
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 ...
stefan's user avatar
  • 153
4 votes
2 answers
2k 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 ...
user3613833's user avatar
3 votes
2 answers
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 ...
Ryan Detzel's user avatar
3 votes
2 answers
8k 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 ...
CROSP's user avatar
  • 141
3 votes
1 answer
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 ...
Christian's user avatar
  • 131
3 votes
1 answer
6k 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 ...
acpilot's user avatar
  • 653
3 votes
1 answer
3k views

ESP32 can not deep sleep longer than 35 minutes

I'm trying to get my Lilygo T5 4.7" epaper to deep sleep for 12 hours. But I only seem to be able to get about half an hour (2100s) of deepsleep on it. If I set the timer for longer, it just ...
Engberg's user avatar
  • 33
3 votes
1 answer
783 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 ...
CamK's user avatar
  • 91
3 votes
1 answer
2k 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 ...
Alex K's user avatar
  • 219
3 votes
2 answers
1k 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 ...
Dan Evans's user avatar
3 votes
2 answers
1k 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 ...
JamesONeil's user avatar
3 votes
1 answer
6k views

ESP8266 deep sleep and MQTT

I am working on a project were I am putting my board into deep sleep mode, and it wakes up with an interrupt from a sensor. When it wakes from deep sleep I would like to send a message to my MQTT ...
Paul Carlson's user avatar
3 votes
2 answers
1k 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 ...
Angel Lockhart's user avatar
3 votes
2 answers
409 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 ...
J.B's user avatar
  • 131
3 votes
0 answers
73 views

ESP8266 requires two resets to wake up from deep sleep [duplicate]

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 ...
Florian Ragwitz's user avatar
3 votes
0 answers
705 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 ...
SpeedOfSpin's user avatar
2 votes
2 answers
3k 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 ...
Shara's user avatar
  • 125
2 votes
3 answers
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. ...
EEd's user avatar
  • 904
2 votes
1 answer
498 views

Arduino Nano Atmega328P not sleeping with either <LowPower> or <avt/sleep.h>

I'm working on a battery powered Arduino Nano project. I really need it to save power for hours on end, so I turned to Arduino LowPower Library and avr/sleep.h to do the job. However, whatever I do, ...
Santanor's user avatar
  • 123
2 votes
2 answers
225 views

Arudino receiving interrupt command BEFORE entering sleep mode causing it not to receive any interrupt commands in order to wake up

I've written code for an Arduino Nano that when a button is pressed, it sends an IR command. It is set so that if no button press has been received for a period of 10 seconds, it will enter sleep mode ...
99natmar99's user avatar
2 votes
1 answer
989 views

ATtiny85 won't wake from sleep

My ATtiny 85 won't wake up! The purpose of the device is to monitor a reed switch and give a 20 ms output pulse on every alternate positive-going transition of the reed switch input. The device should ...
Transistor's user avatar
2 votes
1 answer
693 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 ...
Thijs's user avatar
  • 432
2 votes
3 answers
2k views

How can I maintain switch state when in sleep mode?

I'm using a esp8266 to build a remote control to power a gas fireplace. I'm using this guide to try and maximize battery life. The concept is the controller uses its built in WiFi to access a ...
WhiskerBiscuit's user avatar
2 votes
3 answers
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 ...
darksidekilo6's user avatar
2 votes
2 answers
860 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 ...
jendiiw's user avatar
  • 21
2 votes
1 answer
347 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 ...
PhotoKevin's user avatar
2 votes
1 answer
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 ...
user29961's user avatar
2 votes
1 answer
731 views

Waking up async the Arduino while it's sleeping periodically [duplicate]

I´m using LowPower.h and PinChangeInt.h libraries to put my Arduino into the sleep mode every 8 seconds and then it wakes up, modifies a counter and it goes to sleep again, but also I need to wake it ...
cpinamtz's user avatar
  • 175
2 votes
2 answers
674 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......
Jaime's user avatar
  • 21
2 votes
1 answer
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 ...
YTZ's user avatar
  • 147
2 votes
1 answer
885 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 ...
lakotamm's user avatar
2 votes
1 answer
354 views

ATtiny85 giving multiple wake from IDLE if INT0 held low

Desired behaviour: Go to IDLE sleep mode. When PB2 (blue trace) goes low wake up and give a 10 ms HIGH on PB1 pulling a pull-up low (yellow trace on Figure 1). Go to 1. What I get: Figure 1. (1) ...
Transistor's user avatar
2 votes
3 answers
2k views

ESP8266 wakeup from deep sleep, both by timer and by button

In a project powered by batteries, the ESP8266 should go to deep sleep for a long time, having RF disabled. After some number of sleep cycles, it should restart with RF enabled, synchronize time via ...
ridgy's user avatar
  • 181
2 votes
1 answer
99 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 ...
baum's user avatar
  • 133
2 votes
0 answers
101 views

ESP8266-01S only coming back from DeepSleep every 2nd time

I'm using an ESP8266-01S for a battery-powered project. The ESP is in DeepSleep, a doorbell relay pulls RST to GND, bringing the ESP to life to do some stuff, before going back to DeepSleep. My ...
Jan's user avatar
  • 151
2 votes
0 answers
140 views

Why isn't my ESP32 staying in Deep Sleep longer than 35 minutes?

I've been having an odd issue with a new custom ESP board. I can't push deep-sleep time past 35 minutes no matter how I adjust the timing. Below is my current pertinent code, but basically the device ...
Mulcch's user avatar
  • 19
2 votes
0 answers
341 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 ...
B7th's user avatar
  • 167
2 votes
1 answer
1k 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 ...
ozkolonur's user avatar
  • 121
2 votes
0 answers
179 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 ...
Orbitronics's user avatar
2 votes
0 answers
359 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 ...
Ibn Sina's user avatar
1 vote
2 answers
226 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 ...
Owen's user avatar
  • 143
1 vote
1 answer
3k views

ESP8266 RTC memory (for bootcount)

I'm using an ESP8266 with deep sleep + wake up when RST pin goes low. #include <ESP8266WiFi.h> #include <WiFiClient.h> #include <ESP8266HTTPClient.h> WiFiClient client; HTTPClient ...
Basj's user avatar
  • 398
1 vote
2 answers
3k views

How to keep track of millis during sleep mode

In my application, I need to keep track of the time the application has been running as well as use sleep modes. However, when using the sleep modes, Timer0 is disabled, and therefore millis stop ...
Glyn Davidson's user avatar
1 vote
2 answers
168 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 ...
Ryan Detzel's user avatar