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. Feature Requests
  3. Idea: an "upkeep" sensor type

Idea: an "upkeep" sensor type

Scheduled Pinned Locked Moved Feature Requests
14 Posts 6 Posters 2.0k Views 5 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.
  • alowhumA Offline
    alowhumA Offline
    alowhum
    Plugin Developer
    wrote on last edited by
    #1

    For simple window sensors I'd like to use MySensors devices that are normally powered off, and only come to life when the window is in it's open state. Using a magnet switch that toggles the power.

    It would be nice if the gateway could support this use case as follows:

    The node, when powered on, sends the gateway a periodic message that contains after which time it will send a new message. For example, every 3 minutes or every hour, or even a day. It could be flexible: start with a new message every minute, and after an hour switch to a message every half hour, etc.

    Here's the fun part. The gateway represents the device to its controller as a normal binary switch.

    If the node doesn't report back after the time it indicated it would, then the gateway understands the sensor has lost power, and toggles the switch back to off.

    The advantage of this is:

    • Very low power sensors, since they are essentially completely turned off most off the time.
    • Controllers don't need to implement a new MySensors type. To them it just looks like a normal binary switch.
    YveauxY mfalkviddM 2 Replies Last reply
    0
    • alowhumA alowhum

      For simple window sensors I'd like to use MySensors devices that are normally powered off, and only come to life when the window is in it's open state. Using a magnet switch that toggles the power.

      It would be nice if the gateway could support this use case as follows:

      The node, when powered on, sends the gateway a periodic message that contains after which time it will send a new message. For example, every 3 minutes or every hour, or even a day. It could be flexible: start with a new message every minute, and after an hour switch to a message every half hour, etc.

      Here's the fun part. The gateway represents the device to its controller as a normal binary switch.

      If the node doesn't report back after the time it indicated it would, then the gateway understands the sensor has lost power, and toggles the switch back to off.

      The advantage of this is:

      • Very low power sensors, since they are essentially completely turned off most off the time.
      • Controllers don't need to implement a new MySensors type. To them it just looks like a normal binary switch.
      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • alowhumA alowhum

        For simple window sensors I'd like to use MySensors devices that are normally powered off, and only come to life when the window is in it's open state. Using a magnet switch that toggles the power.

        It would be nice if the gateway could support this use case as follows:

        The node, when powered on, sends the gateway a periodic message that contains after which time it will send a new message. For example, every 3 minutes or every hour, or even a day. It could be flexible: start with a new message every minute, and after an hour switch to a message every half hour, etc.

        Here's the fun part. The gateway represents the device to its controller as a normal binary switch.

        If the node doesn't report back after the time it indicated it would, then the gateway understands the sensor has lost power, and toggles the switch back to off.

        The advantage of this is:

        • Very low power sensors, since they are essentially completely turned off most off the time.
        • Controllers don't need to implement a new MySensors type. To them it just looks like a normal binary switch.
        mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by mfalkvidd
        #3

        @alowhum the disadvantage would be that the gateway would become a controller. There are currently no state-keeping tasks in a gateway. A MySensors gateway is 100% event-driven: when it receives a message, it responds appropriately. After the response the gateway waits for the next message. There is no state and no timers.

        In the current MySensors architecture, keeping track of state is the controller’s task.

        1 Reply Last reply
        1
        • alowhumA Offline
          alowhumA Offline
          alowhum
          Plugin Developer
          wrote on last edited by
          #4

          @mfalkvidd Ah, I see. Thanks.

          Would it be something that I could "hack on"? For example, when a node sends an info message "KEEPUP 20000", then some user code running on the gateway Arduino could pick up on that and create a timer separate of the MySensors gateway code?

          mfalkviddM 1 Reply Last reply
          0
          • alowhumA alowhum

            @mfalkvidd Ah, I see. Thanks.

            Would it be something that I could "hack on"? For example, when a node sends an info message "KEEPUP 20000", then some user code running on the gateway Arduino could pick up on that and create a timer separate of the MySensors gateway code?

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

            @alowhum yes you could build a controller into the gateway. But most controllers already have similar features, with the benefit of a high level language and better debugging tools.

            1 Reply Last reply
            0
            • fritsF Offline
              fritsF Offline
              frits
              wrote on last edited by
              #6

              Wouldn't it be easier to connect the window switch to INT1 and use sleeping?

              int8_t sleep(int interrupt, int mode, unsigned long ms=0);
              int8_t smartSleep(int interrupt, int mode, unsigned long ms=0);
              

              I'd say the advantage of this is:

              Very low power sensors, since they are essentially completely turned off most off the time.
              Controllers don't need to implement a new MySensors type. To them it just looks like a normal binary switch ;-)

              1 Reply Last reply
              2
              • alowhumA Offline
                alowhumA Offline
                alowhum
                Plugin Developer
                wrote on last edited by
                #7

                @mfalkvidd But if I build it into the gateway, then it will work with all existing controllers. Otherwise I would have to get new code into all the different controllers.

                @frits, unfortunately not, as the project I'm working on is designed for beginners.

                For these sensors I will use the BBC Micro:bit, which has all kinds of sensors on board. So I suspect I can't really do what you ask. Or better put: I myself am not good enough at programming to create this.

                I could also use Arduino Nano's embedded in Nano Wireless Expansion Boards, which are great for beginners. But this means their base current is always 5Ma while powered, which would cost a lot of battery. The people I'm giving the workshops to might just be able to handle wiring those boards to a 9v battery.

                mfalkviddM rozpruwaczR 2 Replies Last reply
                0
                • alowhumA alowhum

                  @mfalkvidd But if I build it into the gateway, then it will work with all existing controllers. Otherwise I would have to get new code into all the different controllers.

                  @frits, unfortunately not, as the project I'm working on is designed for beginners.

                  For these sensors I will use the BBC Micro:bit, which has all kinds of sensors on board. So I suspect I can't really do what you ask. Or better put: I myself am not good enough at programming to create this.

                  I could also use Arduino Nano's embedded in Nano Wireless Expansion Boards, which are great for beginners. But this means their base current is always 5Ma while powered, which would cost a lot of battery. The people I'm giving the workshops to might just be able to handle wiring those boards to a 9v battery.

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

                  @alowhum yes, if the gateway could do everything controllers do, there would be no need for controllers.

                  1 Reply Last reply
                  0
                  • alowhumA alowhum

                    @mfalkvidd But if I build it into the gateway, then it will work with all existing controllers. Otherwise I would have to get new code into all the different controllers.

                    @frits, unfortunately not, as the project I'm working on is designed for beginners.

                    For these sensors I will use the BBC Micro:bit, which has all kinds of sensors on board. So I suspect I can't really do what you ask. Or better put: I myself am not good enough at programming to create this.

                    I could also use Arduino Nano's embedded in Nano Wireless Expansion Boards, which are great for beginners. But this means their base current is always 5Ma while powered, which would cost a lot of battery. The people I'm giving the workshops to might just be able to handle wiring those boards to a 9v battery.

                    rozpruwaczR Offline
                    rozpruwaczR Offline
                    rozpruwacz
                    wrote on last edited by
                    #9

                    @alowhum You say You are giving workshops to people and You don't have an idea on the topic ? Sorry for the language but this sounds ridiculous ... Handling of the interrupts is the most basic concept of the microcontrollers. Do not teach people doing stuff in the wrong way please. You want to change gateway controller and in the same time You say that You are "not good enough at programming". It sounds contradictory. To use sleeping node is much easier to do in comparison to changing the gateway code. I would even argue that doing what @frits suggested is easier than Your idea. Your idea is wrong in every possible way. For example, the power consumption in Your case will depend on the time the window is opened, so if someone prefer to have opened windows, then in his case the node will drain the battery pretty fast.
                    I hope that You will not feel like I'm attacking You :) I just want You push to the right direction.

                    1 Reply Last reply
                    0
                    • alowhumA Offline
                      alowhumA Offline
                      alowhum
                      Plugin Developer
                      wrote on last edited by
                      #10

                      @rozpruwacz Please don't make assumptions. All will be revealed in due time :-)

                      And for the hardware I'm using

                      being turned off + sipping power when window is open

                      uses less power than

                      sipping power all the time

                      rozpruwaczR 1 Reply Last reply
                      0
                      • alowhumA alowhum

                        @rozpruwacz Please don't make assumptions. All will be revealed in due time :-)

                        And for the hardware I'm using

                        being turned off + sipping power when window is open

                        uses less power than

                        sipping power all the time

                        rozpruwaczR Offline
                        rozpruwaczR Offline
                        rozpruwacz
                        wrote on last edited by
                        #11

                        @alowhum yes, probably i just don't understand what you trying to do. What is "sipping"?

                        1 Reply Last reply
                        0
                        • alowhumA Offline
                          alowhumA Offline
                          alowhum
                          Plugin Developer
                          wrote on last edited by alowhum
                          #12

                          Sipping means "using very little". Like sipping water form a cup means taking a long time to finish the drink.

                          And of course what you are saying is very true if you are trying to teach people real programming. The project I'm working on is not getting close to that though.

                          1 Reply Last reply
                          0
                          • rozpruwaczR Offline
                            rozpruwaczR Offline
                            rozpruwacz
                            wrote on last edited by
                            #13

                            ok, so I understant that You wan't to use sleep functionality after all. You just wan't additionally to be able to cut off the power totally. So I see couple of problems with that:

                            1. You will not be able to precisely keep track of the window state, unless you will send KEEPUP messages every couple of seconds which will make your node more power hungry.
                            2. Be aware of battery self discharge. According to wikipedia the 9v alkaline battery will self discharge after 5 years. And it is very easy to make a window sensor that will last 5 years. So I do not see any benefit here.

                            If you realy want to add power cutoff to your design I would suggest to add some large capacitors that will hold the charge long enough after power cutoff to send an "off" message to the controller.

                            1 Reply Last reply
                            0
                            • bjacobseB Offline
                              bjacobseB Offline
                              bjacobse
                              wrote on last edited by bjacobse
                              #14

                              This can be achievable by using a TLP5110, this device is only consuming (sipping) 35nA. and then the comment from rozpruwacz is very valid, that you need to be careful of battery self discharging

                              The you can use a switch to wakup the MCU when window is opened, and provide a resister value to TPL5110 to startup MCU once per day, to give a heartbeat signal that sensor is alive
                              http://www.ti.com/lit/ds/symlink/tpl5110.pdf

                              0_1542391196201_tpl5110.png

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


                              21

                              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