I’ve recently been playing a lot with temperature humidity sensors, and a little bit with smoke gas sensors and PIRs (motion sensors), as well as WeMos D1 Mini ESP8266 based MCUs.
The story starts with my PIR’s. They happened to be just hanging from the corners of the room with no enclosures, which were kinda ugly, so I first designed a 3D printed enclosure for them.
It’s designed in a way to fit snugly into the corner of a room, right where most of the alarm wires drop.
I was kinda pleased with this, so I decided to take it a step further, by adding an all in one solution, including Smoke/gas, Temperature/Humidity and motion sensing all in one unit. I initially though this was a neat idea, since I could have one box giving me all this information. Here’s the 3D design for the enclosure:
and the resulting print:
So, all of the components were then added using a dab of hot glue to keep them in place:
There’s also a shield in there fro the D1 Mini to allow easier connection of the various sensors.
which resulted in a rather neat looking unit, although kinda unusual.
I then loaded the sketch mounted this in one of the room corners, and started the measurement.
I had noticed previously that the smoke/gas detector was quite warm when in use, but it didn’t register with me what I was about to discover next. The smoke/gas detector runs at about 25degrees celsuis, so putting the temperature sensor right beside it was a very bad idea, as it was affecting the temperature significantly. So much so, that I had to subtract a few degrees from the readings to get it to agree with another temperature sensor elsewhere in the room. So, next build, I removed the smoke/gas detector, and went back to a simpler unit with just PIR and temperature/humidity.
Which is now mounted in one of the rooms.
The wire you can see coming down into the unit is the 6-core cable from the alarm panel, so it has 5V already coming to that location, which I use to power the WeMos D1 Mini MCU board. The sketch on the D1 Mini is sending a JSON message via MQTT to my EmonCMS system (running on an AAEON Up Board, an Intel® Atom™ x5 Z8350 64 bit CPU base single board computer, the centre of my Home Automation) every minute. Working nicely, although I need to find a better location for the temperature sensor, as having it close to the ceiling is also not such a good idea. It would probably be better at head height in a room to give a more relevant temperature measurement of what the room feels like, and whether it needs heating or not.
So, the two key things to take from this:
- Dont put a smoke/gas sensor right next to a temperature sensor, you’ll only be measuring the air heated by the smoke/gas sensor.
- Don’t put a Temperature sensor up near the ceiling, it’s where all the warm air in a room accumulates. Much better positioned lower down.
Hi Dave,
Thanks for sharing.
I like the idea of motion + air quality + temp/humid + wifi all in the one small package.
Is it just a matter of subtracting a few degrees? If so, I think that’s fine.
I have to do the same with mine, because the DHT22 is mounted (with blu-tac)
up in the screen, close to the RPI and LCD controller.
But, the temp seems to be consistent when compared with a proper thermometer.
https://www.youtube.com/watch?v=PeQM7Mw6VwI
Thanks.
Best regards,
Niall.
Niall,
I think it’s good enough for my usage, I don’t expect it to be accurate. In the ballpark is all I’m looking for with that one.
Dave.
Hi,
Are you experiencing many false positive detection’s?
I’m running a Wemos D1 mini with a DHT22 quite stable using easyESP (http://www.letscontrolit.com/).
I have tried it with a PIR sensor but it frequently trigger motion even when nothing changed (tested in controlled environment without sunlight). I’ve tried different settings on the PIR screws but still get false positive alerts (almost each minute).
I have read somewhere that the ESP wifi could interfere with PIR sensor if they are close to each other. You have them very close so I am interested in hearing your experience.
Any advise much appreciated.
There’s one sensor that I am having trouble with, so I disabled it for the moment. I haven’t debugged it properly yet. That could be the issue you’re seeing also. I’ll have a closer look and add another comment here.
Ps. I really like the design !