8
votes
How to generate hardware interrupt in mpu6050 to wakeup arduino from SLEEP_MODE_PWR_DOWN mode?
Well, this code worked. In this code, MPU's INT PIN is Active Low so generates Ground on motion which is than connected to INT0 or arduino UNO pin 2 which generates interrupt and wakes UP the MCU
#...
7
votes
IR Receiver interrupt and arduino sleep mode
This is what I have managed to achieve ...
Library
IRLib - GitHub
Version 1.51 March 2015
Copyright 2013-2015 by Chris Young http://tech.cyborg5.com/irlib/
This library is a major rewrite ...
7
votes
Accepted
How to deep sleep ATtiny/ATmega (to run for years with batteries) but still detect a button press?
ATTINY's are designed to easily do this since they can wake from power down sleep mode by a pin change...
Basically you want to...
Connect a normally-open push button between an IO pin and ground....
6
votes
Accepted
Converting a standard setup/loop sketch to a low power application?
This sketch is almost identical to the powerDownWakeExternalInterrupt.ino sketch that comes with the LowPower Library. I'm using INPUT_PULLUP and a N.O. push button switch to trigger it to wake up and ...
5
votes
Accepted
Attiny85 appears to be drawing 0.2mA current but battery running down more quickly
2.9V doesn't sound too bad. See a datasheet for the CR2032 I found:
It looks like slightly more than 2.9V would be the expected voltage for up to 600 hours.
3.2V looks like it is fully charged, and ...
5
votes
Accepted
Arduino Nano Atmega328P not sleeping with either <LowPower> or <avt/sleep.h>
I don't know about the LowPower library. However, four your
avr-libc-based test, you forgot to actually put the device in sleep
mode with sleep_mode():
void loop() {
set_sleep_mode(...
5
votes
ESP8266 RTC memory (for bootcount)
The ESP8266 RTC has 512 bytes of RAM that persist across restarts but not during power outages. While this RAM isn't persistent across power outages it also doesn't have the write limitations that ...
4
votes
Accepted
How to sleep a whole circuit?
The first and most smart solution is to use a switch between the batteries and everything else. This way, you slide the switch in the off position and the whole circuit is completely detached from the ...
4
votes
Accepted
Waking Arduino from sleep by holding button for more than 3 seconds
You won't manage it without external circuitry.
The problem is the Arduino has to be awake to know you held the button for 3 seconds. You can only wake immediately you press the button. However you ...
4
votes
Accepted
ESP.deepSleep() - over and over?
Use a resistor between GPIO16 and RST. I usually use a 470 Ohm resistor. Shorting the pins with a wire does not work.
https://www.esp8266.com/viewtopic.php?t=14350#p64510
Maximum deep sleep is about ...
4
votes
Accepted
Use lowpower-libary and still use serial connection and other things
Yes, activating low power does disable the UART - but only while it's sleeping.
To use serial you just need to ensure that you only use it while it's not sleeping - and due to the interrupt and ...
4
votes
Accepted
Is SRAM erased when putting Arduino into sleep_mode_pwr_down?
Generally, Atmega sleep modes do not erase RAM. Their memory is static and as long as voltage (above 2.7V I believe) is applied, data is held.
However, this also depends on how you plan to wake up ...
4
votes
Why does using ESP8266 in deep sleep mode still drain the battery quickly?
The example shows a Sparkfun Thing, which the article notes doesn't have extra peripherals. What you show is something different, like a NodeMCU dev board, which typically has a linear regulator, ...
4
votes
Store value in EEPROM to perform different actions on reset?
While it looks interesting as idea, IHMO you have keep in mind:
Include some code for button denouncing logic. Actually you will receive couple of “resets” during ~20ms during button press. Without ...
4
votes
Accepted
Can Arduino go in and out of Sleep or Deep Sleep Automatically?
The Arduino goes into deep sleep when you tell it to. It wakes up when it gets an interrupt. What that interrupt is is (pretty much) up to you.
If you are using an RTC most will have an alarm function ...
4
votes
Accepted
Arduino Leonardo/Pro Micro sleep and USB
The Arduino has several sleep modes. They differ mainly by the clocks
that are kept running, the peripherals that are enabled, and the
possible wake-up sources. All these modes are described in the
...
3
votes
Accepted
Why does my Arduino keep waking up?
Yes. Arduino's buffered serial output is interrupt-based, in that it uses interrupts to refill the UART transmit register when it runs empty, until the software-managed transmit buffer has been ...
3
votes
Accepted
High power consumption during power down mode
I tried your first sketch on my "bare-bones" board.
With the sketch exactly as written, it used 197 µA.
I wondered why it was that high, so I commented out this line:
Serial.begin(9600);
That ...
3
votes
How to put arduino in sleep mode?
avr/sleep.h is part of the compiler. You don't need to download it.
There are other libraries that act as a wrapper to it to make life easier:
https://github.com/lowpowerlab/lowpower
https://github....
3
votes
Accepted
How to keep accurate millis() while using ADC_sleep mode?
Rather than trying to update TCNT0, it might be better to track the number of cycles lost to ADC conversions, and in an intermediate routine – eg, omillis() – compensate for those cycles. [Edit: See ...
3
votes
Accepted
WDT and RadioHead with delay()
The RH_ASK library uses timer0, which is also used for millis and delay.
Quick workaround is to use the standard AVR delay instead.
#include <util/delay.h>
...
_delay_ms(500)
3
votes
Can I set pin 13 to output 5v, then put arduino mini pro to sleep?
Given the absence of clarity on the driving state of pins during sleep, consider connecting Pin 13 to an SR Latch or the gate of a MOSFET.
An SR Latch will hold it's output high or low until a high ...
3
votes
Accepted
Can I set pin 13 to output 5v, then put arduino mini pro to sleep?
can a voltage be maintained on a pin for all/any of the sleep modes?
yes.
3
votes
Accepted
Pin change interrupt does not work properly to wake up arduino from sleep mode
Start by checking your calculation of time limits. I see you are mixing signed and unsigned arithmetics - not a very good idea. Check the blink-without-delay example for how to do that.
The ...
3
votes
Accepted
Sleep power down mode with change interrupt
You actually don't need to to worry about interrupts at all for this
project. The IRremote library is itself based on a timer interrupt. As
soon as you irrecv.enableIRIn(), you start receiving a ...
3
votes
Accepted
Why can I wake Arduino only once with this code?
All your music playing code is inside a interrupt. While an interrupt is running all other interrupts are disabled. It's advised to keeps interrupt routines as short as possible.
You could have the ...
3
votes
Accepted
How ro re-enable 32u4 USB controller after sleep mode?
You're making it too hard on yourself.
There is a method to re-start the USB, but it only works if the USB has been properly stopped - and the method that is supposed to do that is empty.
This is a ...
3
votes
Waking Arduino from sleep with an ultrasonic sensor
In order to make the ultrasonic sensor work, the Arduino has to run some code to control it. So it won't do anything while the Arduino is asleep.
What you can do is have the Arduino sleep for some ...
3
votes
Accepted
Can't create a RTC_DATA_ATTR var inside a class
You can't put an RTC_DATA_ATTR qualified variable inside a class because the class is stored in normal RAM. The RTC_DATA_ATTR qualified variable is, by definition, stored in RTC RAM.
The definition ...
3
votes
How to keep track of millis during sleep mode
The only way to keep millis() running is sleep mode is to sleep in
SLEEP_MODE_IDLE. Switching to Timer 2 would make no difference, as
all timers but the watchdog are stopped in other sleep modes. The
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sleep × 163interrupt × 37
power × 33
esp8266 × 29
arduino-uno × 21
attiny × 18
esp32 × 12
atmega328 × 12
arduino-pro-mini × 11
serial × 7
nodemcu × 7
timers × 7
attiny85 × 7
arduino-mega × 6
arduino-nano × 6
battery × 5
reset × 5
deep × 5
arduino-ide × 4
avr × 4
rtc × 4
atmega32u4 × 4
sensors × 3
c++ × 3
usb × 3