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. OpenHardware.io
  3. 💬 Homini In-Wall Battery Powered Light Switch Module

💬 Homini In-Wall Battery Powered Light Switch Module

Scheduled Pinned Locked Moved OpenHardware.io
inwallmysensorsin-wallswitchbatterylightcoincell
25 Posts 8 Posters 8.2k Views 6 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.
  • S Samuel235

    UPDATE

    We have a working node. We're now able to serial upload and monitor the module with thanks to @GertSanders and his bootloader.

    So the node currently has 2 switch inputs and that would be the maximum for the hardware interrupt, i may do some investigating to get another port for interrupt to enable us to have 3 switches on the one node.

    Nca78N Offline
    Nca78N Offline
    Nca78
    Hardware Contributor
    wrote on last edited by
    #6

    @Samuel235 said:

    UPDATE

    We have a working node. We're now able to serial upload and monitor the module with thanks to @GertSanders and his bootloader.

    So the node currently has 2 switch inputs and that would be the maximum for the hardware interrupt, i may do some investigating to get another port for interrupt to enable us to have 3 switches on the one node.

    Hello,
    this is an interesting project, have you considered the following points ?

    1. Use the SMD version of NRF24, it's really tiny compared to the normal version, and not that difficult to solder. It would fit in the empty part of your PCB next to atmega and the "antenna" reserved space and you would be save the space on the right part of the PCB.

    2. Link multiple switches to one interrupt pin, using diodes (as explained here : http://www.gammon.com.au/forum/?id=11091) so you can use a much higher number of inputs, including some of the analog ones).
      This will not work with standard switches that stay in ON or OFF position but it's perfect for push buttons that go back into place when released, with each light/circuit having both ON and OFF buttons.
      I find normal switches confusing as they can be in ON position physically but with the light in OFF state because it was switched off from controller. Then you have to switch OFF and then ON again on the switch if you want to have the light on. I have this at home with some di-o (433MHz) boxes behind regular switches and it really is annoying sometimes.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Samuel235
      Hardware Contributor
      wrote on last edited by
      #7

      @Nca78

      Good morning, thank you for taking your time to contribute to this project firstly, i appreciate every bit of input/advice i get given around here.

      Unfortunately i haven't had much time recently where i could futher develop my modules, however, while i wait for my most recent to be prototyped and sent to me i will spend some time looking at this maybe.

      I have recently been looking at the SMD versions of nRF24, and i must admit i do like the look of these little beauties! The board will need some alterations to fit it on but i'm sure i could get that to fit like you're suggesting. Do you happen to have a link to maybe a aliexpress or ebay where i could find some good working SMD nRF24's?

      The switch topic is a hot discussion, i have been suggested this method you speak of previously. Once question i would have though, is there many wall light switches that can act like this, not a solid on or off 'momentary' style switch? If not, this is something else i do eventually want to look into, making my own switch face too. A simple but elegant design using push buttons, tactile ones. This way it will be perfect for your solution. I don't have the issue of it being on or off when its controlled by the controller itself because i have my controller (OpenHAB) to change the state of the light when it sees a change in state on the switch, so the lighting relay or the controller doesn't care about the state of the switch, only cares if it changes.

      MySensors 2.1.1
      Controller - OpenHAB (Virtual Machine)
      Gateway - Arduino Mega MQTT Gateway W5100

      1 Reply Last reply
      0
      • Nca78N Offline
        Nca78N Offline
        Nca78
        Hardware Contributor
        wrote on last edited by
        #8

        Unfortunately I bought SMD NFR24 at a local shop, just 3 to test them. They are a bit expensive compared to aliexpress at around 2US$ but I can have them instantly and buy a small number of units. Those I have work really well, no difference with the through-hole version.
        I think I will go for capacitive switches too, I ordered some MPR121 boards from aliexpress to make some tests, up to 12 "buttons" and an IRQ pin, problem solved :)

        I see your point for the switches. You are right, not a problem used like that.

        S 1 Reply Last reply
        0
        • Nca78N Nca78

          Unfortunately I bought SMD NFR24 at a local shop, just 3 to test them. They are a bit expensive compared to aliexpress at around 2US$ but I can have them instantly and buy a small number of units. Those I have work really well, no difference with the through-hole version.
          I think I will go for capacitive switches too, I ordered some MPR121 boards from aliexpress to make some tests, up to 12 "buttons" and an IRQ pin, problem solved :)

          I see your point for the switches. You are right, not a problem used like that.

          S Offline
          S Offline
          Samuel235
          Hardware Contributor
          wrote on last edited by
          #9

          @Nca78 Ahh right okay, i will have to ask around for some working versions, or even put it on the board myself rather than buying a ready made SMT version. But anyway that is something for me to research with time.

          Capacitive switches seem a very clean method. Do you know of any controllers that are not able to customize like i have done with OpenHab where i can specify on a state change rather than the actual state of the switch itself? If there are any controllers that wouldn't allow this i need to adapt my board to those and do as you have suggested.

          MySensors 2.1.1
          Controller - OpenHAB (Virtual Machine)
          Gateway - Arduino Mega MQTT Gateway W5100

          1 Reply Last reply
          0
          • L Offline
            L Offline
            LastSamurai
            Hardware Contributor
            wrote on last edited by
            #10

            It seems to use a coincell. How well does this work? Did you have any problems? Whats your runtime?
            I am thinking about building a similar sensor too ;)

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Samuel235
              Hardware Contributor
              wrote on last edited by
              #11

              Are you asking about this module itself on a coincell or are you asking about @Nca78's solution while running on a coincell?

              MySensors 2.1.1
              Controller - OpenHAB (Virtual Machine)
              Gateway - Arduino Mega MQTT Gateway W5100

              L 1 Reply Last reply
              0
              • S Samuel235

                Are you asking about this module itself on a coincell or are you asking about @Nca78's solution while running on a coincell?

                L Offline
                L Offline
                LastSamurai
                Hardware Contributor
                wrote on last edited by
                #12

                @Samuel235 said:

                Are you asking about this module itself on a coincell or are you asking about @Nca78's solution while running on a coincell?

                Sorry, I don't really get your question ;) What do you mean with "this module"? I was talking about a atmega + nrf + some sensor run by a coincell, (in general, but in this case how @Nca78 did it).

                S Nca78N 2 Replies Last reply
                0
                • L LastSamurai

                  @Samuel235 said:

                  Are you asking about this module itself on a coincell or are you asking about @Nca78's solution while running on a coincell?

                  Sorry, I don't really get your question ;) What do you mean with "this module"? I was talking about a atmega + nrf + some sensor run by a coincell, (in general, but in this case how @Nca78 did it).

                  S Offline
                  S Offline
                  Samuel235
                  Hardware Contributor
                  wrote on last edited by
                  #13

                  @LastSamurai, my question was basically "is your question targeted to me or to @Nca78". From my understanding you're asking Nca78 how that setup would work with power from a coincell, right?

                  MySensors 2.1.1
                  Controller - OpenHAB (Virtual Machine)
                  Gateway - Arduino Mega MQTT Gateway W5100

                  L 1 Reply Last reply
                  0
                  • S Samuel235

                    @LastSamurai, my question was basically "is your question targeted to me or to @Nca78". From my understanding you're asking Nca78 how that setup would work with power from a coincell, right?

                    L Offline
                    L Offline
                    LastSamurai
                    Hardware Contributor
                    wrote on last edited by
                    #14

                    @Samuel235 Ah ok. Well its basically for everyone here who has build a coincell based mysensor node. How long can you run them?

                    S 2 Replies Last reply
                    0
                    • L LastSamurai

                      @Samuel235 Ah ok. Well its basically for everyone here who has build a coincell based mysensor node. How long can you run them?

                      S Offline
                      S Offline
                      Samuel235
                      Hardware Contributor
                      wrote on last edited by
                      #15

                      @LastSamurai, some are in excess of >3 Years with sleep enabled nodes. It all depeneds what you wish the node to do obviously. People have got the power consumption lower than that of the natural drain rate of the coincell itself.

                      MySensors 2.1.1
                      Controller - OpenHAB (Virtual Machine)
                      Gateway - Arduino Mega MQTT Gateway W5100

                      1 Reply Last reply
                      0
                      • L LastSamurai

                        @Samuel235 Ah ok. Well its basically for everyone here who has build a coincell based mysensor node. How long can you run them?

                        S Offline
                        S Offline
                        Samuel235
                        Hardware Contributor
                        wrote on last edited by
                        #16

                        @LastSamurai, There are a few links on the build page here for information regarding battery powering found here. Have a look at the link in the "Need to know more?" Section just before the buying guide section on that page. Some very useful information regarding this topic :)

                        MySensors 2.1.1
                        Controller - OpenHAB (Virtual Machine)
                        Gateway - Arduino Mega MQTT Gateway W5100

                        1 Reply Last reply
                        0
                        • L LastSamurai

                          @Samuel235 said:

                          Are you asking about this module itself on a coincell or are you asking about @Nca78's solution while running on a coincell?

                          Sorry, I don't really get your question ;) What do you mean with "this module"? I was talking about a atmega + nrf + some sensor run by a coincell, (in general, but in this case how @Nca78 did it).

                          Nca78N Offline
                          Nca78N Offline
                          Nca78
                          Hardware Contributor
                          wrote on last edited by
                          #17

                          @LastSamurai said:

                          @Samuel235 said:

                          Are you asking about this module itself on a coincell or are you asking about @Nca78's solution while running on a coincell?

                          Sorry, I don't really get your question ;) What do you mean with "this module"? I was talking about a atmega + nrf + some sensor run by a coincell, (in general, but in this case how @Nca78 did it).

                          I did a door sensor to test running on a coincell (CR2032), nothing very advanced: I use the standard script for switch with sleep, with a CHANGE interupt to get the node out of sleep. I just added some code to lower frequency at 1MHz (didn't even do it with the bootloader, I will do that next time). I measure voltage of the battery by comparing with internal voltage reference every open+close cycle (and send it only if it changed of course), and at the moment after around one month of usage I don't notice any significative change in battery level, it's fluctuating between measurements but always in the same range.
                          In sleep mode and door closed consuption is around 2uA, when door is opened I have a "big" loss of current through the reed switch, it's around 60uA (tried many values of resistors and never got a better consumption than this). Fortunately the door is closed way more than it's opened, so with the sending of status changes I expect the CR2032 to last around one year.

                          S 1 Reply Last reply
                          0
                          • Nca78N Nca78

                            @LastSamurai said:

                            @Samuel235 said:

                            Are you asking about this module itself on a coincell or are you asking about @Nca78's solution while running on a coincell?

                            Sorry, I don't really get your question ;) What do you mean with "this module"? I was talking about a atmega + nrf + some sensor run by a coincell, (in general, but in this case how @Nca78 did it).

                            I did a door sensor to test running on a coincell (CR2032), nothing very advanced: I use the standard script for switch with sleep, with a CHANGE interupt to get the node out of sleep. I just added some code to lower frequency at 1MHz (didn't even do it with the bootloader, I will do that next time). I measure voltage of the battery by comparing with internal voltage reference every open+close cycle (and send it only if it changed of course), and at the moment after around one month of usage I don't notice any significative change in battery level, it's fluctuating between measurements but always in the same range.
                            In sleep mode and door closed consuption is around 2uA, when door is opened I have a "big" loss of current through the reed switch, it's around 60uA (tried many values of resistors and never got a better consumption than this). Fortunately the door is closed way more than it's opened, so with the sending of status changes I expect the CR2032 to last around one year.

                            S Offline
                            S Offline
                            Samuel235
                            Hardware Contributor
                            wrote on last edited by
                            #18

                            @Nca78 - While using the CHANGE interrupt, is the MCU in a deep sleep or just a local one using power still?

                            MySensors 2.1.1
                            Controller - OpenHAB (Virtual Machine)
                            Gateway - Arduino Mega MQTT Gateway W5100

                            1 Reply Last reply
                            0
                            • scalzS Offline
                              scalzS Offline
                              scalz
                              Hardware Contributor
                              wrote on last edited by
                              #19

                              in deep sleep ;)

                              1 Reply Last reply
                              1
                              • TheGuvT Offline
                                TheGuvT Offline
                                TheGuv
                                wrote on last edited by
                                #20

                                Nice project!
                                A typical CR2032 ( I checked the Energizer datasheet) has a self discharge of 1% / year and a capacity of 240mAh, so that's a self discharge rate of about 2.4mA/year, or about 6.6uA per day. The ATmega328P at 3V in full power down with watchdog disabled has a supply current of about 0.6uAh (datasheet page 603). That equates to 14.4uA/day or twice the self discharge of the coin cell. Still excellent and I suppose the coin cell might last a few years if you keep the size and frequency of the transmitted packets low :)

                                1 Reply Last reply
                                1
                                • S Offline
                                  S Offline
                                  Samuel235
                                  Hardware Contributor
                                  wrote on last edited by
                                  #21

                                  @TheGuv, I'm hoping Rev3 will bring in power sensing and more interrupt enabled switches.

                                  This is at the back of my list at the moment as it works, just not 100% optimized right now. I have a couple of modules in the pipeline for release very soon now, once they're out and stable i will be optimizing this to become a better solution. Keep yourself posted to my updates if you're interest ;)

                                  MySensors 2.1.1
                                  Controller - OpenHAB (Virtual Machine)
                                  Gateway - Arduino Mega MQTT Gateway W5100

                                  1 Reply Last reply
                                  0
                                  • JahFyahhJ Offline
                                    JahFyahhJ Offline
                                    JahFyahh
                                    wrote on last edited by
                                    #22

                                    @Samuel235, I hve a much simpler question, What kind of switch are you using? A standaard light switch, did you make a custom one? Could you add a picture?

                                    S 1 Reply Last reply
                                    0
                                    • JahFyahhJ JahFyahh

                                      @Samuel235, I hve a much simpler question, What kind of switch are you using? A standaard light switch, did you make a custom one? Could you add a picture?

                                      S Offline
                                      S Offline
                                      Samuel235
                                      Hardware Contributor
                                      wrote on last edited by
                                      #23

                                      @JahFyahh About half way through the forum topic regarding this module has this image: https://forum.mysensors.org/uploads/files/1455483350043-image.jpeg

                                      A little unclear but you can see the faceplate of the switch. Its a normal wall mount light switch.

                                      MySensors 2.1.1
                                      Controller - OpenHAB (Virtual Machine)
                                      Gateway - Arduino Mega MQTT Gateway W5100

                                      1 Reply Last reply
                                      0
                                      • JahFyahhJ Offline
                                        JahFyahhJ Offline
                                        JahFyahh
                                        wrote on last edited by
                                        #24

                                        @Samuel235 Sorry I must have overlooked it, the post has grown. It looks good, AliExpress? Did you ever get the chance to look at those RF switches?

                                        S 1 Reply Last reply
                                        0
                                        • JahFyahhJ JahFyahh

                                          @Samuel235 Sorry I must have overlooked it, the post has grown. It looks good, AliExpress? Did you ever get the chance to look at those RF switches?

                                          S Offline
                                          S Offline
                                          Samuel235
                                          Hardware Contributor
                                          wrote on last edited by
                                          #25

                                          @JahFyahh - I still haven't managed to et round to it. I've been really busy since this project and its still hectic here. I'm sure i read a few reviews somewhere, here or google. Not sure.

                                          MySensors 2.1.1
                                          Controller - OpenHAB (Virtual Machine)
                                          Gateway - Arduino Mega MQTT Gateway W5100

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


                                          19

                                          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