Control temperature and humidity with Raspberry Pi Pico

Hesam Moshiri (aka MyVanitar) used Raspberry Pi Pico, a digital SHTC3 sensor, and a TFT display to build a temperature and humidity monitor to help you keep an eye on your environment. His version is equipped with relays so the device can control heating and cooling in response to the sensor readings, keeping conditions within preset limits.

Subscribe to Hesam’s YouTube channel

It’s super tiny and portable so you can move it around and use it wherever you need it. Maybe in a greenhouse to improve the chances your tomatoes won’t wilt again this year, or perhaps up in the loft to check you’re not losing too much heat from your home.

Hesam’s creation can read freezing temperatures from −40°C all the way up to a worryingly toasty +125°C. Admittedly, I generally lend little attention to how we scientifically measure humidity. I rely on a range that spans from “hair looks a little frizzy” through to “air feels like it’s stuck to my face”. Happily, the project post describes how the sensor provides proper measurements from 0–100% relative humidity, with a tolerance of ±2%RH.

pico humidity temperature sensor

The colourful TFT display in the photo above shows temperature on the left and humidity on the right. When Hesam took this shot, room temperature was a little above normal, but not worryingly so, resulting in a yellow display. Humidity, however, was much lower than normal, giving a red warning display. The green and red arrows underneath each of the half-dials indicate the maximum and minimum recorded readings along with the time those conditions were detected.

Control temperature and humidity with Raspberry Pi Pico
The whole setup

The user can set the upper and lower bounds of the temperature range for the relays to maintain via heating and cooling units. Hesam coded everything using the Pico C/C++ SDK library. He created the schematics and the custom PCB in Altium Designer 22.

Control temperature and humidity with Raspberry Pi Pico
Custom PCB

Lots more detail about the circuits, the PCB layout, and how everything works together are provided in this project post.


Danny avatar

Nice little project. Can also do it with a cheap ESP 8266 D1 Mini. I have a few around the house with BME280s on WiFi and as long as I have a power outlet… I can get data. Could go battery too I suppose. No need for the display since I have Home Assistant doing that for me.
But yea, nice little project he did.

Danny avatar

Oh and… I have a Google nest. Wish it had better integration (easier) with home assistant but I can setup text alerts from sensors and change temp easily or just monitor.
It is interesting knowing the differences between rooms.
I’m setting up one in a bathroom that’s always cold in the winter. I have a floor heater (wall mounted) on a wifi outlet. Can read the the sensor and turn on and off the heater based on temp but time of day as well with automations in home assistant. HA is really crazy cool! Open source and large community with lots of help and very customizable. Tweakers heaven lol.

Jod avatar

Looks awesome – compact and elegant.

beta-tester avatar

do you use the relative humidity or do you calculate the absolute humidity & dew point to control the relais?
there are arduino projects out there, these do the similar think to control the absolute humidity of a room.

Comments are closed