in reply to Re^4: XS Modules - why and when?
in thread XS Modules - why and when?

Just a quick note on those DHT11/DHT22 sensors

Thanks for the information. It might help to explain what I am thinking of doing...I might be wildly off with my plans...

At home, we have a smart thermostat. It is controllable by Alexa and remotely from our phones. It is supposed to have geofencing but doesn't handle having two people connected. Sometimes, I will go out, and the heating will turn right down, which would be fine if my partner were not still at home wanting the heating!

I've also noticed that the thermostat can read 18 degrees in the summer, and we feel nice and warm. Yet in the winter, the thermostat can read 20 degrees and we feel chilly. So, something more than temperature is at play. I am guessing at humidity.

My plan iswas to fit a DHT22 connected to a Raspberry Pi Zero in an enclosure outside. Then, to have a more powerful Raspberry Pi inside with a DHT11 connected. That would allow me to measure the indoor and outdoor temperature and humidity and set the heating accordingly. Some experimentation would be needed to set it up correctly, but that would be a software issue once the hardware is set up.

It would be nice to have the heating keeping the perceived temperature constant throughout the year rather than the absolute temperature.

I only have to worry about switching the central heating boiler on and off - here in the UK we don't have air conditioning. Only me office has that luxury.

Replies are listed 'Best First'.
Re^6: XS Modules - why and when?
by cavac (Prior) on Dec 19, 2023 at 09:38 UTC

    I've also noticed that the thermostat can read 18 degrees in the summer, and we feel nice and warm. Yet in the winter, the thermostat can read 20 degrees and we feel chilly. So, something more than temperature is at play. I am guessing at humidity.

    It might or might not have to do anything with humidity. The temperature sensor is measuring the temperature in one location, not the whole living area. Let's say for the moment it is mounted on an internal wall. That would mean, in summer the temperature near an external wall far from the sensor is possibly higher than at the measured location. And in winter, the opposite is true.

    (this paragraph is mostly a general explanation for future readers, OP seems to be already considering how this): Modern heating systems sometimes come with multiple sensors to get a better average. Also, i have seen more and more heating systems that also install one or more outdoor sensors (especially central heating systems that circulate hot water through radiators). The external sensor allows those systems to compensate for the time it takes them to warm up the water by detecting the dropping temperatures before the chill has time to seep through the walls.

    A temperature controller (just as most other regulation systems) also has to have a deadband ("switch off when reaching 20°C, switch back on when falling below 19°C") to reduce the on/off cycles and prevent prematurely wearing out the system. This deadband can also account for perceived and real temperature differences. For more complex control loops, you might have to read into PID controllers and such.

    As for your project, if you only need to read temperature and make it available over the network, an ESP32 controller (Microcontroller with Wifi) with a reliable temperature sensor like a DS18 could be a way to go, especially if you need multiple of those.

    Especially for stuff running outside, i strongly recommend not to use mains voltage directly. For these kinds of projects i usually run 12V with a proper fuse (car fuse holder+fuses are fine) at the source! Run the 12V outside, then use a step-down/DC-DC converter next to your electronics to step down to the proper voltage. This way you won't get electrocuted if something goes wrong, and you won't have to worry about drooping voltages in the long cable runs.

    If you like to design your own PCB to host the DC-Converter, the pinheaders for the ESP32/Arduino/whatever and connector to the temperature sensor and power lines, you can freely copy stuff from my NDC1 modular Arduino based computer project. The (KiCAD) schematic for the DC regulators on the PowerBoard is pretty much my goto design for most of my electronics projects and has been tested extensibly under outdoor conditions in the range of about -25°C to +60°C (no guarantees though, it's a hobby project after all).

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

      I'm all in on the idea of microcontroller use here. Once the firmware is flashed, it's purpose driven. That's all it does. Rock solid reliable.

      In regards to the outdoor sensor, I love your approach, but I have one better (because I've done it). This of course. is only relevant if it is possible... do what you have to do on the inside of the facility. Keep the microcontroller there. Put outdoors only the sensor itself. This way, one can control all voltages/current at whatever level necessary in a safe environment, and only 3.3v or 5v at minimal current draw needs to egress the building. Only condition is, is that one adheres to the gauge and length of wire for the transmission protocol for the sensor in use (taking into consideration all environmental variables (temp, etc)).

      A Raspberry Pi is great for prototyping or playing around. I spent years developing software for numerous sensors, ICs and things on a Pi. However, for critical operations such as operating a building's HVAC system, I believe it is imperative and responsible to use something suited for the task. Already, furnaces use microcontrollers for these types of things. I wouldn't deviate from the norm.

        Only condition is, is that one adheres to the gauge and length of wire for the transmission protocol for the sensor in use (taking into consideration all environmental variables (temp, etc)).

        I've run 5 meter cables for DS18B20 temperature sensors without any problem. Up to 30 or so meters should work fine in "powered" mode. DS18 can either have a dedicated +5V/+3.3V wire or run in a "parasitic" mode with power leached from the data wire.

        PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
Re^6: XS Modules - why and when?
by bliako (Abbot) on Dec 19, 2023 at 07:53 UTC
    At home, we have a smart thermostat. It is controllable by Alexa ...

    ours is controlled by Ursula ;)