Sleep time accuracy
-
I have 1h sleep time.
#define SLEEP_TIME 300000*12
However, it takes 1h14min30sec to report to Domoticz the next value.
I am running atmega328p 8Mhz internal clock.How can I improve a sleep function accuracy please assuming the node is used internally (20-22C and 2-3V voltage range)
-
@alexsh1 divide the selected sleep time with the actual time and adjust the number?
When the atmega328 is sleeping, the watchdog timer is used to measure time spent. It is not designed to be accurate.
A rtc module can be used to get more exact timing.
-
@mfalkvidd Yeah, that's what i started doing and ended with 459059 for 10 minutes. Let's see if this is more accurate.
Appreciate it is not designed to be super accurate, but 15 mins every hour is just too much imho.
-
@then you'll need to get a mcu that is more accurate or get a rtc.
http://www.avrfreaks.net/forum/improving-watchdog-timer-accuracy describes a calibration method that might be useful.
-
@mfalkvidd I may look at Anarduino - they come with RTC:
ATmega328, 16Mhz LDO Voltage Regulator 128 Mbit flash memory Real Time Clock (RTC) 64B RTC Static Ram Tactile Reset Switch Wireless Transceiver Size: 33 x 22.8mm
Suggested Topics
-
Update RF24 library to latest version
Bug Reports • 23 Mar 2014, 23:37 • andriej 24 Mar 2014, 22:52 -
ESP32 with LoRa
General Discussion • 31 Jan 2023, 11:06 • dhanushmh a day ago -
Meet in Malmö, Summer 2016?
General Discussion • 1 Feb 2016, 15:34 • bjacobse 4 Mar 2025, 00:29 -
Is it possible to extract child ID from a just sent message?
General Discussion • 8 Nov 2021, 09:21 • Nigel31 4 days ago -
No merge into master in the last 5 years, should we use development?
General Discussion • 23 Sept 2024, 17:48 • kiesel 9 days ago -
Email notifications received twice
General Discussion • 6 Feb 2023, 16:15 • Jodaille 8 days ago