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. Hardware
  3. Energy efficiency of interrupted sleep

Energy efficiency of interrupted sleep

Scheduled Pinned Locked Moved Hardware
6 Posts 3 Posters 2.1k Views 3 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.
  • Moshe LivneM Offline
    Moshe LivneM Offline
    Moshe Livne
    Hero Member
    wrote on last edited by
    #1

    My next sensor will check if the aircon is on or not by checking reed switch. As this status does not change very frequently and there is no urgency in knowing that it changed, I have two ways of doing it:

    1. checking the reed status every minute and between checks gw.sleep(SLEEP_TIME)
    2. connecting the reed to digital 3 and waking up using gw.sleep(INTERRUPT,CHANGE, SLEEP_TIME);

    these are going to be battery powered. I expect no more then 10 changes a day. Is there a power consumption price to pay for waiting on interrupt?

    YveauxY 1 Reply Last reply
    0
    • rvendrameR Offline
      rvendrameR Offline
      rvendrame
      Hero Member
      wrote on last edited by
      #2

      I don't see any disadvantage in using the interrupt. 10 times per day is much less than 86,400 minutes ;-)

      However, if the aircon is fixed installed --- Why not powering the node with a bulk phone charger or so? You should have AC Mains near by...

      Home Assistant / Vera Plus UI7
      ESP8266 GW + mySensors 2.3.2
      Alexa / Google Home

      Moshe LivneM 1 Reply Last reply
      0
      • rvendrameR rvendrame

        I don't see any disadvantage in using the interrupt. 10 times per day is much less than 86,400 minutes ;-)

        However, if the aircon is fixed installed --- Why not powering the node with a bulk phone charger or so? You should have AC Mains near by...

        Moshe LivneM Offline
        Moshe LivneM Offline
        Moshe Livne
        Hero Member
        wrote on last edited by
        #3

        @rvendrame no, they are wired directly to the circuit breaker board.
        As in both cases the sensors will spend 99.999999% of their time sleeping, my question was if there is a difference in power consumption between "deep sleep" and "waiting for interrupt" sleep. I wouldn't think there is but trying to make sure.

        1 Reply Last reply
        0
        • Moshe LivneM Moshe Livne

          My next sensor will check if the aircon is on or not by checking reed switch. As this status does not change very frequently and there is no urgency in knowing that it changed, I have two ways of doing it:

          1. checking the reed status every minute and between checks gw.sleep(SLEEP_TIME)
          2. connecting the reed to digital 3 and waking up using gw.sleep(INTERRUPT,CHANGE, SLEEP_TIME);

          these are going to be battery powered. I expect no more then 10 changes a day. Is there a power consumption price to pay for waiting on interrupt?

          YveauxY Offline
          YveauxY Offline
          Yveaux
          Mod
          wrote on last edited by
          #4

          @Moshe-Livne I don't expect it to make a difference. According to the ATmega328 datasheet (pg 40) all sleep modes support both INT0/INT1 and WDT as a wake-up source. WDT is used by MySensors to implement the sleep()-method.
          And when in doubt, just measure it yourself to be sure!

          Btw. Better use level-triggered interrupt to wake the ATMega from sleep, to stick to the datasheet!

          http://yveaux.blogspot.nl

          Moshe LivneM 1 Reply Last reply
          0
          • YveauxY Yveaux

            @Moshe-Livne I don't expect it to make a difference. According to the ATmega328 datasheet (pg 40) all sleep modes support both INT0/INT1 and WDT as a wake-up source. WDT is used by MySensors to implement the sleep()-method.
            And when in doubt, just measure it yourself to be sure!

            Btw. Better use level-triggered interrupt to wake the ATMega from sleep, to stick to the datasheet!

            Moshe LivneM Offline
            Moshe LivneM Offline
            Moshe Livne
            Hero Member
            wrote on last edited by
            #5

            @Yveaux my ucurrent is swimming across the pond as we speak....
            Thanks for checking this for me - I can't read these datasheets. Not sure about the last part of your reply. In what way is it better?

            YveauxY 1 Reply Last reply
            0
            • Moshe LivneM Moshe Livne

              @Yveaux my ucurrent is swimming across the pond as we speak....
              Thanks for checking this for me - I can't read these datasheets. Not sure about the last part of your reply. In what way is it better?

              YveauxY Offline
              YveauxY Offline
              Yveaux
              Mod
              wrote on last edited by
              #6

              @Moshe-Livne said:

              In what way is it better?

              The datasheet states that to wake an ATMega from sleep from a PIN0/1 interrupt it should be configured as LEVEL interrupt, not CHANGE (second parameter to gw.sleep() )
              It is likely to work when configured for CHANGE, but under certain conditions the interrupt may not be detected correctly by the ATMega.

              http://yveaux.blogspot.nl

              1 Reply Last reply
              1
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              15

              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