Remote Humidity Detector
By David Crookes. Posted

After building a new house, Jamie Bailey went where no person ever really wants to go – into the dark, cramped crawl space beneath the property to check for humidity. “It wasn’t fun and I only got a single humidity reading,” he confesses. But since this particular crawl space uses external vents and Tennessee, where Jamie lives, is very humid in the summer, it was
certainly a necessary trip.
Advertisement
The desktop computer you've been waiting for: Raspberry Pi 500+
Excess humidity is a problem, particularly in the dark. It can cause mould to grow and infiltrate a home's air, and that's a potential health hazard for those living there. “I became worried about the humidity causing long-term issues, including wood rot in the floor joists which is super-expensive to repair,” Jamie says. “So, I went in with a handheld humidity meter and realised I needed to log the levels over many weeks and months. Going down there every day wasn't going to happen. Thus, the idea of using a Raspberry Pi computer to do the work for me was born.”
Humidity hardware

Jamie's checklist of hardware was relatively small. As well as a Raspberry Pi 3, 4, Zero W, or Zero WH model with pre-soldered headers, he reckoned on needing a humidity sensor and a power outlet. “There was no power down there and using batteries was a non-starter for me, but getting electricity under the house was easy because of the existing wiring,” he says. He also sought an accurate humidity sensor. “This was harder than it should have been because I thought the popular DHT22 temperature/humidity sensor would be perfect, but it turned out to be a bust after testing four of them and getting completely different readings from each one,” he tells us. Jamie tried an inexpensive BME280 temperature/humidity sensor and got it working with Python in just five minutes. “I knew I had a winner.” The sensor easily connected to the pins of Raspberry Pi, leaving the rest of the work down to the software. Jamie installed Raspberry Pi OS, hooked up to his home’s wireless LAN, and got to work on the Python script. He used Initial State for the data streaming and visualisations needed to make sense of the information.
Gathering data

“A huge part of this project that I didn’t realise I needed was outside temperature and humidity,” he says. “Just reading relative humidity in the crawl space wasn't enough because of the vents – I needed to know what was going on outside too. The crawl space stays much cooler than the outside during summer, and cooler air holds less moisture than warmer air. “When that hot humid air gets sucked into the crawl space, the relative humidity goes up about 2.2 percent per each degree in Fahrenheit. I needed to log what was happening outside along with what was happening under the house, so I used Weatherstack to get the outside weather information into my dashboard, although I could have also used a second Raspberry Pi outside to do the same thing.” Jamie can now monitor the average outside temperature and humidity and see the average within his crawl space. “The project is a good framework to monitor just about anything with a sensor,” he says. “I plan to use it for many more projects that are currently swirling around in my head.”
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles

Raspberry Pi 500+ in Raspberry Pi Official Magazine issue 158
We’re quite taken with Raspberry Pi 500+. But when you don’t need all that processing power, and just want a board that will make a plastic skeleton jump around in a terrifying manner, you’ll find Raspberry Pi Pico more than up to the job. There’s more terror in the magazine (which is only right as […]
Read more →

Win one of five Raspberry Pi SSD 1TB
Raspberry Pi prides itself on high quality hardware, and this 1TB Raspberry Pi SSD is no different. You can use it with a standard Raspberry Pi or even in your desktop PC – the choice is yours. We have five to give away and you can enter below Win 1 of 5 Raspberry Pi SSD […]
Read more →

Dual-screen cyberdeck
Twin screens mean you can code on one screen while watching David Bowie’s 1978 Musikladen show on the other.
Read more →
Sign up to the newsletter
Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.