CC Blog Projects Research & Design Hub

Build a Monitor for Houseplants

FIGURE 5 The sensing module’s sensors, set up in appropriate positions.
Written by Andrei Florian

Using an Arduino UNO, Sensors, and Wireless RF Transmission

Many people have a “brown thumb” when it comes to keeping houseplants alive, especially varieties that require narrow ranges of temperature, humidity, and soil moisture for optimal growth. In this article, Andrei explains how to build an inexpensive plant monitoring system that measures soil moisture and ambient temperature and humidity in real time, using an Arduino UNO, sensing and display modules, and wireless RF transmission.


  • How can I use technology to keep plants alive?
  • How can I monitor houseplants?
  • How can I build an inexpensive plant monitoring system?
  • Arduino UNO
  • Wireless RF Transmission
  • Arduino | www.arduino.cc

Indoor plants are immensely popular. The global indoor plants market was valued at $16.2 billion in 2022, with projections indicating it could reach $30.4 billion by 2032 [1]. The allure of houseplants extends beyond their aesthetic appeal; they are increasingly sought after for their health and psychological benefits. For instance, they have been found to remove up to 87% of airborne toxins within 24 hours, contributing significantly to improved indoor air quality [2]. This aspect aligns well with growing environmental consciousnesArduino | www.arduino.ccArduino | www.arduino.cc and wellness trends. Millennials, in particular, have embraced “plant parenthood,” with approximately 64% considering houseplants as essential elements of home décor, and integrating them into their lifestyle and interior design [3]. Additionally, these green companions are not just confined to homes; they have made their way into office spaces, where studies have shown a positive correlation between the presence of plants and increased productivity [4].

Indoor plants need continual care, however, and minor changes in their environment and soil can cause them to decay and die. This is particularly true of tropical varieties. Admittedly it can be difficult to make time in our busy schedules to care for plants, with the average American spending merely 5 minutes a week doing so. A survey by Civic Science cites appropriate watering as the leading challenge faced by plant owners [5]. About half of respondents frequently forget to water their plants correctly, or are unaware of the optimal amount of water required. Despite the joy and benefits indoor plants bring, the minimal time often allocated for their care, coupled with common challenges such as inadequate watering, significantly contribute to the difficulty in maintaining their health and vitality.

In this article, I will guide you through building a cost-effective plant monitoring system that will make caring for your indoor plants effortless and error-free. The system consists of a sensing module equipped with various sensors to monitor the plant’s environment, and a display module showing the plant’s vitals (Figure 1) and alerting you if it needs water! Using the display module, you can monitor the soil humidity as you’re watering your plant, to ensure you provide it with the optimal amount. The project’s modules are independent of one another, communicating wirelessly over radio frequency (RF). This allows you to monitor your plant’s health from anywhere in the house or office. With this DIY plant monitoring system, caring for your indoor plants becomes a seamless and hassle-free experience, ensuring that your green companions thrive with the right amount of attention and care, no matter where you are.

FIGURE 1
The display (left) and sensing and module (right) of the system.
FIGURE 1
The display (left) and sensing and module (right) of the system.

Before we get into building this project, let’s talk more about how everything works. The following sections will walk you through details about the project’s functionality and constituent parts.

KEY ENVIRONMENTAL CONDITIONS

Soil Moisture: Soil moisture is arguably one of the most critical factors in plant care. It directly affects the availability of nutrients and oxygen to plant roots. Over-watering can lead to root rot and fungal infections, whereas under-watering can stress the plant, impeding its growth and leading to wilting or death. This project uses a soil moisture sensor to provide real-time data, enabling you to maintain the optimal moisture level for your plant. The sensor’s feedback time is almost instantaneous, meaning that you can observe the plant’s soil’s moisture as you’re watering it, ensuring that you add the perfect amount.

