You are on page 1of 7

instructables

Temperature & Moisture Monitor

by Itrium

There are two sure re ways to quickly kill o your growing area. A DIY tensiometer monitors how much
plants. The rst way is to bake or freeze them to death water is available for the plants in the growing media.
with extremes of temperature. Alternatively, under or After the data from these sensors is collected by the
over watering them will cause them to wither or rot ESP32, it is sent to the internet via WiFi for posting on
away the roots. Of course there are other ways to ThingSpeak.
neglect a plant such as incorrect feeding or lighting
but these usually take days or weeks to have much Supplies:
e ect.
The parts used for this monitor are readily available
on Ebay or Amazon.
Although I have an automatic watering system, I felt
Digital Barometric Pressure Sensor Module Liquid
the need to have a completely independent
Water Level Controller Board
temperature and moisture monitoring system in case
DS18B20 Waterproof Temperature Sensor
of a major failure with the irrigation. The answer was
Tropf Blumat Ceramic Probe
to monitor temperature and soil moisture content
ESP32 Development Board
using an ESP32 module and posting the results onto
5k resistor
the internet. I like to view the data as graphs and
5-12V power supply
charts and so the readings are processed on
Assorted plastic tubing to t tensiometer and sensor
ThingSpeak to nd trends. However, there are many
Mounting box and wiring
other IoT services available on the internet which will
WiFi connection
send emails or messages when triggered.

This Instructable describes how to build a stand alone


temperature and moisture datalogger. The ubiquitous
DS18B20 is used to measure the temperature in the

Temperature & Moisture Monitor: Page 1


Step 1: Temperature Measurement

The waterproof version of the DS18B20 is used to Arduino libraries and instructions are readily available
measure the temperature. Information is sent to and on the internet to handle the DS18B20 and 1-Wire
from the device over a 1-Wire interface so that only a interface which greatly simplify the data reading
single wire needs to be connected to the ESP32. Each sketch.
DS18B20 contains a unique serial number so that
several DS18B20s can be connected to the same wire
and read separately if so desired.

Step 2: Tensiometer Construction

Temperature & Moisture Monitor: Page 2


The tensiometer is a ceramic cup lled with water in is to soak and ll the probe with boiled water, push
close contact with the growing media. In dry the probe into the ground and measure the pressure.
conditions, water will move through the ceramic until
enough vacuum builds up in the cup to stop any There is plenty of information about using
further movement. The pressure in the ceramic cup tensiometers on the internet. The main problem is
gives an excellent indication of how much water is keeping everything leak free. Any slight air leak
available for the plants. reduces the back pressure and the water will seep
away through the ceramic cup. The water level in the
A Tropf Blumat Ceramic Probe can be hacked to make plastic tube should be about an inch from the top
a DIY tensiometer by cutting away the top part of the and should be topped up with water when required. A
probe as shown in the picture. A small hole is made in good leak free system will only need topping up every
the pip and 4 inches of clear plastic tube pressed onto month or so.
the pip. Warming the tube in hot water will soften the
plastic and make the operation easier. All that remains

Step 3: Pressure Sensor

A Digital Barometric Pressure Sensor Module Liquid the sensor can be calibrated to provide user friendly
Water Level Controller Board, widely available on units of pressure.
eBay, is used to measure the tensiometer pressure. The
pressure sensor module consists of a strain gauge It is vitally important that all the pipe work and
coupled to an HX710b ampli er with a 24 bit D/A connections are leak free. Any loss in pressure causes
converter. Unfortunately, there is not a dedicated water to escape from the ceramic cup and the
Arduino library available for the HX710b but the tensiometer will need frequent topping up. A leak
HX711 library seems to work well without problems tight system will work for weeks before needing more
instead. water in the tensiometer. If you do nd the water level
dropping over hours rather than weeks or months,
The HX711 library will output a 24 bit number consider using pipe clips at the pipe joints.
proportional to the pressure measured by the sensor.
By noting the output at zero and a known pressure,

Temperature & Moisture Monitor: Page 3


Step 4: Pressure Sensor Calibration

The HX711 library outputs a 24 bit number according It is possible to work out the o set and scale factor
to the pressure measured by the sensor. This reading from two pressure measurements and ash the ESP32
needs converting into more familiar units of pressure in one session. However, I got completely confused
like psi, kPa or millibars. In this Instructable millibars with negative number arithmetic! Subtracting or
were chosen as the working units but the output can dividing two negative numbers blew my mind . I
be easily scaled to other measurements. There is a line took the easy way out and corrected the o set rst
in the Arduino sketch to send the raw pressure and sorted out the scaling factor as a separate task.
reading to the serial monitor so that it can be used for
calibration purposes. First of all the raw output from the sensor is
measured with nothing connected to the sensor. This
Known pressure levels can be created by recording number is subtracted from the raw output reading to
the pressure required to support a column of water. give a zero reference for no applied pressure. After
Each inch of water supported will create a pressure of ashing the ESP32 with this o set correction, the next
2.5 mb. The setup is shown in the diagram, readings step is to set the scaling factor to give the correct
are taken at zero pressure and maximum pressure units of pressure. A known pressure is applied to the
from the serial monitor. Some people may like to take sensor using a column of water of known height. The
intermediate readings, best t lines and all that gu ESP32 is then ashed with a suitable scaling factor to
but the gauge is quite linear and a 2 point calibration give the pressure in the desired units.
is good enough!

Temperature & Moisture Monitor: Page 4


Step 5: Wiring

There are several versions of the ESP32 development The ESP32 development board had a built in voltage
board out in the wild. For this Instructable a 30 pin regulator so that a voltage supply of up to 12 V could
version was used but there is no reason why other be used. Alternatively the unit may be powered
versions should not work. Besides the two sensors, the through the USB socket.
only other component is a 5k pull-up resistor for the
DS18B20 bus. Instead of using push on connectors, all
the connections were soldered for better reliability.

Step 6: Arduino Sketch

The Arduino sketch for the temperature and moisture monitor is quite conventional. First of all the libraries are
installed and initiated. Then The WiFi connection is set up ready to post data to ThingSpeak and the sensors read.
Pressure readings are converted to millibars before being sent to ThingSpeak with the temperature readings.

Download
https://www.instructables.com/ORIG/F4V/7AWL/K9YL68GV/F4V7AWLK9YL68GV.txt

Step 7: Installation

Temperature & Moisture Monitor: Page 5


The ESP32 is mounted in a small plastic box for plants are not baked, frozen or desiccated!
protection. A USB power supply and cable can be used
to power the module or alternatively the onboard
regulator will cope with 5-12V DC supply. ADDENDUM
I have tried many ways in deciding when to water
A lesson learnt the hard way with the ESP32 is that the plants. These have included gypsum blocks, resistance
internal antenna is quite directional. The open end of probes, evapotranspiration, capacitance changes and
the antenna pattern should point towards the router. even weighing the compost. My conclusion is that the
In practice, this means that the module should tensiometer is the best sensor because it mimics the
usually be mounted vertically with the antenna way plants extract water through their roots. Please
uppermost and pointed at the router. comment or message if you have thoughts on the
subject...
Now you can log into ThingSpeak and check that your

Temperature & Moisture Monitor: Page 6


Temperature & Moisture Monitor: Page 7

You might also like