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. Troubleshooting
  3. Nano doesn't want to sleep ?

Nano doesn't want to sleep ?

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 2 Posters 930 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.
  • D Offline
    D Offline
    DirkB19
    wrote on last edited by
    #1

    Hi,

    I never used 'sleep' before because all my nodes were powered from 220ac outlets.
    Now I have a new node which will be powered by a battery.
    The node only needs to wakeup when PIR motion is detected and do some actions.

    I tried : sleep(PIR1 - 2, CHANGE, 0);
    It doesn't seem to work. Node does not sleep and Nano consumes +-40mA as before the sleep command...

    but also simply sleep(50000) does not put my Nano to sleep.

    Does the sleep command need to be at the end of the void loop() code (as in most examples ?)

    What am I overlooking ?
    PS : I use the code IdleTimeNow = millis(); just before putting the sleep command ... could that be the reason ?

    Thanks,
    DirkB

    mfalkviddM 1 Reply Last reply
    0
    • D DirkB19

      Hi,

      I never used 'sleep' before because all my nodes were powered from 220ac outlets.
      Now I have a new node which will be powered by a battery.
      The node only needs to wakeup when PIR motion is detected and do some actions.

      I tried : sleep(PIR1 - 2, CHANGE, 0);
      It doesn't seem to work. Node does not sleep and Nano consumes +-40mA as before the sleep command...

      but also simply sleep(50000) does not put my Nano to sleep.

      Does the sleep command need to be at the end of the void loop() code (as in most examples ?)

      What am I overlooking ?
      PS : I use the code IdleTimeNow = millis(); just before putting the sleep command ... could that be the reason ?

      Thanks,
      DirkB

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

      @DirkB19 adding a serial debug print after the sleep will make it easy to see if the code stops at sleep or not.

      To get the most battery life, use a Pro Mini or Sensebender. See https://www.mysensors.org/build/battery for more details.

      Measure the power consumption of the pir. Maybe that's the component using most of the power (depends on which pir you are using)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DirkB19
        wrote on last edited by
        #3

        Hi and thanks for the tips.

        I didnt think of the PIR indeed.
        But anyways, the nano isn't sleeping because I get serial debug back from it after the sleep command.

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


        27

        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