Low Power Arduino! Deep Sleep Tutorial
Why Arduino Stack Exchange recommends it
Arduino Stack Exchange users link it as the go-to tutorial for ATmega328 sleep modes, wake-up interrupts and watchdog timer wake-ups.
Recommended by 3 people across 3 different months, 2016 to 2020.
What it is
Kevin Darrah walks through putting a bare ATmega328P into deep sleep without libraries, getting current draw down to about 0.287 uA at 5V and 16 MHz. He shows how to wake the chip from a push-button interrupt and from the internal watchdog timer, with the code available for download.
What people said
Recommends A. Orchard · 2016-11 · Arduino Stack Exchange · on “Wake Arduino (Atmega328) from sleep with ADXL345 interrupt”
So I'm relatively new to microcontrollers, and I'm having a problem implementing a feature I want for a project. I've learned about putting an Atmega328P to sleep from this tutorial [this video] . I'm using an Arduino Nano, so I only get my current down to ~9mA rather than the µAs the tutor is getting. Nonetheless, it demonstrates the abstraction I want to learn for when I move to just the Atmega328 with no board. I've learned to wake up my microcontroller from sleep with a falling external interrupt on INT0/D2 from a simple button. My ISR is empty and just boots me back to the loop, which is fine. As an aside, I have heard that it is better to have simple and short ISR's, but I am not completely
Recommends AJ_Smoothie · 2019-07 · Arduino Stack Exchange · on “How to get interrupt while in sleep mode?”
Where does init_sleep() come from? I did my a little differently by directly accessing registers but I know you have to disable sleep mode in your "wake up" ISR as the first thing before anything will happen. Watch this tutorial, it is very good. [this video]
Recommends Tono Nam · 2020-07 · Arduino Stack Exchange · on “Is it required to delete variables before going to sleep?”
This tutorial shows how to put the arduino to sleep and use a watchdog to wake up at intervals: [this video] I been studding c++ and as I am getting better I am instantiating objects with the new keyword. I have learned that if you create something with the new keyword you are responsible for deleting it from memory when you no longer needed. But I do not know if this applies when you put arduino to sleep. Anyways my question is in the comments of the code: Foo * someObject; void setup() { someObject = new Foo(arg1, arg2, ..); // crete an instance of someObject // init pins etc.. } void loop() { if(button1Pressed()) { // **** DO I HAVE TO DELETE OBJECTS BEFORE GOING TO SLEEP? Do I need this line?