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 1.1k 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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        17

        Online

        12.0k

        Users

        11.2k

        Topics

        113.4k

        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