πŸ’¬ NModule Temperature, Humidity, Light, Door sensor shield





  • Hi @Nca78 I would assume that these are tested and working fine with NModule? πŸ™‚
    Thought on ordering them together with nmodule, save few bucks on the shipping...
    Or should I wait some more for hardware to be tested?
    Thanks!


  • Hardware Contributor

    Hello @dakipro !
    Thank you for the donation I'll invest it on a NModule PCB πŸ˜‰

    I have not completely tested this one, the best is you wait a few days I will finish testing in priority. No reason for any problem as it's just a small evolution of a previous unpublished version that's running fine, but it's just to be safe.

    With what sensors/reed switches are you planning to use it ? with smd of through hole leds ?



  • I didn't order any components yet so I am open for suggestions, I was thinking your "favourite combination: SMD SI7021 for temperature and humidity and a MAX44009 for light: both are very low power and both are precise and reliable."

    I was thinking about making universal switch, basically using all that board has to offer (light, temp, hum, door), that I can mount in all the rooms. I guess adding a pir would be pushing it, both for size and perhaps for battery (I could use aaa thought). I need ~9 of sensors for each door/room. Probably don't need hum and temp for each, since hallway is pretty close to all the doors, but light and doors are primary features.
    If that gets received well into "the family" then I might get another 7-8 for all the windows.
    About the casing, I do not have the 3d printer yet, but I could try with something like this http://www.ebay.com/itm/Plastic-Enclosure-Case-DIY-Electronics-Project-Box-Electrical-Equipment-1908-TB-/352080246357?hash=item51f99e3655:g:TrIAAOSwvTxUlQKf and painting them white(er) to match the door frames. They are 46mm wide inside, a bit shy for 5cm board, but enough for two AAA, and for compact nmodule.

    About the LEDs, I didn't quite get the purpose of those? What would they show?
    If it is status of doors etc, then I wont be installing them.
    But if (now my imagination steps in) they could be controller from gateway in a maner that you can signal some event with them blinking or lighting.. then perhaps πŸ™‚


  • Hardware Contributor

    @dakipro said in πŸ’¬ NModule Temperature, Humidity, Light, Door sensor shield:

    I didn't order any components yet so I am open for suggestions, I was thinking your "favourite combination: SMD SI7021 for temperature and humidity and a MAX44009 for light: both are very low power and both are precise and reliable."

    For si7021 I'm very happy with accuracy and reproductibility for temperature, I'm more mitigated with humidity. As explained in the datasheet if they stay too long with high humidity they will start to report a value that's too high when humidity gets lower. But for bedrooms it should be fine.

    I was thinking about making universal switch, basically using all that board has to offer (light, temp, hum, door), that I can mount in all the rooms. I guess adding a pir would be pushing it, both for size and perhaps for battery (I could use aaa thought). I need ~9 of sensors for each door/room. Probably don't need hum and temp for each, since hallway is pretty close to all the doors, but light and doors are primary features.
    Yes for PIR you would need either AAA or CR123, and for that one there's another NModule shield for both PIR (AM612) and light sensor πŸ˜›
    I'm not sure it's a great idea to put everything on one board as it's not convenient to put temperature sensor near the door, it will report wrong values every time you open the door. And putting only door sensor with normally opened + normally closed reed switch allows extremely long battery life with a CR2032.

    If that gets received well into "the family" then I might get another 7-8 for all the windows.
    About the casing, I do not have the 3d printer yet, but I could try with something like this http://www.ebay.com/itm/Plastic-Enclosure-Case-DIY-Electronics-Project-Box-Electrical-Equipment-1908-TB-/352080246357?hash=item51f99e3655:g:TrIAAOSwvTxUlQKf and painting them white(er) to match the door frames. They are 46mm wide inside, a bit shy for 5cm board, but enough for two AAA, and for compact nmodule.

    You should get a 3D printer πŸ˜› I bought this one for just over 200$ with shipping and you have only a few part to attach before you can start printing.
    https://www.aliexpress.com/store/product/Reprap-Prusa-i3-3D-Printer-Cabinet-Base-Easy-assembly-Aluminum-frame-more-stable-safer-The-whole/2395046_32720136567.html

    About the LEDs, I didn't quite get the purpose of those? What would they show?
    If it is status of doors etc, then I wont be installing them.
    But if (now my imagination steps in) they could be controller from gateway in a maner that you can signal some event with them blinking or lighting.. then perhaps πŸ™‚
    No on battery powered node it's not a great idea to use them as signals managed from controller.
    I use them to blink in green color when data is sent, and when battery is low they blink in red color. You could use only the red led to warn you when battery gets low.



  • What are the dimensions of the module (or the box you are showing, if possible from inside?)
    3d printer is on the shopping list, but since we just moved in new apartment, it is pretty low on the list 😞 (wife thinks we really need a sofa and other details)
    So I am trying to find some enclosures on ebay that will suit the modules


  • Hardware Contributor

    @dakipro said in πŸ’¬ NModule Temperature, Humidity, Light, Door sensor shield:

    What are the dimensions of the module (or the box you are showing, if possible from inside?)
    3d printer is on the shopping list, but since we just moved in new apartment, it is pretty low on the list 😞 (wife thinks we really need a sofa and other details)
    So I am trying to find some enclosures on ebay that will suit the modules

    Same here, moving soon but I managed to get the 3D printer before the belt tightening period πŸ˜„
    You can still suggest to 3D print those futile things like sofa, table, chairs etc

    I just measured the board you see on picture on the left (temp + light):

    • length 40mm
    • width 22.5mm, it will be 25mm if you don't cut the part for through-hole led or if you put reed switch on the side
    • height a bit less than 15mm


  • Great, I think this case should fit nicely. http://www.ebay.com/itm/5PCS-Small-Desk-top-Plastic-Enclosure-Box-Case-White-51x36x20mm-CASE-025-A1-5/192269740428
    Internally it is 43 x 28(30) x 16 . Almost perfect for us without much choice (read: without 3d printer) πŸ™‚


  • Hardware Contributor

    Hello, I have tested the following things on this shield :

    • i2c sensors
    • door sensor: simple reed switch and NO/NC reed switch
    • led: through hole and SMD
    • running on CR2032 battery

    Everything is fine, so I'm removing the "work in progress" flag πŸ™‚



  • Awesome!

    Just a question, the CR2032 battery would be "sandwiched" between the nmodule and the shields?

    Also, if the shield is not used, then the battery would be on the same side where the radio is (based on photos), but are you then using the "power" part of the board as the shield? Or wiring it manually? Or does the "power" part acts as another "power shield"?
    Would be great if you could elaborate this part, maybe on the nmodule itself, about how to assemble it together with the cr2032 battery (or maybe I missed something 😞 )

    p.s. you can update the shields description in the table with shields on the main module https://www.openhardware.io/view/364/NModule#tabs-instructions


  • Hardware Contributor

    @dakipro yes it is, you can see the edge of the CR2032 on the first picture in NModule project.

    You have 2 different way to do it for the battery:

    • use shield with CR2032 holder, like this one of the ADXL shield, in this case the battery is inserted from the side between NModule and the shield
    • use "power" part of the NModule, in this case the CR2032 holder and capacitor on the shield are left empty, the board is wider but it will be thinner because you can put the shield very close to NModule

    It just depends on what is more suitable for your use case, what enclosure you found etc.

    Here are some images I think it will makes things more clear than writing 3 pages of explanations.
    (I use those for testing so I use headers to be able to plug various shields, of course final soldered boards should be soldered to be more thin and more rigid)

    NModule with "power" part used for CR2032 and 2xAAA:
    0_1502938056104_IMAG1880.jpg

    NModule with no "power" part and using the CR2032 on the Door/TH sensor shield:
    0_1502938067242_IMAG1881.jpg



  • 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 πŸ™‚


  • Hardware Contributor

    @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 πŸ˜›



  • 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 πŸ™‚ )



  • @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)


  • Hardware Contributor

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


  • Hardware Contributor

    @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


  • 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



  • 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.


  • Hardware Contributor

    @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);
    	}
    }
    


  • 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


  • Hardware Contributor

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



  • 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"?


  • Hardware Contributor

    @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.


  • Hardware Contributor

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



  • 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?


  • Hardware Contributor

    @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.



  • 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


  • Hardware Contributor

    @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...


  • Hardware Contributor

    @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



  • 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!


  • Hardware Contributor

    @dakipro said in πŸ’¬ NModule Temperature, Humidity, Light, Door sensor shield:

    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!

    It should be fine with a good charger and if you avoid discharging them too low.
    You can check the lygte website for other battery brands the guy tested a lot of them. Soshine brands seems ok.



  • I just managed to fry the only working module I've build so far (life got some other plans for my spare time).
    I just took it in a hand to show it to a friend, and logs show no activity since. The battery was 99%, and now it is 1V. I tried powering it from the power supply, but the voltage drops from 3V to 0.1V, indicating that something is shorting it out. Resistance between gnd and vcc is not 0, so it is not direct connection between them, but I guess static did its thing and some component died, leaving entire module non-functioning 😞
    So... when you build one, make sure you put it in the case and do not touch it with bare hands
    (I remember holding it on the edges to avoid touching the circuits, but I still managed to fry it)


  • Hardware Contributor

    Wow that's bad news and very strange, I manipulated a bunch of NModule boards without special precaution and never fried any.
    It would be nice to investigate about what went wrong, maybe I can improve the design in some way.

    Did you cut the "power" part of the board ? Could be two cut traces too close to each others, or something similar.
    You can contact me by private message if you want to discuss it.


  • Hero Member

    Speaking generally, the radio module tends to be the most likely component to fail.. Try replacing that and see if it works again. Or, more conservatively, just unsolder the radio module and then see if you can talk to the mpu again.



  • Good news, node works as expected after I removed the light sensor and changed the battery.

    After removing MAX44009 light sensor and testing again, i realized that I was connecting both plus and minus to the same pin 😒 that is why power supply was showing shortage 😞

    Unfortunately, I am not very skilled at desoldering so light sensor is not usable anymore. I cannot tell if that sensor was actually the problem or not (most likely not).

    But it looks like the battery has just depleted. After I took it out of the node, it was showing 1.3v then I tested with power supply (connecting it wrong) and that is why I assumed I have fried something. I changed the battery and module is working fine now. Strange is that it was reporting 100% battery level all the time, and while assembling I was changing voltage on the power supply down to 2.4V and it was reporting 40% as expected.
    So... it is not impossible that something depleted the battery the day I touched the sensor, logs show exact time it stopped working (when I touched it).

    But I will consider it as a false alarm for now, and time will tell... I hope πŸ™‚
    Thanks everyone for assistance!


  • Hardware Contributor

    @dakipro that's good news, it's not expensive to replace a max44009.
    That case (shortcut with CR2032 leading to quick death of the battery) happened to me so I would bet the light sensor was not the culprit πŸ˜‰

    Did you use a desoldering pump ? With some extra solder to keep the soldering joint hot longer, high iron temperature and a quick suck with a desoldering pump, it's not that difficult to unsolder.



  • It happened again, my wife moved the sensor (which was, you guessed it, without enclosure) and it stopped working due to empty battery. And of course, to make debugging more difficult, this happened with similar 2-3 months period since it happened last time. Since you have some nodes whose battery lasts more then a few months, it has to be something mechanical that happens and shortens the battery, or that another combination of circumstances empties the battery and that the node doesn't manage to report correct voltage/capacity.

    Doesn't have to mean anything significant, except the "motivation" for people to make a housing for the nodes πŸ™‚


  • Hardware Contributor

    @dakipro and was it working before ?
    Which script are you using ? Maybe it lost radio link because of the moving and the script went into an endless loop, killing the battery ?

    Sounds very strange to me to generate a shortcut just by touching/moving the sensor...



  • No idea to be honest... It is the same node that was working fine, then something killed the battery (in the same timeframe when it was touched), then I removed light sensor MAX44009 and it worked fine with new battery, but then again similar thing happened just recently.

    It sounds reasonable that it could be that radio gets stuck when being touched and then never connects again. Node was actually moved closer to the gateway, so I don't think it is the range issue.

    The code is the one you provided (somewhere), I just modified few lines about interval if I remember correctly (I changed it to 5min i think).

    Just reporting if someone else experiences the similar behavior


  • Hardware Contributor

    Hello,

    I'm thinking about upgrading this board to include pinout for LIS3DH breakout board, like this one :
    https://www.aliexpress.com/item/LIS3DH-Three-Converters-Motion-Accelerometer-Triaxial-Acceleration-Temperature-Sensor-Module-Development-Board-Replace-ADXL345/32840326778.html

    and ditch the ADXL shield as it's not a good solution, it has either the ADXL345 which uses too much power, or the ADXL362 which is ultra low power but lacks advanced functionality like tap/double tap detection.

    I would like to have feedback of users on this (do it sound useful ?), and also know if anyone uses the SMD footprints on the board, for leds and for reserve capacitors, as it could be a cleaner board without those footprints.

    I would make the following changes :

    • put footprint for LIS3DH accelerometer along the "NModule connector" as it has too many pins to put elsewhere
    • keep only one I2C footprint on the side, for "GY-49" MAX44009 light sensor breakout board: https://www.aliexpress.com/item/GY-49-MAX44009-Ambient-Light-Sensor-Module-for-Arduino-with-4P-Pin-Header-Module/32828654450.html
    • temperature/humidity would be via the existing "SMD" footprint, it's not through hole but very easy to solder as it's 2.54mm pad spacing
    • remove SMD footprints for LED, add footprint for through hole reserve capacitor, keep SMD footprints for reserve capacitors only if I have space for them
    • shield would be a bit extended to go over the 2 M2 holes in the "power" part of the NModule, so it could be fitted with spacers and nylon screws and have stable/reliable mechanical connection between NModule and Shield. Basically this would be the footprint of the shield : 0_1527422032044_c8e52cd0-47fe-4a5e-b6a3-554e216603cc-image.png

    So in the end it would make one shield to have Temperature/Humidity/Light/Acceleration or Temperature/Humidity/Light/Door.



Suggested Topics

  • 116
  • 47
  • 21
  • 226
  • 2
  • 5
  • 1
  • 3

13
Online

11.4k
Users

11.1k
Topics

112.7k
Posts