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. 💬 NModule Temperature, Humidity, Light, Door sensor shield

💬 NModule Temperature, Humidity, Light, Door sensor shield

Scheduled Pinned Locked Moved OpenHardware.io
contest2017doortemperaturei2cmysensorslightnmodule
41 Posts 4 Posters 10.6k 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.
  • D Offline
    D Offline
    dakipro
    wrote on last edited by
    #12

    I am probably annoying you with the questions, but I do hope they will benefit the board and the modules :)
    One more about magnetic reed switches, you are recommending the ones that are registering both open and closed, due to battery consumption. And it makes sense to use them, but I would like to use them outside the module casing, and it is difficult to find them with their own casing, like the "normally closed" ones (case only improves waf, but still important... :) ).
    Does it make significant difference for doors that open-close 5-10 times a day, is it worth the hassle to go for 3 pin ones and somehow improvise on the casing, or is it easier to just buy more batteries :)

    C: OpenHAB2 with node-red on linux laptop
    GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
    GW: Arduino Mega, RFLink 433Mhz

    Nca78N 1 Reply Last reply
    0
    • D dakipro

      I am probably annoying you with the questions, but I do hope they will benefit the board and the modules :)
      One more about magnetic reed switches, you are recommending the ones that are registering both open and closed, due to battery consumption. And it makes sense to use them, but I would like to use them outside the module casing, and it is difficult to find them with their own casing, like the "normally closed" ones (case only improves waf, but still important... :) ).
      Does it make significant difference for doors that open-close 5-10 times a day, is it worth the hassle to go for 3 pin ones and somehow improvise on the casing, or is it easier to just buy more batteries :)

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

      @dakipro the problem is not the number of opening of the doors. It's the time the door stays closed. Because with "normal" reed switch when the magnet is in front the switch is closed and you have some current flowing through the reed switch. It's not catstrophic but it will probably cut the battery life in half.
      You can find them on aliexpress they are not very expensive, and I see no reason to put the reed outside of casing, I suppose it's to hide the case away from view, but then you have a wire from your case to the door and it's pretty ugly too :P

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dakipro
        wrote on last edited by dakipro
        #14

        Well I can do it the easy way as you are describing it :)

        Half the battery time is significant then. I now opened one of the "simple" reeds that have their own enclosure, and it is possible to remove 2 pin reed and replace it with 3pin one (just dig out hot glue). Thin white wire from nmodule to the reed should not be noticeable in the frame.

        0_1503068394663_IMG_9115-Edit1-800.jpg

        Red is the reed switch, and yes I can put the module on the corner of the doors and have it hidden since most of the doors are open entire day. But in a few years when we redecorate I am planning to get 5V-12V in all the rooms, it will approximately come on the green circle, then I can hide entire nmodule inside the wall, and just have a thin wire to the reed sensor. (I will probably even put reed inside the frame of the doors and put wire inside the wall, but I need a proof of concept for now :) )

        C: OpenHAB2 with node-red on linux laptop
        GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
        GW: Arduino Mega, RFLink 433Mhz

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dakipro
          wrote on last edited by
          #15

          @Nca78 can you please check the "drill holes" file in the source for this shield, I was testing pcbs.io and it complained about "Gerber Normalization Failed For Layer: Drill Holes". (all works fine for the main nModule)

          On oshpark I get "I can't find a board outline file." (I get this error on oshpark for all the boards/layouts)

          C: OpenHAB2 with node-red on linux laptop
          GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
          GW: Arduino Mega, RFLink 433Mhz

          Nca78N 1 Reply Last reply
          0
          • D dakipro

            @Nca78 can you please check the "drill holes" file in the source for this shield, I was testing pcbs.io and it complained about "Gerber Normalization Failed For Layer: Drill Holes". (all works fine for the main nModule)

            On oshpark I get "I can't find a board outline file." (I get this error on oshpark for all the boards/layouts)

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

            @dakipro I will have a look ASAP at the Gerber files, I don't have access to my computer at the moment

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

              @dakipro I just tested on pcbs.io and :

              • if I put all the "design" files folder in the zip I upload, I have a "duplicate drill file" error
              • if I remove the product.txt file (which is a "legal" thing related to license but has same txt extension than drill files) then pcbs.io seems happy with the upload and shows me the "drill holes" images
              1 Reply Last reply
              0
              • D Offline
                D Offline
                dakipro
                wrote on last edited by
                #18

                Ahh... its been a few years since I ordered a pcb last time, forgot all the details :)
                Thank you, it works like you described it, I am now looking forward to making the modules :)

                btw, I found out that local library has a 3d printer I could use, so I am hoping to make a few different/similar cases for the modules.
                I am also considering the motion sensor together with light/temp/door... But I will start "simpler" for now, also waiting for your progress report on the nModule motion shield for the best sensor to pick

                Thanks again

                C: OpenHAB2 with node-red on linux laptop
                GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
                GW: Arduino Mega, RFLink 433Mhz

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dakipro
                  wrote on last edited by
                  #19

                  hi, I was just playing around with the code while I wait for the boards, and I noticed the use of
                  ArduinoSystemStatus library, as mentioned in the code

                  #include <SystemStatus.h>   // Get it here:  https://github.com/cano64/ArduinoSystemStatus
                  

                  But the library on github does not have a getVCCPercent() method as used in the code on line 262

                  currentBatteryPercent = SystemStatus().getVCCPercent(BATTERY_VCC_MIN, BATTERY_VCC_MAX);
                  

                  Do you remember where did you download SystemStatus from, I couldn't find anything on google nor github.
                  The code does not compile with library from the link above (as method is missing). I guess it is not difficult to replace it, but perhaps it is worth mentioning.

                  C: OpenHAB2 with node-red on linux laptop
                  GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
                  GW: Arduino Mega, RFLink 433Mhz

                  Nca78N 1 Reply Last reply
                  0
                  • D dakipro

                    hi, I was just playing around with the code while I wait for the boards, and I noticed the use of
                    ArduinoSystemStatus library, as mentioned in the code

                    #include <SystemStatus.h>   // Get it here:  https://github.com/cano64/ArduinoSystemStatus
                    

                    But the library on github does not have a getVCCPercent() method as used in the code on line 262

                    currentBatteryPercent = SystemStatus().getVCCPercent(BATTERY_VCC_MIN, BATTERY_VCC_MAX);
                    

                    Do you remember where did you download SystemStatus from, I couldn't find anything on google nor github.
                    The code does not compile with library from the link above (as method is missing). I guess it is not difficult to replace it, but perhaps it is worth mentioning.

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

                    @dakipro yes it's strange, all reference I find when looking for the method point to MySensors forum.
                    I don't remember writing this method, but I probably did. I will either make a proper fork of the library, or update my code to include the GetVccPercent method.
                    Before that here is the method
                    In h file in "public:" :

                        int getVCCPercent(int vccMin, int vccMax);
                    

                    In c file :

                    int SystemStatus::getVCCPercent(int vccMin, int vccMax) {
                    	int vcc = getVCC();
                    	if (vcc > vccMax) {
                    		return 100;
                    	}
                    	else if (vcc < vccMin) {
                    		return 0;
                    	}
                    	else {
                    		return (10 * (vcc - vccMin)) / ((vccMax - vccMin) / 10);
                    	}
                    }
                    
                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      dakipro
                      wrote on last edited by
                      #21

                      Thanks, I wrote something similar "inline" just to get the node out.
                      I also noticed that reed switch is not mentioned in the code (or I missed it). Not that it is difficult to implement, but maybe you have some more improvements :)

                      To be honest, I wasn't expecting any source code for the node so I really appreciate that you shared it, and also made it very clear and easy to use. I also like optimizations related to the CR battery, so thank you for that

                      C: OpenHAB2 with node-red on linux laptop
                      GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
                      GW: Arduino Mega, RFLink 433Mhz

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

                        I made a sketch for both normal and NO/NC reed switch, I will check and publish it.

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          dakipro
                          wrote on last edited by
                          #23

                          As mentioned on the nModule thread, I finally managed to get it to work.
                          And as usual, I have a few questions @Nca78 :)

                          From your photos of the module, you have a door sensor separate from the light/temperature, is that only "strategical" choice, or is it some technical limitation?
                          Meaning, would it be possible to have all of them on one sensor, as TempHumLighDoor sensor?

                          And I might be pushing it now, but... would it be possible to add a motion sensor on top of that? Can you connect two sensors on same interrupt pin? (both interrupts are occupied by the no-nc door sensor, thus leaving no interrupt for motion sensor) or is there some fancy trick that would allow both of them to be "interruptable"?

                          C: OpenHAB2 with node-red on linux laptop
                          GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
                          GW: Arduino Mega, RFLink 433Mhz

                          Nca78N 1 Reply Last reply
                          0
                          • D dakipro

                            As mentioned on the nModule thread, I finally managed to get it to work.
                            And as usual, I have a few questions @Nca78 :)

                            From your photos of the module, you have a door sensor separate from the light/temperature, is that only "strategical" choice, or is it some technical limitation?
                            Meaning, would it be possible to have all of them on one sensor, as TempHumLighDoor sensor?

                            And I might be pushing it now, but... would it be possible to add a motion sensor on top of that? Can you connect two sensors on same interrupt pin? (both interrupts are occupied by the no-nc door sensor, thus leaving no interrupt for motion sensor) or is there some fancy trick that would allow both of them to be "interruptable"?

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

                            @dakipro said in 💬 NModule Temperature, Humidity, Light, Door sensor shield:

                            From your photos of the module, you have a door sensor separate from the light/temperature, is that only "strategical" choice, or is it some technical limitation?
                            Meaning, would it be possible to have all of them on one sensor, as TempHumLighDoor sensor?

                            It's a choice, you can use them both at the same time. But for me it's not convenient as the doors are not the place where I want to put the temp/hum sensors.
                            So yes you can have a TempHumLightDoor sensor.

                            And I might be pushing it now, but... would it be possible to add a motion sensor on top of that? Can you connect two sensors on same interrupt pin? (both interrupts are occupied by the no-nc door sensor, thus leaving no interrupt for motion sensor) or is there some fancy trick that would allow both of them to be "interruptable"?

                            If you go this way the more simple is to use only interrupt 3 with a high value resistor and a normally opened reed. It will leave you with interrupt 2. Power consumption is not going to be as low as with no/nc reed, but if you're including a PIR your battery life on a CR2032 will drop severely so it won't matter much to have 2-3 uA more for the door sensor.

                            The other solution is to use pin change interrupts, it's not very difficult in itself, but you have to rewrite a sleep function that manages them as the sleep function in MySensors will not.

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

                              And no mixing interrupt from any other sensor with the no/nc reed switch will not work

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                dakipro
                                wrote on last edited by
                                #26

                                I see. How about using CR123 battery for such a "all-in-one" sensor, I see it has 5-6 times capacity of CR2032.
                                Would it be able to drive such sensor for a year perhaps (i know it is impossible to say, but just speculating)?
                                Or two AAAs?

                                C: OpenHAB2 with node-red on linux laptop
                                GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
                                GW: Arduino Mega, RFLink 433Mhz

                                Nca78N 1 Reply Last reply
                                0
                                • D dakipro

                                  I see. How about using CR123 battery for such a "all-in-one" sensor, I see it has 5-6 times capacity of CR2032.
                                  Would it be able to drive such sensor for a year perhaps (i know it is impossible to say, but just speculating)?
                                  Or two AAAs?

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

                                  @dakipro I would go for the CR123 you will last over one year with it with 1MOhm resistor for the reed switch and a AM312 PIR.
                                  AAA will have less available capacity because the AM312 will fail a bit below 2.7V so a big share of their capacity will be wasted, while CR123 will have around 10% of capacity left.

                                  1 Reply Last reply
                                  0
                                  • D Offline
                                    D Offline
                                    dakipro
                                    wrote on last edited by dakipro
                                    #28

                                    Hey, do you have any experience with rechargable CR123, regarding the "capacity/voltage loss curve" or what the name is?
                                    Meaning if rechargeable cr123 would hold enough voltage over time, as the lithium(?) ones doe?
                                    I found these for a nice price, I have positive experience with Ultrafire http://www.dx.com/p/ultrafire-3-6v-880mah-lc-16340-protected-cr123a-battery-2-pack-3273

                                    C: OpenHAB2 with node-red on linux laptop
                                    GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
                                    GW: Arduino Mega, RFLink 433Mhz

                                    Nca78N 2 Replies Last reply
                                    0
                                    • D dakipro

                                      Hey, do you have any experience with rechargable CR123, regarding the "capacity/voltage loss curve" or what the name is?
                                      Meaning if rechargeable cr123 would hold enough voltage over time, as the lithium(?) ones doe?
                                      I found these for a nice price, I have positive experience with Ultrafire http://www.dx.com/p/ultrafire-3-6v-880mah-lc-16340-protected-cr123a-battery-2-pack-3273

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

                                      @dakipro these are li-ion batteries.

                                      For Ultrafire I think like many brand they are old batteries from packs, with new end plates to mask the traces of the removed soldered connectors from their previous life. And of course a beautiful wrapping to make them look new. But you have 0 assurance that 2 batteries you buy at the same time are in fact identical, and all claims made on packaging like "protection" could be bullshit.
                                      You can check here for an example of UltraFire 16340 with 1000mAh claim that fail to reach 600 even at low load.
                                      Note the introduction test "A 16340 from a cheap and often low quality brand"
                                      http://lygte-info.dk/review/batteries2012/UltraFire 16340 1000mAh (Blue) UK.html
                                      and see the conclusion here :
                                      "Ultrafire is usual not a good brand. These cells have the rated capacity, but are not good at delivering current and the protection is doubtful."
                                      http://lygte-info.dk/review/batteries2012/UltraFire 14500 750mAh (Black-red) UK.html

                                      Use at your own risks...

                                      1 Reply Last reply
                                      0
                                      • D dakipro

                                        Hey, do you have any experience with rechargable CR123, regarding the "capacity/voltage loss curve" or what the name is?
                                        Meaning if rechargeable cr123 would hold enough voltage over time, as the lithium(?) ones doe?
                                        I found these for a nice price, I have positive experience with Ultrafire http://www.dx.com/p/ultrafire-3-6v-880mah-lc-16340-protected-cr123a-battery-2-pack-3273

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

                                        @dakipro to complete the "use at your own risks" I found the disassembly page of some Ultrafire batteries from the same guy.
                                        Not looking good...

                                        http://lygte-info.dk/info/batteryDisassemblyUltraFire UK.html

                                        1 Reply Last reply
                                        0
                                        • D Offline
                                          D Offline
                                          dakipro
                                          wrote on last edited by
                                          #31

                                          Ok, that certainly throws a new light on the matter :(
                                          Thanks for the info, I will throw all ultrafire I have at home (before I get what their name suggests) and buy some from a trusted brand.
                                          Cheers!

                                          C: OpenHAB2 with node-red on linux laptop
                                          GW: Arduino Nano - W5100 Ethernet, Nrf24l01+ 2,4Ghz mqtt
                                          GW: Arduino Mega, RFLink 433Mhz

                                          Nca78N 1 Reply Last reply
                                          0
                                          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