💬 Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel
-
I just now posted Version 2. I changed the form factor to make it more compact. In addition, it now has a ground plane on the back. The whole thing is now roughly the size and shape of a CR2032 button cell battery.
The BOM for Version 2 is also a little different different: thru-hole rather than surface mount CR2032 holder and an (optional) 4-pin SMD header.
-
Hello,
you have a mistake in your BOM for the nRF51822-04, it's linking to battery holders.
Would you consider changing the pads for the SMD header to this ?
http://www.molex.com/pdm_docs/sd/878980426_sd.pdf
This is what is recommended for this header that's available on Arrow, meaning free shipping for most of the world, as opposite to Digikey asking me for 75$
Product on arrow is here. It is in fact smaller so it should fit on the pads you have put, but I suppose it will be easier to solder with the bigger pads.
https://www.arrow.com/en/products/0878980426/molexThere are some 2x5 1.27mm IDC connectors on AliExpress here but they have smaller inside space than the one you choosed so I'm a bit worried...
https://www.aliexpress.com/item/20Pcs-0-050-1-27-mm-2x5-Pin-10-Positions-IDC-Male-Box-Header-Dual-Row/32813323776.html
-
Also, what about moving the led to the center next to its resistor, it would leave enough space to squeeze in a SOT 23 ultra low power hall sensor and it's 100nF capacitor.
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
Also, what about moving the led to the center next to its resistor, it would leave enough space to squeeze in a SOT 23 ultra low power hall sensor and it's 100nF capacitor.
Thanks for the suggestion. What would the hall sensor be used for?
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
you have a mistake in your BOM for the nRF51822-04, it's linking to battery holders.
Thanks for pointing that out. I've fixed it now. Also, the link for the CR2032 thru-hole holder didn't post correctly to the correct entry, so I've fixed that too.
-
@NeverDie said in CR2032 Small Wireless Temperature-Humidity Sensor:
Thanks for the suggestion. What would the hall sensor be used for?
For a door sensor. This PCB is small enough to be hidden inside a door edge, if you put it on top with a small magnet in the frame it's completely invisible and you've got that mythical 100% WAF level
There is a cheap version, TLE4913 that's available on AliExpress (less than 2$ for 10 with shipping), it's consuming around 4uA so it's not extremely energy efficient but you can't beat the price on AliExpress.
https://www.aliexpress.com/item/in-stock-can-pay-TLE4913-4913-SOT-23/32823499977.htmlThen there's the DRV5032 from TI that had the lowest power consumption a few month ago when I bought it, it's 0.5$ on Arrow and needs only 0.54uA in the FB (5Hz) version
https://www.arrow.com/en/products/drv5032fbdbzr/texas-instrumentsAnd now I see the si7201 for 1$ on Arrow, using only 400nA.
My choice would still be for the DRV5032, but the good news is all those sensors are using the same package with the same pin assignment. There are a few others (including one that scalz used in one of his design) also with the same pin assignment.
-
Hmmm.. I don't presently have a need for a door open/close sensor. However, if I could use it to tell me whether the deadbolt is locked or unlocked, that would be useful.. Maybe if I epoxied a magnet on the tip of the deadbolt? Or is there some other, better way?
-
@NeverDie said in CR2032 Small Wireless Temperature-Humidity Sensor:
Hmmm.. I don't presently have a need for a door open/close sensor. However, if I could use it to tell me whether the deadbolt is locked or unlocked, that would be useful.. Maybe if I epoxied a magnet on the tip of the deadbolt? Or is there some other, better way?
Yes you can use it for that. Maybe magnetizing the deadbolt could work too ?
-
There may be enough space within the deadbolt lock cavity itself to mount a wireless sensor there. It's something I've wanted for quite a while but until now I've never had (and couldn't find) something small enough to fit in there.
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
Maybe magnetizing the deadbolt could work too ?
Great idea.
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
There are some 2x5 1.27mm IDC connectors on AliExpress here but they have smaller inside space than the one you choosed so I'm a bit worried...
https://www.aliexpress.com/item/20Pcs-0-050-1-27-mm-2x5-Pin-10-Positions-IDC-Male-Box-Header-Dual-Row/32813323776.htmlThose are thru-hole, not SMD.
I actually prefer thru-hole for these 10-pin connectors--much easier to solder--but I'm afraid the resulting solder/pin bumps on the back side would make the CR2032 holder sit a bit crooked (?), if you know what I mean.
That said, I've found buttoncell holders that have little plastic alignment pins on them (meant to fit into alignment holes) that could jack up the holder a bit if the alignment holes were omitted. Maybe then there'd be enough clearance.
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
Would you consider changing the pads for the SMD header to this ?
http://www.molex.com/pdm_docs/sd/878980426_sd.pdf
This is what is recommended for this header that's available on Arrow, meaning free shipping for most of the world, as opposite to Digikey asking me for 75$
Product on arrow is here. It is in fact smaller so it should fit on the pads you have put, but I suppose it will be easier to solder with the bigger pads.
https://www.arrow.com/en/products/0878980426/molexYes, but what's holding me back is that I'm worried I might plug it in backward and possibly fry something. Haven't really thought it through though. Maybe there's actually no risk if that were to occur? The one and only advantage of the box header is that I can't accidentally plug it in wrong.
But I've been thinking along similar lines. I've already ordered and received this from your favorite source:
https://www.aliexpress.com/item/25-pcs-2x5-P-10-Pin-1-27-mm-Male-PCB-Header-Dual-row-Straight-PCB/32762274575.html?spm=a2g0s.9042311.0.0.ltfMrUand
@Nca78 Would those be equivalent to the Molex that you linked to, or would the Molex you linked to be better?
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
This is what is recommended for this header that's available on Arrow, meaning free shipping for most of the world, as opposite to Digikey asking me for 75$
In any event, these should work the same as the Digikey ones: https://www.aliexpress.com/item/10-Pcs-SMT-Box-Header-1-27mm-2x5-P-10-Pin-dual-row-Straight-Male-surface/32787313045.html?spm=2114.10010108.1000013.3.2b0cc1askqPA1&traffic_analysisId=recommend_2088_2_90158_iswistore&scm=1007.13339.90158.0&pvid=a04bdf37-bc7e-4b9e-850f-b5e285ab3ff0&tpp=1
-
Also, there may be a clearance problem with the current PCB layout. Not sure if a si7021 or BME280 were installed whether or not it would overlap or collide with the 10-pin box connector. So, that may be yet another reason to do a Version 3.... Didn't notice it as a possible problem until after I had posted Version 2. A workaround would be to install the si7021 or BME280 upside down, so that the board points outward rather than inward. That might be acceptable also. It would somewhat defeat the compactness objective, but the antenna has to stick out a bit anyway, so that's already happening to some degree.
-
Does anyone know where we can get the connector that's used on the nRF52 DK? It would seem to be ideal: 10-pin, and keyed, but no box surrounding it.
-
Aha! Found one: https://www.digikey.com/product-detail/en/samtec-inc/FTSH-105-01-F-DV-K/SAM8796-ND/2649974
Not cheap on Digikey though.
-
Also, since the back of it is almost entirely ground plane anyway, it seems ripe for using a smaller profile CR2032 battery holder, such as: https://www.digikey.com/scripts/DkSearch/dksus.dll?Detail&itemSeq=243085164&uq=636456618668326452
Not only would it be thinner, but maybe (?) I could also shave a few millimeters off the PCB diameter .
So, yeah, I'm definitely open to improving the design.
-
Hello @NeverDie, the Molex connector was used to replace the I2C connector that you have used, not the IDC one.
Good link you have found for the SMD version, didn't notice the one I found was through holes, SMD version is much better I agree.
That 2.75$ thing on Digikey is way too expensive, I would go for the box version.
-
@NeverDie said in CR2032 Small Wireless Temperature-Humidity Sensor:
Also, since the back of it is almost entirely ground plane anyway, it seems ripe for using a smaller profile CR2032 battery holder, such as: https://www.digikey.com/scripts/DkSearch/dksus.dll?Detail&itemSeq=243085164&uq=636456618668326452
Not only would it be thinner, but maybe (?) I could also shave a few millimeters off the PCB diameter .
So, yeah, I'm definitely open to improving the design.
Your link is broken, looks like a search result and not a product page
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
Your link is broken, looks like a search result and not a product page
Thanks for letting me know. Not sure what's going wrong. When I click on the link, it takes me right there.
Hmmmmm... The manufacturer's part number is "BK-913-TR". Try entering that into the search field on digikey. It's the one for $0.38.
-
I've just now uploaded Version 3, which fixes an overlap issue in Version 2 between the 10-pin connector and the optional Si7021/BME280. AFAIK, everything should work now.
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
Then there's the DRV5032 from TI that had the lowest power consumption a few month ago when I bought it, it's 0.5$ on Arrow and needs only 0.54uA in the FB (5Hz) version
https://www.arrow.com/en/products/drv5032fbdbzr/texas-instrumentsThanks for the links. I think I'll first try putting the Version 3 TH sensor into the deadbolt cavity and see what kind of range I get with that. It might be seriously impaired, since it will have metal on 2-3 sides. If I'm getting usable signal though at a decent range, then at that point I'll look into adding the DRV5032 to the board.
-
Yesterday I received an CR2477 button cell holder, and it appears that it can easily substitute for the CR2032 in the BOM: the pins seem very much aligned.
https://www.digikey.com/product-detail/en/mpd-memory-protection-devices/BH1000G/BH1000G-ND/140383
Therefore, if you want a battery with roughly 4x the mah and which can also support a higher current drain than a CR2032, it's a good option.
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
Your link is broken, looks like a search result and not a product page
-
I just now uploaded some demo source code that will make the node into a proper MySensors temperature node.
-
I just now uploaded the Version 4 files. The new design uses the more compact CR2032 battery holder discussed above.
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
Also, what about moving the led to the center next to its resistor, it would leave enough space to squeeze in a SOT 23 ultra low power hall sensor and it's 100nF capacitor.
Yes, with the Version 4 design serving as the basis, I think there will be enough room to do this.
I'd also like to add a light sensor of some kind: something that will trigger an interrupt when, say, a refrigerator light goes on or off (for the case where the temperature node is in a refrigertor or freezer). Do you have any particular suggestions for that? A simple photoresistor, or would there be something better (lower current)?
-
Low current light sensor with interrupt, you have OPT3001 and MAX44009. MAX44009 has the lowest power but it doesn't have the same availability (not on Arrows for example).
If you're planning to use it from breakout board (as they are boath really tiny) then MAX44009 is the best choice as it's cheaper on AliExpress.If you want one that you can solder by hand you can check VEML7700, it's cheap, has low power consumption (2uA) if you use a low refresh rate. But it goes only down to 2.5V so you will lose a bit of the capacity of the button cell, and it has no interrupt pin.
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
Also, what about moving the led to the center next to its resistor, it would leave enough space to squeeze in a SOT 23 ultra low power hall sensor and it's 100nF capacitor.
Done. I just now uploaded Version 5, which has the TI hall effect sensor.
-
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
MAX44009 has the lowest power but it doesn't have the same availability (not on Arrows for example).
If you're planning to use it from breakout board (as they are boath really tiny) then MAX44009 is the best choice as it's cheaper on AliExpress.Looks as though if I add just one more header pin, then I can use this board:
https://www.aliexpress.com/item/MAX44009-Ambient-Light-Sensor-Module-with-4P-Pin-Header-Module/32729312303.html?spm=2114.search0204.3.47.XOZuu8&ws_ab_test=searchweb0_0,searchweb201602_4_10152_10065_10151_10344_10068_10130_10345_10324_10342_10547_10325_10343_10546_10340_10341_10548_10545_10541_10562_10084_10083_10307_10178_10060_10155_5680017_10154_10056_10055_10539_10537_10312_10536_10059_10313_10314_10534_10533_100031_10103_10073_10102_10557_10558_10142_10107-10178,searchweb201603_25,ppcSwitch_4_ppcChannel&btsid=ca20f561-ad43-4536-b09f-7856bf41fbb2&algo_expid=0601cfd8-6d07-4336-aefc-c06bc54166ac-2&algo_pvid=0601cfd8-6d07-4336-aefc-c06bc54166ac
That way I could capture the interrupt.
-
OK, I just now uploaded the files for Version 6, which does just that. Unless someone can think of another sensor to add, I think this will be the final version (unless errors are discovered).
-
I'm quite a noob, but totally with the NRF. Interesting PCB, I'll try asap to put a sensor together!
-
I made one last change to add water leak detection to it. I just now uploaded the version 7 files.
-
I have the Version 1 design now working with the si7021 breakout board that I got from Aliexpress. Note that if you use these breakout boards, remember to remove the voltage regulator and solder bridge across the two pins as shown in the photo below:
This is because the coin-cell voltage is already in the desired range, and so there's no need for further voltage reduction.
-
Is v7 already for CR2477? BOM still mentions CR2032
-
@Toyman said in Small Wireless Temp/Humidity Leak/Magnet/Light/Accel Sensor:
Is v7 already for CR2477? BOM still mentions CR2032
If I had kept the same button cell holder as some of the earlier version it would be. However, I switched to a narrower profile battery holder in the BOM (which benefits the leakage sensor part of the design). Not sure if an equivalent CR2477 holder is still available with the new design. Haven't checked. When I brought up the possibility of a CR2477 earlier, it didn't seem to generate much enthusiasm at the time. So, I took that to mean most people weren't really interested.
-
Nice project!
What about adding two resistors to measure and send the battery level as well?
-
@krisha said in Small Wireless Temp/Humidity Leak/Magnet/Light/Accel Sensor:
What about adding two resistors to measure and send the battery level as well?
not needed. You can measure the battery voltage without a divider.
-
I just now uploaded the Version 8 files, which contains pads for an optional 100uF ceramic capacitor. Thank you to @nca78 and @scalz for the suggestion.
-
Now reads temperature and humidity from the si7021 and sends the values to Domoticz for graphing:
-
...another n00b question: what are the PCB dimensions?
-
@ghiglie said in Multi-Sensor: Temp/Humidity Leak/Magnet/Light/Accel:
...another n00b question: what are the PCB dimensions?
The diameter is 27.15mm.
-
@NeverDie Thanks! I'll ask the fab if they can do it without charging extra costs. Or I'll "square" it - maybe with a hole in the angles to screw it. Really like this design.
-
@ghiglie What is it that you'd want to screw it to? It might be easier to just tape it or glue it in place. It's light enough that it wouldn't need much holding strength. Screwing may be overkill.
-
@NeverDie said in Multi-Sensor: Temp/Humidity Leak/Magnet/Light/Accel:
@ghiglie What is it that you'd want to screw it to? It might be easier to just tape it or glue it in place. It's light enough that it wouldn't need much holding strength. Screwing may be overkill.
I was thinking about the top of a door... You'r right, I overestimated its weight.
-
@ghiglie said in Multi-Sensor: Temp/Humidity Leak/Magnet/Light/Accel:
@NeverDie said in Multi-Sensor: Temp/Humidity Leak/Magnet/Light/Accel:
@ghiglie What is it that you'd want to screw it to? It might be easier to just tape it or glue it in place. It's light enough that it wouldn't need much holding strength. Screwing may be overkill.
I was thinking about the top of a door... You'r right, I overestimated its weight.
If you've never tried them, these things are great:
https://www.amazon.com/Command-Poster-Hanging-60-Pairs-17024-60ES/dp/B01FIK56Q4/ref=sr_1_3?ie=UTF8&qid=1510769859&sr=8-3&keywords=3m%2Bcommand%2Bmounting&th=1
They have a lot of holding power (more than ample for one of these sensors), and yet they can be cleanly removed without damaging the surface you hang it on.3M also has a velcro-like version so that you can attach, then detach and re-attach as much as you want.
-
First, the good news: it works! I've uploaded photos of the version 7 board that I just today received and put together. It powered up without a hitch and started sending temperature and humidity values to Domoticz like a champ. The one caveat is that I will need to increase the board diameter by a couple of millimeters, as there presently just isn't enough proper physical separation between the supportive male leak detection pins and the CR2032 battery holder. So, I will do that, and I will post a version 9 after I have received and tested the improved boards.
-
@NeverDie Thanks! Here in Italy they's sold with another name, but it's still a 3M branded one. I'll look for a pack!
-
I have uploaded version 9. This should fix the physical clearance issue. Also, I upgraded the cap to be a 1206 220uF ceramic capacitor, as the cost is nearly the same as for an 0805 100uF capacitor. I should think that 220uF will offer plenty of reserve for the future when the battery ultimately develops a high internal resistance.
-
More good news: I today received the PCB for a revision of my PIR module that's meant to be compatible with this Multi-Sensor. I just now did a dry-fitting, and, indeed, it should all fit together just fine:
That means the entire PIR sensor can be quite small and compact!
-
For PIR capability, the multi-sensor can simply plug into this PIR module: https://www.openhardware.io/view/420/AM612-Passive-Infrared-Sensor-Breakout-Board
-
I have an experimental version in the works which uses a micro USB connector instead of the 10-pin connector. The advantage is that it can be connected from the side rather than above, which means the PIR sensor can be snuggled up close to the rest of the Multi-Sensor PCB and then permanently soldered into place:
The result would be an even more compact PIR sensor.Once there's an OTA bootloader, though, this issue will become moot, and so I think for most people the 10-pin solution will be easier, especially for noobs.
-
@nca78 Which do you think would be the best accelerometer to use? If affixed to a garbage can, for instance, it should be able to detect the trash can being emptied by the garbage truck.
-
@NeverDie said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
@nca78 Which do you think would be the best accelerometer to use? If affixed to a garbage can, for instance, it should be able to detect the trash can being emptied by the garbage truck.
That's a very tough question
For low power the best is ADXL362 but it can only be controlled using SPI which is a problem for that specific NRF51 module. And it's not that convenient as low power comes with limited "advanced" capabilities that would be useful for this kind of sensor: tap/double tap detection, free fall detection, ...I'm making a board with the same nrf51 module and my choice is LIS3DE because it has those advanced functions and can go as low as 2uA, it's very cheap (<1$) and it's small, but I'm only using the chip and not a breakout board. There are LIS3DH breakout boards on AliExpress, it's similar but the boards are big as they map all pins in a row. Only board with less pin is nearly as expensive as some NRF51 + LIS3DE combo so it's not worth buying the breakout.
I will make a version with a LSM303AGR too, it has accelerometer + magnetometer. Magnetometer is power hungry but you can use it only when accelerometer detects some movement, so you know the orientation of the sensor. That way you could easily know the difference between your garbage can being moved around, and it being turned over in the garbage truck. But here again bad news in term of breakout boards, the LSM303 breakout boards available are not the -AGR version, and I'm not sure they can run the accelerometer in a real low power way (LSM303AGR is 3.7uA in lowest power accelerator mode).
There are also some Bosh accelerometer but using more current (6.5uA for BMA255 for example) and same problems with the breakout boards: they are huge.
Sorry, no good answer to your question as there's no compact, low power, i2c compatible breakout board that I know about. If you want to use a breakout board my advice is to go for ADXL362, and if you're out of pins with this nrf51 module you can hardwire the chip select pin to save one.
-
@NeverDie you can also measure tilt using an accelerometer (acceleration measured is the gravity in that case) but it's possible only if there is no movement, so I don't think it's usable in a garbage truck processing.
-
I guess it's the land of compromise. By default I'm going with the BMA220, if only because the board is small and the low power mode current drain is 10ua: https://www.aliexpress.com/store/product/DFRobot-BMA220-3-Axis-Triple-Axis-Accelerometer-sensor-2-0-3-6V-I2C-Interface-Tiny-size/1681007_32791058717.html
It's not cheap, but I only need a couple: one for trash can and the other for a curbside recycling bin.You're right though: maybe all I need is some kind of tilt detector, like maybe a mercury switch of some kind. Perhaps that would be cheaper, and the current drain could be almost nothing.... Thanks!
-
@NeverDie said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
I guess it's the land of compromise. By default I'm going with the BMA220, if only because the board is small and the low power mode current drain is 10ua
At this price buy the small LIS3DH breakout, you'll enjoy the included tilt calculation and a 2uA consumption, 10uA for button cell it too high
https://www.aliexpress.com/item/LIS3DH-Module-Acceleration-Sensor-Module-Evaluation-Board-Development-Board/32285377730.htmlElse go for that one it's cheaper and has the nrf51822 onboard
https://www.aliexpress.com/item/Nrf51822-LIS3DH-Bluetooth-Module-CJMCU-8223-Bluetooth-acceleration-module/32821873481.html
-
@Nca78 said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
Those are both good suggestions. Thinking now though of minimal effort, I may try some cheap ball sensors first:
https://www.aliexpress.com/item/200PCS-LOT-Sensitive-SW-520D-Ball-Switch-Angle-Switch-SW-520D-Tilt-Switch/1967714977.html?ws_ab_test=searchweb0_0,searchweb201602_4_10152_10065_10151_10344_10068_10130_10345_10324_10342_10547_10325_10343_10546_10340_10341_10548_10545_10541_10562_10084_10083_10307_10178_10060_10155_10154_10539_10312_10059_10313_10314_10534_10533_100031_10103_10073_10594_10557_10558_10596_10595_10142_10107,searchweb201603_25,ppcSwitch_4&btsid=110cafb1-1528-4ca9-bf01-4df9ccf33b93&algo_expid=8506dd81-1d5d-4627-9ae5-f3df06594fbb-9&algo_pvid=8506dd81-1d5d-4627-9ae5-f3df06594fbb&rmStoreLevelAB=0
I could stick it in one of the leak detection pinouts of my existing board, so it should be easy.
-
Actually, this contraption looks even more promising than the ball switch: https://www.aliexpress.com/item/Vibration-Switch-Shock-Vibration-Sensor-Shaked-Switch-Shaked-Stick-Skates/32686838884.html?ws_ab_test=searchweb0_0,searchweb201602_4_10152_10065_10151_10344_10068_10130_10345_10324_10342_10547_10325_10343_10546_10340_10341_10548_10545_10541_10562_10084_10083_10307_10178_10060_10155_10154_10539_10312_10059_10313_10314_10534_10533_100031_10103_10073_10594_10557_10558_10596_10595_10142_10107,searchweb201603_25,ppcSwitch_4&btsid=8ee4bf46-c3de-4f6a-b23f-32b800aefc7a&algo_expid=d469a8ff-4dce-4442-8590-0e2fdefb1f4b-14&algo_pvid=d469a8ff-4dce-4442-8590-0e2fdefb1f4b&rmStoreLevelAB=0
-
I uploaded new, upgraded demo code. It's tested and works.
SUMMARY: The demo sketch runs on MultiSensor Version 7 board with an I2C Si7021 module to transmit temperature, humidity, and battery voltage to a MySensors gateway using MySensors protocols.
-
@NeverDie have you seen the comments ?
Damn thing works only for the impact of accelerations> 50g. and only in one direction. In life it is not applicable. Shit, shorter.
-
@Nca78 No, I hadn't. Now I'm wishing I had. Good catch! I'll try cancelling my order....
-
Thinking about it more now, I think the ball switch will definitely work if I position it with a vertical orientation, because they invariably fully invert the trash/recycling bin in order to empty it.
-
Here's a node with the Hall sensor installed:
I'll probably be testing it later today.
-
Tested. The Hall sensor works. Basically, if you run this code:
#define HALL_PIN 9 hwPinMode(HALL_PIN, INPUT); while (true) { if (digitalRead(HALL_PIN)) { digitalWrite(LED_BUILTIN,LOW); } else { digitalWrite(LED_BUILTIN,HIGH); } }
then the LED will turn-on when you bring a magnet near the sensor, and the LED will turn-off when you move the magnet away. Simple.
-
Great!
A bit OT: how are you programming the nRF?
-
@ghiglie I plug it into the nRF52 DK using an IDC cable to its 10-pin connector. Then just select J-Link as the programmer and upload my sketch over the USB port connection to the nRF52 DK from within the Arduino IDE. Easy!
-
@NeverDie
Did you or anybody else could write to the NRF5xxx via the Arduino IDE and a ST-Link V2 programmer?
I find the DK for approx. 32€ a little bit to expensive for just testing.Edit: Maybe this one could work:
http://s.aliexpress.com/FRzU3miMThanks.
-
@DerManni said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
ST-Link V2 programmer
Not me. As I said, I'm using the nRF52 DK as my programmer of choice. I think others may be using the ST-Link V2. Not 100% sure though.
-
@NeverDie
Yes i am using the STLink v2 without any problems.
-
@rmtucker Could you please explain in weich was you connect the STLINK to the NRF Module to usw the Arduino IDE. Thanks
-
STLink<----------------->NRF
SWCLK<--------------->SWD
SWDIO<---------------->SWIO
3.3v<--------------------->3.3v
GND<-------------------->GND
-
I received the version 9 PCB's today. Here's one assembled as a minimalist water leak sensor:
There's now enough physical clearance between the male header leak detection pins and the CR2032 battery holder that I feel comfortable declaring the hardware as finished.
-
@NeverDie said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
@Nca78 said in CR2032 Small Wireless Temperature-Humidity Sensor:
Also, what about moving the led to the center next to its resistor, it would leave enough space to squeeze in a SOT 23 ultra low power hall sensor and it's 100nF capacitor.
Yes, with the Version 4 design serving as the basis, I think there will be enough room to do this.
I'd also like to add a light sensor of some kind: something that will trigger an interrupt when, say, a refrigerator light goes on or off (for the case where the temperature node is in a refrigertor or freezer). Do you have any particular suggestions for that? A simple photoresistor, or would there be something better (lower current)?
A photoresistor turns out to work just fine for binary detection of whether a light is on or off:
I put it in one of the header pin hole pairs otherwise reserved for the leak detection pins and then ran the leak detection sketch. When a light goes on, the resistance of the photoresistor goes from about 20 megaohms in the dark down to well under 100K ohms (exactly amount depends on the light intensity) in the light. So, under light stimulus the photoresistor behaves essentially the same as leak detection pins which have come into contact with water.The one I used is this: https://www.digikey.com/product-detail/en/luna-optoelectronics/NSL-19M51/NSL-19M51-ND/5039794 Perhaps a cheaper photoresistor would have worked just as well, but for proof of concept prototyping I wanted to try this one, which had desirable specs.
-
@NeverDie It appears that photoresistors of type 5539 and/or 5549 may work as well: https://www.aliexpress.com/item/Free-shipping-20pcs-5549-light-dependent-resistor-photoresistor-resistor-5mm-photosensitive-resistance-35513/32346773727.html?ws_ab_test=searchweb0_0,searchweb201602_4_10152_10065_5000015_10151_10344_10068_10130_10345_10324_10342_10547_10325_10343_10546_10340_10341_10548_10545_5130015_10541_10084_10083_10307_5690015_10539_5080015_10312_10059_10313_10314_10534_100031_10604_10603_10103_10605_5060015_10596_10142_10107,searchweb201603_12,ppcSwitch_4&algo_expid=14488cca-cb1a-4d45-b8d2-d8b444735f2a-16&algo_pvid=14488cca-cb1a-4d45-b8d2-d8b444735f2a&rmStoreLevelAB=2
-
@NeverDie and what is your approximative power consumption with the photoresistor ?
-
@NeverDie When using a voltage-divider setup with the LDR you'll have better control over the tripping point and consume less standby power:
Make sure to select an LDR with high resistance, like the 5549 in my example.
-
@Nca78 said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
@NeverDie and what is your approximative power consumption with the photoresistor ?
With the photoresistor installed, current consumption for the entire node measures out at 4ua in the dark and 7.2ua in full saturation brightness. That compares to 3.9ua current consumption for the node with no photoresistor installed.
I'm still waiting for the I2C light sensor to arrive. However, as these photoresistors cost only a little more than 2 cents each for a pack of 50 (see above Aliexpress link), I think they're a reasonable choice for a refrigerator app, where it's going to be completely dark most of the time anyway.
-
@NeverDie said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
I'm still waiting for the I2C light sensor to arrive. However, as these photoresistors cost only a little more than 2 cents each for a pack of 50 (see above Aliexpress link), I think they're a reasonable choice for a refrigerator app, where it's going to be completely dark most of the time anyway.
Yes it's nearly not changing the consumption in sleep so if you have only a basic use for dark/light it's a waste to use an i2c sensor, which will use more energy most of the time.
-
@nca78 What would be a good tiny buzzer to put on it, for making one of those ever popular location tags? I'm guessing something piezo? I'm not finding anything tiny though.
-
-
@neverdie this looks pretty small for a buzzer already. Sorry no idea about smaller ones, but please post your results I'm interested
-
@nca78 Will do. I ordered 20 of them. Might be a nice addition on a leak detector also.
-
I finally received the MAX44009 board:
https://www.aliexpress.com/item/Smart-Electronics-5PCS-lot-MAX44009-ambient-light-sensor-is-the-I2C-digital-output-module-development-board/32767691971.html?spm=a2g0s.9042311.0.0.sOFetX
I'm able to read lux values by pulling A0 on the board to Vcc and using this library and sketch:
https://github.com/dantudose/MAX44009/blob/master/Example/Luxmeter.ino
Very easy.
-
@neverdie you don't even need to bother with a lib, just 2 functions are enough.
https://blog.kkessler.com/tag/max44009/
-
even if it's two functions only, if i need to reuse them in others sketch, I would prefer them in a lib. Only "one line" (include) in the sketch compared to x lines
-
@nca78 said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
@neverdie this looks pretty small for a buzzer already. Sorry no idea about smaller ones, but please post your results I'm interested
Received it today. Putting just DC across it produces no sound at all. Driving it with a pulsed voltage (say 10K hertz at 50% duty cycle) directly from an arduino pin produces sound, but at very low volume. Since it draws 220ma with a straight 3v DC voltage across it, I'm guessing a current more like that is what it will take to get it to produce louder sound, but that's only just a wild guess.
-
I tried driving it from a load switch controlled by the arduino, and that helped increase the volume somewhat.
Doing that, and using this script, I think it will be audible if you're in the same room as it (and if the room is otherwise quiet).
long lastMicrosTime=0; //timestamp in microseconds void setup() { pinMode(10,OUTPUT); } void loop() { for (int x=0;x<1000;x++) { digitalWrite(10,HIGH); lastMicrosTime=micros(); while ((micros()-lastMicrosTime)<300) {} //wait until 300 microseconds have passed digitalWrite(10,LOW); while ((micros()-lastMicrosTime)<x) {} //wait until another x microseconds have passed } }
So, if you were to use it as a locator beacon attached to something you wanted to find, it might be good enough for that.
-
@neverdie said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
Doing that, and using this script, I think it will be audible if you're in the same room as it (and if the room is otherwise quiet).
Guess this is not made for Vietnam then
I supposed this type of buzzer is made more for user feedback for things like touch sensors, than for raising alert.
-
@nca78 What strange is that if I cup my hand over it, it actually becomes louder. Not sure what's up with that. So, maybe I'm just not driving it right.
-
Here's the latest version of the PIR sensor embodiment:
It runs from two CR2032's.Very compact!
-
@neverdie how do you connect thr two Cr batteries ?
Another question ? I read in another comments that you need 100-200 uF capacitor so that the radio can work since thr CR battery wont be strong enough. Did you add this ?
-
@ahmedadelhosni said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
how do you connect thr two Cr batteries ?
This was recently discussed in the Bluetooth action! thread.
-
@neverdie said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
@nca78 What strange is that if I cup my hand over it, it actually becomes louder. Not sure what's up with that. So, maybe I'm just not driving it right.
Isn't that the principle for most speakers, using a sound box ?
-
Wich board do you use in arduino? I can only use Waveshare BLE4.0. At Generic etc. It seems, that the oscillator doesn't work probably.
-
@tiwo85 said in Multi-Sensor: Temp/Humidity/PIR/ Leak/Magnet/Light/Accel:
Wich board do you use in arduino? I
Not sure what you're asking.
-
@neverdie I mean this:
When I use Generic nRF51 or something else, the onboard LED turns on and doesn't turns off. When I use Waveshare BLE400 the sketch works as usual
-
-
@neverdie do you have a working example sketch. I try the example sketch from the 10years pir sensor an d modify a little bit, but it doesn't work. The sketch awake every 5 minutes and send the state from the pir and that's it.
-
@tiwo85
https://www.openhardware.io/view/510/Multi-Sensor-TempHumidityPIR-LeakMagnetLightAccel#tabs-source