Ambient Temperature: Temperature plays a pivotal role in plant physiology. It influences critical processes such as photosynthesis, respiration, and transpiration. Different plants have varied temperature preferences, and deviations from their ideal ranges can lead to poor growth, reduced flowering, or even plant death. The temperature sensor in this system helps maintain the ideal temperature range for the specific plants being cultivated. By continuously monitoring the atmospheric temperature, the system can alert you to make necessary adjustments, ensuring an environment conducive to plant growth.

Ambient Humidity: The amount of moisture in the air is also important for plant health. High humidity can promote the growth of mould and fungi, but is necessary for tropical plants, whereas low humidity (common during the winter when homes are heated) can cause plants to lose moisture too quickly, leading to dehydration and stress. This project includes a sensor to monitor the ambient humidity levels. This enables you to adjust your watering schedule or use humidifiers to maintain an optimal humidity, creating an environment that mimics the plant’s natural habitat.

PROJECT MODULES

The plant-monitoring system described in this article features two independent modules that communicate with one another over short-range radio frequency (RF). Each module has a separate microcontroller and battery power supply.

The sensing module is equipped with a sensor array, consisting of soil moisture and atmospheric temperature and humidity sensors. Both of these factors play a vital role in plant health and growth, making their accurate monitoring essential. The soil moisture sensor is designed to be stuck in the plant’s pot, and measures the water concentration in the soil, while the atmospheric temperature and humidity sensor can be placed near the plant pot to measure the respective atmospheric properties of the plant’s environment. This module is also equipped with an RF transmitter used to communicate the sensor readings to the display module.

The display module (Figure 2) is equipped with an RF receiver, used to pick up sensor data transmitted by the sensing module. This device also has an LED to indicate that the setup is functioning properly, and an LCD display to show the readings from the sensing module.

FIGURE 2
The flower monitoring system.
FIGURE 2
The flower monitoring system.

The two modules can be at most 20m (about 22 yards) apart, if using the RF transmitter/receiver set I built for the project. Compared with having the same module collect and display the sensor data, this setup allows you to monitor your plant’s health from a location remote from the plant. For instance, you can monitor a garden plant from your kitchen or get information about all plants in an office from one room.

PROJECT COMPONENTS

This section describes the technical details and purpose of key components used in this project. All are available off the shelf, and can be purchased from many online retailers. The Bill of Materials is shown in Table 1.

TABLE 1
Bill of Materials and associated costs for the project.
TABLE 1
Bill of Materials and associated costs for the project.

RF Transmitter and Receiver: The project utilises a wireless communication method, operating at a frequency of 433MHz, to transmit and receive information between the modules. This system comprises two principal components—a transmitter and a receiver.

The transmitter functions akin to a compact broadcasting station, emitting information via radio waves. Central to its operation is a Surface Acoustic Wave (SAW) resonator, which consistently maintains the frequency at 433MHz. This precision is vital for the seamless reception and interpretation of data by the receiver.

In transmitting data, the system employs a technique known as Amplitude Shift Keying (ASK). This method encodes binary data by varying the strength of the signal, similar to adjusting the brightness of a light to convey different messages. This simple yet effective approach allows for a clear transmission of binary data through radio waves.

On the receiving end, the system is fine-tuned to capture exclusively signals from its corresponding transmitter. It incorporates an RF tuned circuit, designed to receive signals selectively at the specified frequency. Operational amplifiers (op-amps) are integral to enhancing the quality of these received signals, especially weak ones. These components significantly amplify the signals for accurate data processing.

Further refinement of the received signal is achieved through a Phase Lock Loop (PLL). This feature plays a pivotal role in stabilising the signal and reducing background noise, thereby enhancing the overall quality and reliability of the data received.

Both the transmitter and receiver can be seamlessly integrated with microcontrollers, (Arduino UNOs in our case), which act as the brains of the operation. These microcontrollers facilitate efficient and precise wireless data transmission, ensuring the integrity and accuracy of the soil quality data communicated from the point of collection to the display interface.

LED: An LED (Light Emitting Diode) is a semiconductor light source that emits light when current flows through it. LEDs are used widely, due to their efficiency, long life, and low energy consumption. The diode is made up of a chip of semiconducting material impregnated (“doped”) with impurities to create a p-n junction. As current passes through the diode, electrons recombine with electron holes, releasing energy in the form of photons. The colour of the light is determined by the energy required for electrons to cross the band gap of the semiconductor.

