June 10, 2024: Second testbed ended
June 5, 2024: Second testbed started
June 5, 2024: Green Guardian presented
May 25, 2024: First testbed done, finetuning for Green Guardian macros.
May 23, 2024: First testbed set up, data collection started.
May 22, 2024: First prototype assembeled - All sensors and actuators functional.
May 19, 2024: Energy harvesting circuit added to prototype, test successful.
May 17, 2024: Code update for Wifi connection to Arduino, time synchronization, and entering low power mode.
May 13, 2024: Code update for reading sensor data of water level of actuator.
May 12, 2024: Code update for reading sensor data (Temperature, Humidity, Ambient Light, Soil Moisture).
May 8, 2024: Problem definition, product survey insights and technical approach added. Temperature and humidity sensor calibrated. Initial design of algorithms.
April 24, 2024: Updated timeline and milestones. Created related work section.
April 20, 2024: Created product interest survey, please answer here!
Week 1: Project kickoff, initial research, and component ordering are scheduled.
Week 2: Start of hardware assembly and basic software setup.
Week 4: Completion of the prototype assembly.
Week 5: Begin functional testing and iterate based on initial results.
Week 6: Development of the user interface and integration testing.
Week 7: Final testing, project documentation, and preparation for the demonstration.
The Green Guardian project aims to address economic and environmental losses in the houseplant industry due to neglect. This IoT device simplifies plant care with near-autonomous soil moisture management and an integrated watering system. It monitors key variables (light, soil moisture, humidity, temperature), adjusts watering schedules, and indicates optimal plant placement. Powered by an energy-harvesting system, Green Guardian minimizes environmental impact and operates independently of external power sources.
In the United States alone, consumers spend approximately billions annually on houseplants and related accessories [2]. Despite this investment, around half of these plants die prematurely due to neglect and improper care [1]. This not only results in financial losses but also contributes to environmental waste, as valuable resources such as water, soil, and plant materials are squandered. The primary issues include a lack of proper plant care knowledge, as many plant owners lack the necessary expertise to maintain optimal conditions for their houseplants, leading to overwatering, underwatering, insufficient light, and poor environmental conditions. Additionally, busy lifestyles often prevent individuals from dedicating the necessary time and attention to their plants, resulting in neglect and inconsistent care routines. Improper care practices also lead to the wasteful use of resources such as water and fertilizers, which has broader environmental implications. Furthermore, the premature death of plants results in discarded plant material, contributing to landfill waste and the unnecessary consumption of resources used in plant production and distribution.
The motivation behind the Green Guardian project stems from the desire to address the significant economic and environmental issues associated with houseplant care. Americans spend approximately billions annually on houseplants [2], yet around half of these plants die prematurely due to neglect and improper care [1]. This not only results in financial losses but also leads to environmental waste, as resources such as water, soil, and plant materials are squandered.
Green Guardian aims to mitigate these issues by providing an IoT-based solution that automates plant care, ensuring optimal conditions for plant health with minimal human intervention. The project seeks to reduce plant mortality, promote sustainable practices, and enhance the overall experience of plant ownership by using an edge system capable of sensing, decision-making, and actuating. Additionally, we aim to collect data on individual plants to address the current lack of detailed plant care information, which could be highly beneficial for advancements in the agricultural and environmental fields.
A survey was conducted with 119 participants to gauge potential user interest in the Green Guardian. Questions aimed to assess how often individuals interact with their plants and their interest in a self-sustaining plant care system.
The survey results for the Green Guardian product reveal promising insights into the market's readiness and potential interest in an autonomous plant care solution. A majority of respondents interact with their plants frequently (daily or several times a week), indicating an existing commitment to plant care that the Green Guardian could support and enhance. Additionally, a significant number of respondents reported having plants that died prematurely, suggesting a prevalent challenge in maintaining plant health that the Green Guardian aims to address. Importantly, the strong inclination towards a self-contained watering system, with a substantial majority expressing interest, underscores the demand for such innovative solutions. This interest, coupled with respondents' willingness to invest in the price range of $20 to $60, positions the Green Guardian as a viable product in the houseplant care market.
The components and design used for this project focused on its constraints and requirements: energy efficiency, plant care through sensing, decision-making, and actuation, and minimal user intervention.
The system, as seen in Fig. 1, is divided into four units: control, sensing, power management, and actuation. All of the hardware used for this project was over-the-counter and specified in the Components Used in the Project
The control unit is centered around the Arduino UNO R4 WiFi [ABX00087], featuring the Renesas RA4M1 and ESP32-S3 for Wi-Fi and Bluetooth connectivity. This microcontroller was chosen for its robust performance, ease of use, extensive community support, network support, affordability, pins, and peripheral compatibility. Additionally, we chose this Arduino model for its integrated LED matrix, which can serve as a notification system for the user.
The sensing unit is made up of four sensors that allow measurement of five essential variables for plant care: soil moisture, environment temperature, air humidity, light exposure, and remaining water in storage. We chose these because "environmental factors that affect plant growth include light, temperature, water, humidity, and nutrition" [3]. Measuring soil nutrition is still unaffordable and complex, so we based our model on the other factors. The sensors we used were the lowest consuming and most affordable ones available in our market.
The power management unit is composed of a solar controller, a battery, and a solar cell. We deemed solar energy as the most effective energy harvesting method given the environmental factors needed for plants to thrive and its ample energy collection ability. The 3.7V 1000mAh LiPo battery provides reliable energy storage, ensuring continuous operation during low-light conditions.
Finally, the actuation unit is composed of a standard servo. The servo is connected to a valve that enables drip irrigation. We chose this irrigation system for two reasons. First, it takes advantage of the potential energy from storing water above the plants, allowing gravity to assist in water delivery. Second, drip irrigation is 90% efficient in allowing plants to use the applied water, and it reduces runoff and evaporation [4], making this system highly suitable for our requirements.
To ensure our decision-making model had accurate data input, and given that the sensors involved in this project could compromise accuracy for affordability, sensor calibration was necessary for all of them.
The moisture sensor is capacitive, returning arbitrary values that only had relative meaning in the context of the data points it collected. Because of this, we had to create a function to map these arbitrary values to soil moisture content percentages. To achieve this, we dried the soil in an oven until it reached a consistent weight, indicating minimal levels of moisture, which allowed us to measure 0% soil moisture. After this, we determined the field capacity (100% moisture content) by thoroughly watering the soil sample until it was completely saturated and then letting it drain until consistent. You can see both of these samples in Fig. 2. With these capacitive thresholds, we were able to map arbitrary values to actual moisture percentages
The rest of the sensors returned their values in International System units, so the only calibration needed was accuracy-based. Our approach for them was to use one-point calibration. For example, we had to add an offset to our humidity and temperature sensor values as they were inconsistent with other local, more accurate sensors.
For this project, the actuation unit needed to be energy-efficient, effective, and capable of conserving resources while delivering water directly to the plant roots. Given the project constraints, we opted for a servo-activated valve to utilize the potential energy of the water in the bottle. Drip irrigation is known to be 90% efficient in allowing plants to absorb the water applied, significantly reducing runoff and evaporation (University of Rhode Island, n.d.). Consequently, we decided to fabricate our own drip irrigation system using an irrigation dripper, a valve, and a servo motor to control the water flow. The servo motor is managed by an Arduino, which is in turn regulated by the decision-making model. Below is a video demonstration of how our system works.
To design an effective algorithm, we first need to understand the essentials of plant care. Plants must maintain a specific soil moisture range to thrive; for basil, this range is typically between 25% and 50% [8]. Over the long term, basil plants also require specific humidity and temperature ranges to stay healthy, with ideal humidity levels around 40-60% [9] and temperatures between 21-26°C [6]. The amount of water a plant needs is also influenced by the ambient humidity, as plants can absorb some moisture from the air [9]. It is generally not recommended to water plants at night, as this can lead to mold or other fungal growths that can adversely affect plant health [5]. Additionally, excessive temperatures can be fatal to plants in a short amount of time [6], requiring plant owners to respond quickly to prevent damage or loss. Finally, it is important for basil plants to receive the right amount of sunlight during the day for effective photosynthesis; basil plants require at least 6-8 hours of direct sunlight or 14-16 hours of artificial light per day to thrive, which is a daily average of between 150 to 600 μmol·m−2·s−1 [7], equal to an daily average of between 6522 to 26087 LUX.
The initial steps of the setup process involve connecting the Arduino to a WiFi network and synchronizing its real-time clock (RTC) with the current date and time from an NTP server. This ensures accurate timekeeping necessary for scheduled tasks and data logging. The necessary libraries, are included to provide various functionalities such as time synchronization, WiFi communication, sensor data acquisition, and actuator control.
Sensor thresholds and pin configurations are defined to monitor and control environmental factors like tem- perature, humidity, soil moisture, light levels, and water supply, which are crucial for maintaining optimal plant health. The setup includes defining macros for sensor thresholds, calibration values, and pin assign- ments, ensuring precise and reliable readings from the sensors.
The system then initializes these components, powering up the sensors and connecting to the WiFi network. Once connected, the time is synchronized with an NTP server to ensure the RTC is accurately set. After synchronization, the system disconnects from the WiFi to conserve power.
Following the initial setup, the system enters a low-power mode while performing periodic measurements and actuations. We will get further into this in the following subsections.
Setup(){ Connect_to_WIFI(); Synchronize_Time(); Disconnect_WIFI(); Power_up_sensors(); Setup_sensors(); Setup_low_power_mode(); }Low power mode
The Arduino microcontroller supports multiple low power modes. We decided to use the Software Standby Mode which can be directly transitioned to from the normal mode and consumes less power than the Sleep mode. We do a one time setup to configure Arduino to use the Software Standby Mode whenever the "wfi" instruction is executed. The Arduino comes back to normal mode whenever it receives an interrupt from the RTC (Real time clock) module.
void setup_low_power_mode() { *SYSTEM_PRCR = 0xA502u; // Disable write protection *SYSTEM_SBYCR = (volatile unsigned short) 1u << 15u; // Use Software Standby mode. *SYSTEM_PRCR = 0xA500u; // Enable write protection *ICU_WPEN = 1u << 24u; // Software standby returns by RTC alarm interrupt enabled }
while True do Read Battery Level if (Battery Level > Threshold) then Sense_and_Actuate() Set_Next_Wake_up_Time() Store_Data() else if (Battery Level < Threshold and Light Intensity from RAM > Threshold) then Sense_and_Actuate() Set_Next_Wake_up_Time() Store_Data() else Set_Next_Wake_up_Time() end if enter_low_power_mode() end whileEntering Low power mode
void enter_low_power_mode(bool wake_up_hour) { // Retrieve the date and time from the RTC and print them RTCTime currentTime, alarmTime; AlarmMatch alarm, matchTime; RTC.getTime(currentTime); int minutes, hour; if (wake_up_hour == 0){ hour = currentTime.getHour(); alarmTime.setHour(hour + 3); matchTime.addMatchHour(); } else { minutes = currentTime.getMinutes(); alarmTime.setMinute(minutes); matchTime.addMatchMinute(); } RTC.setAlarmCallback(alarmCallback, alarmTime, matchTime); //sets the alarm callback delay(500); // Wait for previous operations to finish asm volatile("wfi"); // Stop here and wait for an interrupt }
The core of the system is the actuate() function, which ensures optimal conditions for the basil plant by calling the following functions: control_light(), control_temperature(), control_bottle_sensor(), and control_soil_moisture().
void actuate() { RTCTime currentTime; RTC.getTime(currentTime); int hours = currentTime.getHour(); control_light(hours); control_temperature(hours); control_bottle_sensor(); control_soil_moisture(hours); }Control temperature():
If the temperature deviates from the ideal range (21-26°C) [6], the respective function to adjust the temperature is called. If the temperature remains outside this range for three consecutive days, the system will notify the user to relocate the plant. Immediate notification is sent if the temperature exceeds the emergency threshold (t < 10°C or t > 32°C).
#define TEMPERATURE_LOW_THRESHOLD 10 // THE PLANT NEEDS TO BE MOVED INMEDIATELLY #define TEMPERATURE_HIGH_THRESHOLD 32 // THE PLANT NEEDS TO BE MOVED INMEDIATELLY #define TEMPERATURE_LOW_IDEAL 21 #define TEMPERATURE_HIGH_IDEAL 26 void control_temperature(int currentTime) { // Handle low temperature if (sensor_data.temperature < TEMPERATURE_LOW_IDEAL) { handle_low_temperature(); } else { if (!different_day_temp && currentTime == 23) cold_days = 0; // Reset cold days counter } // Handle high temperature if (sensor_data.temperature > TEMPERATURE_HIGH_IDEAL) { handle_high_temperature(); } else { if (!different_day_temp && currentTime == 23) hot_days = 0; // Reset hot days counter } } void handle_low_temperature() { if (sensor_data.temperature < TEMPERATURE_LOW_THRESHOLD) { //light_up_matrix(MATRIX_NEED_WARM_NOW); DEBUG_PRINTLN("Move the plant to a warmer location now."); return; } if (cold_days < MAX_NOT_IDEAL_DAYS && !different_day_temp) { cold_days++; different_day_temp = true; } else { //light_up_matrix(MATRIX_NEED_WARM); DEBUG_PRINTLN("Move the plant to a warmer location."); } } void handle_high_temperature() { if (sensor_data.temperature > TEMPERATURE_HIGH_THRESHOLD) { DEBUG_PRINTLN("Move the plant to a cooler location now."); //light_up_matrix(MATRIX_NEED_COLD_NOW); return; } if (hot_days < MAX_NOT_IDEAL_DAYS && !different_day_temp) { hot_days++; different_day_temp = true; } else { DEBUG_PRINTLN("Move the plant to a cooler location."); //light_up_matrix(MATRIX_NEED_COLD); } }Control light():
This function manages the light exposure for the plant. If the average light intensity falls outside the acceptable range (lux < 6,522 or lux > 26,087) [7], the corresponding function is triggered. Continuous exposure to inappropriate light levels for three days will prompt the system to alert the user to move the plant.
#define LUX_LOW_THRESHOLD 6,522.0 #define LUX_HIGH_THRESHOLD 26,087.0 void control_light(int currentTime) { // to calculate the average if(currentTime >= 8 && currentTime <= 19) { lux_sum += sensor_data.lux; lux_times++; } else if(currentTime == 23){ lux_average = lux_sum / lux_times; lux_sum = 0; lux_times = 0; // Handle low light if (lux_average < LUX_LOW_THRESHOLD) { handle_low_light(currentTime); } else { shade_days = 0; // Reset shade days counter } // Handle high light if (sensor_data.lux > LUX_HIGH_THRESHOLD) { handle_high_light(currentTime); } else { light_days = 0; // Reset light days counter } } } void handle_low_light(int currentTime) { if (shade_days < MAX_NOT_IDEAL_DAYS) { shade_days++; } else { DEBUG_PRINTLN("Move the plant to a lighter location."); light_up_matrix(MATRIX_NEED_SUN); } } void handle_high_light(int currentTime) { if (light_days < MAX_NOT_IDEAL_DAYS) { light_days++; } else { DEBUG_PRINTLN("Move the plant to a location with more shade."); light_up_matrix(MATRIX_NEED_SHADE); } }Control bottle sensor():
This function monitors the water bottle. If the water level is low, the system will notify the user to refill it.
void control_bottle_sensor() { if (sensor_data.water_level == 0) { DEBUG_PRINTLN("Fill the bottle with water. "); light_up_matrix(MATRIX_NEED_WATER); } }Control soil moisture():
Operating hourly between 8AM and 7 PM, this function checks the soil moisture level. If the soil moisture drops below 25% [8], the plant will be watered for three cycles. The default time is three minutes, which may be increased or decreased depending on the humidity. If the humidity is below 40%, the time will increase by 15%; conversely, if humidity exceeds 60%, the duration decreases by 15%. In between the cycles, we will allow the soil to absorb some water for one minute, check if the soil moisture has reached the target, and if not, continue with another shorter cycle. If moisture remains below 25%, the watering time increases by 15%. To ensure accuracy when watering, we reduce watering times as the moisture slowly reaches its target value. We do this by reducing the watering time by 15% every cycle that hasn’t reached the target value. Finally, with excessive moisture of over 70%, a notification is sent to move the plant, as it is inferred that it is getting watered excessively through means other than our system.
#define INITIAL_WATERING_DURATION 180 //(3 minutes) #define MAX_WATERING_CYCLES 3 #define MOISTURE_THRESHOLD 25 #define MOISTURE_HIGH_THRESHOLD 50 //Percentage void control_soil_moisture(int currentTime) { float soil_moisture = sensor_data.moisture_1; if(soil_moisture > MOISTURE_HIGH_THRESHOLD){ DEBUG_PRINTLN("Move the plant indoors. Excesive moisture. "); } //Water only in between 8:00 A.M. and 7:00 P.M. else if(currentTime >= 8 && currentTime <= 19) { short int cycles = 0; float watering_duration = INITIAL_WATERING_DURATION; // Adjust watering duration based on humidity if (sensor_data.humidity < HUMIDITY_LOW_IDEAL) watering_duration *= 1.15; else if (sensor_data.humidity > HUMIDITY_HIGH_IDEAL) watering_duration *= 0.85; // Principal cycle while (soil_moisture < MOISTURE_THRESHOLD && cycles < MAX_WATERING_CYCLES){ openValve(watering_duration); delay(1000*60); // Wait for 1 minute to allow water to percolate measure_sensors(); soil_moisture = sensor_data.moisture_1; cycles += 1; if (soil_moisture < MOISTURE_THRESHOLD) // Increase watering duration if the soil is still dry watering_duration *= 0.85; } } }Set Next Wake up Time():
The Green Guardian system employs an adaptive duty cycling method to manage energy consumption efficiently. The algorithm evaluates the battery level and sets the next wake-up interval accordingly. If the battery level is above a predefined threshold, the system schedules the next wake-up in one hour. Similarly, if the battery level is below the threshold but the solar panel is receiving sufficient light, the system also sets the next wake-up duration to one hour. However, if both the battery level and the light intensity are below their respective thresholds, the system extends the wake-up interval to three hours. This adaptive approach ensures that the system's energy demand aligns with the available energy supply.
if (Battery Level > Threshold) then Set wake up duration = 1 hour else if (Battery Level < Threshold and Light Intensity > Threshold) then Set wake up duration = 1 hour else Set wake up duration = 3 hours end if
The notification system is a key component of the Green Guardian project. It provides visual feedback to the user based on the plant's status using an LED matrix display on the Arduino UNO R4 WiFi. Different patterns and symbols are shown to indicate various conditions and alerts, as seen in Fig. 6.
The LED matrix display shows different symbols to alert the user about the plant's conditions. Below are the symbols used in the notification system:
The image on the left shows the Arduino UNO R4 WiFi with the LED matrix display in action. The image on the right explains the different symbols used in the notification system, including:
To evaluate the effectiveness of our system in keeping plants alive, we designed the following testbed, shown in Fig 7. We acquired two basil plants from the same store, ensuring they were in similar conditions. We placed them side by side in the same space and asked two participants to take care of one plant each: one using the Green Guardian system and one without it. We monitored relevant variables in both plants, such as soil moisture, humidity, and temperature. Additionally, we recorded a timelapse of the plants’ progress and evaluated their condition after 5 days.
We chose basil plants for this test due to their extreme sensitivity to environmental conditions and their wide availability (most supermarkets sell this plant) making them an ideal candidate for evaluating the effectiveness of automated plant care systems. Basil requires consistent soil moisture, proper light exposure, and adequate temperature for optimal growth. This makes it a good indicator of the Green Guardian’s ability to maintain these parameters within the optimal range. Furthermore, basil is a commonly grown herb both indoors and outdoors, making our findings relevant to a wide range of users.
We also aimed to quantify the time required for the Arduino to wake up from sleep and begin sensing. However, the RTC module we intended to use for this measurement has a resolution of 1 second, which is inadequate since the entire operation takes less than a second. Therefore, we conclude that the interval time between CPU becoming active and turning on the sensing module is less than a second.
We also defined a success metric to evaluate how our system performs compared to a person manually watering the plant. The success metric is defined as the ability of our system to maintain the moisture of plant within 15-40%. We share the results in the next section.
We collected sensor data over five days, as depicted in Fig 8. The first chart illustrates the temperature in Celsius, which remains relatively stable throughout the observation period. The second chart presents humidity data. The third chart displays the amount of light reaching the plant. The fourth chart indicates the presence of water in the bottle, with ’1’ representing a filled bottle and ’0’ indicating an empty one. The fifth chart shows the moisture levels of plant 1, which was managed by the Green Guardian system. The system effectively maintained the plant’s moisture around 20%. The sixth chart depicts the moisture levels of plant 2, which was cared for by an external individual. The data indicates that this plant was predominantly over-watered. The final chart demonstrates the system’s battery level. In summary, the Green Guardian system successfully monitored various parameters and maintained appropriate watering intervals with minimal human intervention, except for refilling the water bottle.
We decided to record a time-lapse of the test, as seen here:
We also assessed the success metrics (Fig 9.). The Green Guardian system maintained a healthy plant moisture level (15-40%) for 66.10% of the time. In contrast, plant 2, which was watered manually, consistently exhibited high moisture levels and only maintained healthy moisture for 0.0% of the time. These results demonstrate that our system is capable of sustaining healthy moisture levels for plants.