Arduino Sleep / Wake On Interrupt?
-
Hello,
Is it possible to have the arduino in sleep mode and wake up when a message arrives to the NRF24l01 Radio?I have PIN 8 (IRQ) of the NRF24l01 connected to PIN D2 of the sleeping nano node. When the sleeping nano node goes to sleep, I send a message to the node from another , however the sleeping node does not awake when this happens. Is this possible to do?
Below is the code I am using, thanks!
#include <MySensor.h> #include <SPI.h> #define ID 0 #define OPEN 2 #define CLOSE 0 MySensor gw; MyMessage msg(ID, V_TRIPPED); void setup() { Serial.begin(115200); Serial.println("Starting up Sensor Test"); gw.begin(incomingMessage,1,false); gw.present(ID, S_DOOR); } void loop() { // Process for 10 Seconds gw.wait(10000); // Sleep 10 Seconds gw.sleep(2, CHANGE, 10000); } void incomingMessage(const MyMessage &message) { if(message.getInt() == 1){ Serial.println("Received command"); gw.send(msg.set(OPEN)); delay(250); }
-
Yes, it would be possible. But you won't save much juice as keeping radio in listening mode still requires way too much power to be able to run on batteries for any substantial time.
1 out of 2
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59 -
Radio waking up for no reason.
Development • 4 Jul 2020, 21:09 • Sasquatch 15 Jan 2025, 08:33 -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23 -
Adding Listen only device to my system.
Development • 26 Feb 2025, 00:39 • dpcons 26 Feb 2025, 06:26 -
PJON and Minicore not working
Development • 27 days ago • Trand 27 days ago