LCD: This project uses an I2C LCD, a type of liquid crystal display that communicates with a microcontroller using the I2C (Inter-Integrated Circuit) protocol. This protocol allows multiple devices to be connected to the same two wires (SDA for data, SCL for clock), thereby simplifying wiring and conserving GPIO pins. The I2C LCD typically has a 16×2 display, meaning it can show 16 characters per line over two lines. It is controlled via a small I2C interface module, which converts standard LCD signals to I2C. This setup is commonly used in Arduino projects because of its ease of use and efficiency in managing multiple devices over a single bus.

Soil Moisture Sensor: The Soil Moisture Sensor is designed to measure the moisture level in soil. It operates by using two exposed pads to function as a variable resistor; the resistance changes depending on the moisture level in the soil. When the soil is dry, the sensor outputs a higher resistance, whereas wet soil results in a lower resistance. This sensor is typically interfaced with a microcontroller such as an Arduino to read the resistance and determine the moisture level.

DHT11 Temperature and Humidity Sensor: The DHT11 is a basic, low-cost digital sensor for measuring temperature and humidity. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and outputs a digital signal on the data pin. It can be easily interfaced with an Arduino, and its low power consumption and small size make it suitable for home environmental monitoring systems.

Arduino UNO: The microcontroller used in this project is the Arduino UNO. I chose this board because it is inexpensive, easy to use, and has enough pins for connecting to multiple hardware components.

PROGRAM ARCHITECTURE

The architecture of the program running on the system is illustrated in Figure 3. Both the sensing and display modules loop the processes shown in the diagram at short intervals, with the sensing module continuously gathering the latest sensor data, and the display module listening for transmissions to display. The six sequential operations are:

  • Get Atmospheric Temperature: The sensing module will interface with the DHT11 temperature and humidity sensor to get the atmospheric temperature.
  • Get Atmospheric Humidity: The sensing module will then interface with the same sensor to collect humidity data.
  • Get Soil Moisture: The sensing module will interface with the soil moisture sensor and get its reading.
  • Transmit Sensor Values: The sensing module will package the data and communicate it to the display module via the RF transmitter.
  • Receive Sensor Values: The display module will receive the updated information packet from the sensing module via its RF receiver.
  • Display Sensor Values: The display module will then interface with the LCD to refresh the sensor readings displayed.
FIGURE 3
Block diagram showing project architecture.
FIGURE 3
Block diagram showing project architecture.
USER FEEDBACK

As previously mentioned, the system makes use of an LED and LCD on the display module to provide you with sensor data readings. The LED on the display module turns on to indicate that the module is online and listening for transmissions from the sensing module. Every time a new transmission is received, the LCD is refreshed to display the updated sensor readings. The LCD displays the soil moisture on the first line and the atmospheric temperature and humidity on the second (Figure 4). LEDs built into the Arduino UNO also inform you about whether the boards are powered.

FIGURE 4
The LCD and LED on the project’s display module provide user feedback.
FIGURE 4
The LCD and LED on the project’s display module provide user feedback.
SETTING UP THE SENSING NODE

The correct placement of sensors in the sensing modules is shown in Figure 5. For optimal accuracy and performance, the sensors on the sensing module need to be positioned in a specific manner. The soil moisture sensor consists of two pads designed to be inserted into the soil. Naturally, water is not distributed evenly throughout the soil; thus, for the sensor’s reading to best represent the plant’s condition, the sensor’s pads should be inserted as close to the plant’s stem as possible, without any roots in between.

Since the DHT11 sensor measures atmospheric temperature and humidity, its exact position relative to the plant does not need be exact. As long as the sensor is a few inches away from the Arduino UNO board (to prevent the microcontroller’s emitted heat from influencing the reading), and a few inches away from the plant, the readings should accurately represent the plant’s environment.

