Combined sleepmode
-
Hi,
I have a battery powered sensor node with motion and temperature.
The sensor wakes up on interrupt from motion sensor but when there is no motion i would like it to wake up say every minute to send the temperature.Can this be done with the sleep library?
-
If you will open a datasheet for atmega328p on page 38 you will see all sleep modes http://www.atmel.com/Images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet.pdf
the most saving mode is power-down. But in this mode you cannot wake from a regular timer but you can wake from a watchdogto wake from a regular timer the best option will be power-save
actually there is no need in any library because power management is just a manipulation of some registers.
for me the use of the macros defined by #include <avr/sleep.h> is sufficient
The #include <avr/wdt.h> is sufficient to configure watchdog
just take into account that not all arduino bootloaders are supporting watchdog, in some cases an upgrade is neededall standard includes are described in avrlib user guide http://www.nongnu.org/avr-libc/
search it for sleep functions and sleep.h usage
-
Ok thanks!
i'll give it a try and see if i can figure it out.
-
So, did you find out if it possible to combine wake up interrupts (timer and input level)?
-
No, unfortunately i couldn't get it to work.
It was to complicated for me.