Greenhouse Environmental Monitor

The UK is not really known its extreme weather, but one thing we do know well is unpredictable temperatures and deciding if the wetness will be rain or just the air. After i convinced my better half to want a greenhouse in the garden, my plan was how to make this simple wooden room smart.

You can buy off the shelf to do this, but wheres the fun in that…plus it might not be that compatible with Home Assistant and wheres the fun i buying things that just WORK

So armed with a few simple components and an ESP32, i set about how to hook this up. As my house is fully setup with homeassistant i already have access to some devices (Outdoor weather station and WIFI Thermometer and Humidity).

The Plan

I already have a weather station which reports the outdoor conditions and also a random Tuya wifi Thermometer and Humidity gauge, so i can leverage parts of this to great the basis for an automation setup in there. So my plan was base this on an esp32, hook up a few additional sensors and add a IC2 LCD screen, so i can see the values in the greenhouse.

Sensors

  • 2 x Thermometers and Humidity – As I had these kicking about, I planned on using a mix of the wifi/Tuya and the DHT11 sensors (common in Arduino starter kits)
  • 4 x Reed switches, so I can track if doors and windows are open
  • A LX light sensor, so i can track the light level
  • Sonar distance measurement (for water tank depth)

I planned to use a simple IC2 LCD 2 x 20 Screen, where i could see an overview of the readings.

3.3v Device with 5v Sensors/Peripherals

The IC2 screen and Ultrasonic parking sensor all use 5V for power and data, whereas the ESP32 only uses 3.3V. This was something i have not had issue with before, i guess im lucky and use 5V peripherals on Arduino’s. So after a little reading around, i found you can nice little shifters that allow you to run 5v data devices from 3.3v

With the screen and ultrasonic, i need 4 data lines and just 1 device was enough to get me passed this.

Enclosure

My greenhouse is not exactly outdoor, but even in the UK the range of temperatures it will experience over the year, not mentioning the “dry, arid” environment we have 😂. So I needed a case that will allow us to mount all the peripherals and be attached to a wall inside. So here i opted to create my own, my CAD skills are not exactly amazing, but i get by.

Feel free to reuse the CAD on OnShape

The plans ended here

So with this simple plan in mind, i set about making this work. Sadly I never really planned to blog about this, so I do not have many images.

To make this all easier to work with, i created a crude carrier board that allows me to connect jumper cables to all GPIO pins, but with rails for the gnd, 3.3v, 5v and IC2 buses.

The Script

See Code This is the state of the code as of 25th Sept 2025

This script basically gets all the details and then displays them over 5 screens, along with additional data from homeassistant. Nothing really complex in there, the display was the most frustrating part to do and as you can see, i resorted to Cursor (AI) to get it finished.

States/Entities Used

  • Outdoor temperature (from weather station via Homeassistant)
  • Outdoor humidity (from weather station via Homeassistnat)
  • 1 word weather forecast (from Met Office via Homeassistnat)
  • WiFi temperature (From Tuya via Homeassistnat)
  • Wifi humidity (From Tuya via Homeassistnat)
  • Next sunset (From Homeassistant)
  • Device temperature (from DHT11 sensor)
  • Device humidity (from DHT11 sensor)
  • Water depth (from SR04T sensor)
  • Water width (from SR04T sensor)
  • Water volume (from SR04T sensor)
  • Water % (from SR04T sensor)
  • Water tank depth (from Homeassistant)
  • Water tank width (from Homeassistant)
  • Window 1 (Reed Switch)
  • Window 2 (Reed Switch)
  • Door 1 (Reed Switch)
  • Door 2 (Reed Switch)

The way we make the water level work, is we use the tank depth and width values (set in HA) to try and estimate the amount of water we have.

Builds

What follows now is reports from builds and the issues that arise and revisions that follow

September 25th 2025

After a few trial runs with the case, i finally got it all in the case and wired up. Didnt connect the window/door sensors (did for video), but enough for a trial run (even made a homeassitant dashboard).

its not pretty, but it was enough to see it in action.

I did have some issues as i mention in the video, mostly the case is black so once the sun comes out, it soon warms up and even today in late September, it hit 50C reading. So the next plan is a white case, and to put the sensor in a Stevenson screen housing on a cable, so i can mount that away from the case and walls etc.

October 3rd 2025

After the initial overheating issues, i made a few changes that will help moving forwards.

  • The case is now matt white, to try and reflect some of the heat
  • I have moved the DHT11 from the side of the case, to inside its own Stevenson shield

The Stevenson Shield was found on Thingiverse, big thanks to TheChay for sharing that. I created a simple bracket to mount it and this now uses 8x smaller plates and the top. The top will need to be glued to the 1st plate and the sensor it self, should be stuck inside with a foam sticker

Components Used

Not affiliate links

I2C Logic Level Converter Bi-Directional
DHT11 Digital Temperature Humidity Sensor
JSN-SR04T, Distance Measurement 
Normally Open Magnetic Reed Switch
ESP32
Tuya Wifi Thermometer and Humidity
Ecowitt Weather Station
Intensity illumination BH1750FVI

Leave a Reply

Your email address will not be published. Required fields are marked *