Sensing Accuracy and Calibration: Both the DHT11 and soil moisture sensors were chosen for their low cost and suitable sensing accuracy. The DHT11 sensor can operate in a temperature range between 0 and 50°C. It has a temperature accuracy of ±2°C and a relative humidity accuracy of ±5%. For greater accuracy, the DHT11 sensor can be replaced with a DHT22 module.

The soil moisture sensor’s accuracy varies broadly, based on the soil it’s placed in. For a highly accurate reading, it is recommended to calibrate the sensor before using it in the project, as described in the Soil Moisture Sensor Guide [6].

Battery Life: The battery life of both the sensing and display modules is around 3 weeks. Because of the greater power consumption of its components, the display module will have a slightly shorter lifespan, compared to the sensing module.

BUILDING THE PROJECT

Having reviewed the functionality of the project in detail, now we can start building it! The series of steps below act as a guide for putting together the hardware and software of the project and deploying it.

Step 1—Required Hardware and Software: First, we want to make sure we have all the necessary components to build the project (see Table 1). The key components of each module also are shown in Figure 6 and Figure 7. It is important to note that I built the project using breadboards. However, it is worth considering soldering the components together if you are looking to use this system long term.

The only software required is the Arduino IDE [7]. This development environment is built to work seamlessly with Arduino development boards, such as the Arduino UNOs we’re using in this project. If you’d prefer to use a more familiar environment, there is also an Arduino extension available for Visual Studio Code [8].

Step 2—Connecting the Circuit: Once we have all the components, the next step is to wire them together. Fritzing circuit schematics for the sensing module and display module are shown in Figure 8 and Figure 9, respectively. Ensure that all sensors are connected to the same pins on the Arduino board as shown in the diagrams, and avoid powering the circuits until all wiring is complete.

Step 3—Downloading the Code and Installing Required Libraries: Now that all the hardware components have been assembled, we can move on to the software side of the project. A copy of the code for both modules is available on the Circuit Cellar’s Article Materials and Resources webpage.

FIGURE 5
The sensing module’s sensors, set up in appropriate positions.
FIGURE 5
The sensing module’s sensors, set up in appropriate positions.
FIGURE 6
Main components of the sensing module.
FIGURE 6
Main components of the sensing module.
FIGURE 7
Main components of the display module.
FIGURE 7
Main components of the display module.
FIGURE 8
Fritzing circuit schematics for the sensing module.
FIGURE 8
Fritzing circuit schematics for the sensing module.
FIGURE 9
Fritzing circuit schematics for the display module.
FIGURE 9
Fritzing circuit schematics for the display module.

After cloning the repository to your local computer, you can open the two code folders named “receive and transmit”, using the Arduino IDE. Before you can run the code on the modules, however, you will need to download and install the libraries on the IDE designed to help interface the project’s components (Table 2). If you’re new to the Arduino IDE, please follow the Arduino guide for installing third-party libraries [9].

TABLE 2
Arduino libraries used by the project.
TABLE 2
Arduino libraries used by the project.

Step 4—Understanding the Code: Let’s briefly examine some of the project code to better understand the key functions executed by both modules.

Sensing Module: Code for both sensors in the Sensing Module is given in Listing 1. After executing the program in void setup(), the microcontroller of the sensing module will loop through the code in void loop() indefinitely:

  • The microcontroller will first execute readTempAndHum() to invoke a function that interfaces the DHT11 sensor and sets two global variables, int temperature and int humidity, to the new sensor readings.
  • The function readSoilMoisture() is then executed. Similarly to the previous step, this function will interface the soil moisture sensor, adjust its value based on the sensor’s calibration, and set the global variable int soilMoisture to the adjusted reading.
  • The next step is to add the sensor values read to an integer array uint8_t valueToSend[4].
  • This integer array is then transmitted to the display module by interfacing the RF transmitter using the function vw_send().

