Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Sleep time accuracy

Sleep time accuracy

Scheduled Pinned Locked Moved General Discussion
5 Posts 2 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • alexsh1A Offline
    alexsh1A Offline
    alexsh1
    wrote on last edited by alexsh1
    #1

    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)

    mfalkviddM 1 Reply Last reply
    0
    • alexsh1A alexsh1

      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)

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @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.

      alexsh1A 1 Reply Last reply
      2
      • mfalkviddM mfalkvidd

        @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.

        alexsh1A Offline
        alexsh1A Offline
        alexsh1
        wrote on last edited by alexsh1
        #3

        @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.

        mfalkviddM 1 Reply Last reply
        0
        • alexsh1A alexsh1

          @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.

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by mfalkvidd
          #4

          @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.

          alexsh1A 1 Reply Last reply
          0
          • mfalkviddM mfalkvidd

            @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.

            alexsh1A Offline
            alexsh1A Offline
            alexsh1
            wrote on last edited by
            #5

            @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
            
            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            24

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular