DIY Temperature and Humidity Monitor for the Garden

This week I’m building a temperature and humidity monitor to take measurements in the Cold Frame I placed outdoors.  This is mainly for my own curiosity and will help assess how well the Cold Frame is at maintaining stable temperature and humidity.  I will also be using this monitor in my seed germination station.  I will be using an ESP8266 WiFi Arduino module along with a DHT22 temperature and humidity sensor to collect data.

History

Last summer I built some multi-purpose sensors to monitor the temperature and humidity around the house to determine if we needed a repair or replace our home heating and air conditioning system.  I put together the multi-purpose sensor on a breadboard as you can see in the image below.

My DIY Multi-Sensor Project
My DIY Multi-Sensor Project

In this project, I used a NodeMCU V2 ESP8266 (a WiFi enabled microcontroller controller) and connected it to a DHT22 sensor (shown in white above), a motion sensor and a photodiode for measuring light.  Finally, the NodeMCU connects to a MQTT server I have running in the house and the data is plotted in home-assistant.

Next, I’ll walk you through putting together a simple wireless temperature and humidity monitor that you can use around the house or in the garden.

Simple Temperature and Humidity Monitor

These are the things you will need:

  • NodeMCU V2 (or any other ESP8266 enabled board)
  • A DHT22 or DHT11 temperature and humidity sensor
  • A Breadboard (Optional)
  • A 1K Resistor
  • Solder (Optional)
  • Hookup or Jumper Wire
  • A 6V battery holder

Assemble the circuit according to the schematic below.

Temperature and Humidity Sensor Schematic
Temperature and Humidity Sensor Schematic

The connections are as follows:

For the DHT22 Sensor:

  • 1 connects to the NodeMCU V2 3.3V Output
  • 2 connects to  the NodeMCU V2 D2 Input
  • 2 connected to the 3.3V Output via a 1K Pull-Up Resistor
  • 4 is connected to the common ground.

And for the NodeMCU:

  • D0 is connected to the NodeMCU V2 RST Pin (for Deep Sleep)
  • VIN connected to 6V positive
  • GND connected to 6V negative

Try putting this together on a breadboard first to make sure you get the circuit right and solder everything together for a more robust permanent solution.

Once everything comes together, the final product will look similar to this.

Wireless Temperature and Humidity Sensor Monitor
Wireless Temperature and Humidity Sensor Monitor

The Code

Use the code below to set up a basic temperature and humidity monitor system.  The code publishes a JSON packet to your MQTT server every 10 minutes.  You will need to edit the essid, password, and server fields to match your network configuration.

After the board has been programmed it will send an update to the MQTT server every 10 minutes and go to a low power sleep mode after.

To program the board you can use the Arduino IDE or my favorite, PlatformIO.

The Sensor in Action

I placed this sensor inside of my cold frame and have been monitoring the temperature and humidity for the past few days.  This will give me an ideal of how hot it gets inside the cold frame and whether or not I need to automatically vent the cold frame if it gets too hot.

Cold Frame Temperature Data
Cold Frame Temperature Data
Cold Frame Humidity Data
Cold Frame Humidity Data

And there it is, a portable DIY Temperature and Humidity Monitor.  Feel free to leave comment if you like this post or if you have any questions.

Starting Seeds Indoors – Automated Lighting

Starting seeds indoors requires a seed germination station and a lighting setup.  You will need to ensure that the lights are on for about 15 hours a day and to make life easier, its best to use a timer or other automated lighting setup.  In this post I will detail how I use a TP-Link Smart Plug to automate my lighting which I then can control from my phone.

When to Start Providing Light

Your seedlings will need light soon after their true leaves appear.  The true leaves will be the first leaves that appear on the growth outside of the cotyledon.

How to Use a Smart Outlet for Automated Lighting

I picked up a TP-Link Smart Plugs on a Black Friday sale from Amazon last year along with an Echo Dot.  This smart plug also provides the ability to monitor energy usage which is useful if you’re on a budget.

TP-Link Smart Outlet
TP-Link Smart Plug

If you recall in my previous post on setting up a seed germination station I used 4 foot T5 Grow Lights.  T5 lights are one of the most energy efficient lights you can use for your seed germination station.

I use the TP-Link Plugs all around the house to remotely control things like my 3D printer, desk lamps, humidifiers and my favorite of all – the coffee maker.  Uttering the phrase “Computer Coffee Maker On” is quite satisfying in the morning.

Now back to the point, seedlings will need about 15 hours of light each day until they’ve grown large enough to leave the seed starting station and begin their transition to the outdoors.  The lights should be positioned ideally about 2″ to 3″ above the seedlings.  To do this, use adjustable hangers to hang the lights.

Automating Your Lights using a Smart Plug

First plug the outlet into the wall and subsequently the grow lights into the outlet.

The light on the smart plug will turn green once it has connected to your WiFi network.

Next open the TP Link Kasa app on your phone and create a schedule for the lights.

TP-Link Kasa App Device Selection
TP-Link Kasa App Device Selection

Next, select your Smart Plug.  In this case I named my Smart Plug “seed lights”.

Configure two separate schedules for turning on and turning off the lights.

TP-Link Kasa - Turn on Schedule
Turning Lights On Schedule
TP-Link Kasa Turning Off Schedule
Turning Lights Off Schedule

Make sure to select every single day so that the lights turn on and off every day of the week.

TP-Link Schedule - Enabled
TP-Link Schedule

Turn on the lights and adjust the height of the lights to be within 2 to 3 inches of the highest growth.

Automated Lights with Hangers Adjusted
Final Setup with Adjusted Light Hangers

Your final setup will look similar to this.  Note that I kept the domes on as I still have a few seeds germinating.