Display Module: Code for the Display Module is given in Listing 2. In the same way as the sensing module, the display module will indefinitely execute the code in void loop() after running that in void setup() once:

  • The function readValues() is invoked to check for an incoming message from the sensing module, using the RF receiver. If a message is received, the function will populate variables storing the sensor data on the display module’s end.
  • The functions displaySoilMoisture() and displayTempAndHum() are then run. These methods interface the LCD and refresh the values on the display to those in the sensor data variables.
LISTING 1
Some code for the two sensors in the sensing module.

void loop(){  readTempAndHum(); // read the temperature and humidity  readSoilMoisture(); // read the amount of moisture is the soil  // Send these values  valueToSend[1] = temperature; // send temperature  valueToSend[2] = humidity; // send humidity  valueToSend[3] = soilMoisture; // send soil moisture  valueToSend[4] = 0; // this data does not represent anything  vw_send((uint8_t *) valueToSend, 4); // send the message  vw_wait_tx(); // Wait until the message is sent  delay(3000);}
LISTING 2
Some code for the display module.

void loop(){  readValues(); // read the incoming data  displaySoilMoisture();  displayTempAndHum();  delay(1000);}

Step 5: Testing the Program: Now that we understand the project’s code, we can test the system by connecting the Arduino UNO of one module to our computer, and uploading the appropriate sketch to the microcontroller using this guide. Repeat the same steps for the microcontroller of the second module, making sure to upload the transmit.ino sketch to the Arduino UNO of the sensing module and the receive.ino sketch to the UNO of the display module.

Now, power both modules by connecting the 9V battery to the holder, and watch as the display on the display module populates with the sensor data from the sensing module. If this does not work, please recheck all the wiring of both modules and try uploading the code again.

Step 6: Building an Enclosure for the Modules: With the program running on the system, we may want to look into building enclosures for the modules. I decided to build a simple enclosure, made out of cardboard, to encase the display module. I cut pieces of white cardboard as shown in Figure 10, and then nested the Arduino UNO and components within them (Figure 11). I added pieces of cardboard on top, and in the end my enclosure looked like the one in Figure 12.

FIGURE 10
Cardboard pieces for the display module’s enclosure.
FIGURE 10
Cardboard pieces for the display module’s enclosure.
FIGURE 11
Circuitry and components of the display module nested in the base of the cardboard enclosure.
FIGURE 11
Circuitry and components of the display module nested in the base of the cardboard enclosure.
FIGURE 12
The finished enclosure housing the display module.
FIGURE 12
The finished enclosure housing the display module.

Step 7: Deploying the Project: Finally, we can set up the sensors as explained in the section, Setting up the Sensing Node and find a place to put our display module. That’s it! The project is ready!

CONCLUSION

This project started when I realized that I’m really bad at maintaining indoor plants. Although I love decorating the house with them, I’d always forget to water them. (I even had a cactus die on me once!) Building a plant-monitoring system helped me remember to care for my plants and create a watering routine (Figure 13). I hope you enjoyed this article and found it helpful. If you have any questions or need help putting it together, please feel free to contact me. 

— ADVERTISMENT—

Advertise Here

FIGURE 13
Watering a plant with the help of the monitoring system.
FIGURE 13
Watering a plant with the help of the monitoring system.

PUBLISHED IN CIRCUIT CELLAR MAGAZINE • MAY 2024 #406 – Get a PDF of the issue

Keep up-to-date with our FREE Weekly Newsletter!

Don't miss out on upcoming issues of Circuit Cellar.


Note: We’ve made the Dec 2022 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Would you like to write for Circuit Cellar? We are always accepting articles/posts from the technical community. Get in touch with us and let's discuss your ideas.

Sponsor this Article

Andrei Florian is a student in Dublin, Ireland. He has been working on tightening the connection between humans and technology by designing applications that will help us in our lives. This includes working on projects that combat pollution and climate change as well as monitoring our natural environment and our cities. He has also been working on personal security and big data. Andrei can be contacted at andrei_florian@universumco.com

Supporting Companies

Upcoming Events


Copyright © KCK Media Corp.
All Rights Reserved

Copyright © 2024 KCK Media Corp.

Build a Monitor for Houseplants

by Andrei Florian time to read: 14 min