IoT Enabled Soil Hydration System With Weather Forecasting

IoT Enabled Soil Hydration System With Weather Forecasting

My coding skills have always left a lot to be desired, but an obvious way to improve would be to reinforce what I know through cool projects & applications. As a thermodynamics enthusiast, the weather has always been a subject of intrigue and so, I've never shied away from classifying it as one of those "cool" things to wrap my head around. With the lockdown presenting some unprecedented free time to build something interesting, the IoT enabled Plant Hydration System with Weather Forecasting happens to be the result. 

Its Repertoire

  • It can forecast the weather for any major city in the world, for the next 7 days!
  • It determines the optimum water requirement for the plant by calculating the effect of the forecasted temperature & humidity on the soil
  • It presents the live humidity & temperature data of your current location
  • It signals the pump to supply water to the plant for the required duration
  • It constantly monitors the soil's moisture & sends the data wirelessly to your smartphone over WiFi

Go With The Flow-Chart

The project's backbone is its python code. It triggers the Arduino into action while running API calls under the hood to forecast data for the average temperature & humidity of the day. The flow can be described as below-

  • Python gathers information about the weather for a single day from https://openweathermap.org/
  • The command to gather forecast data from the net is sent out in the wee hours of the morning.
  • It compares the forecast to historical weather data related to the city of interest
  • Considering the effects of humidity & temperature on the rate of evaporation from the plant's soil, the code calculates the quantity of water that the plant would need to keep it healthy.
  • It sends a signal to the Arduino to do the heavy lifting.
  • The Arduino, through a relay circuit, controls a 12V DC water pump. The pump is pre-calibrated to run for the precise time required to deliver water to the plant.
  • The soil's dryness is continuously monitored with a soil moisture sensor & its reading are transmitted over WiFi through the NodeMCU [ESP8266] module to the users' phone. This is done through the freely available Blynk servers [https://blynk.io/] with a couple of lines of code

Hallelujah! For Python Libraries

Although the project's title may seem like a mouthful & daunting at first glance, the opensource python libraries that are on offer for projects like these, make it easy undertaking for even coding dummies like myself.

  • Pyserial - helps establish a communication line with the Arduino serial monitor with some simple lines of code.
  • PyOWM - "is a client Python wrapper library for OpenWeatherMap web APIs. It allows quick and easy consumption of OWM data from Python applications via a simple object model and in a human-friendly fashion." That's what the website says & I'd say that's spot on.

The Building Blocks

  • Arduino micro-controller
  • NodeMCU [ESP8266] WiFi Module
  • DHT 22 Temperature & Humidity Sensor
  • Soil Moisture Sensor
  • Liquid Crystal Display [16 x 2]
  • 12 DC Water Pump
  • Single Relay Module
  • Switched Mode Power Supply [230V - 12V]
  • Jumper Cables & Bread Boards

Under The Hood

The forecasted data is compared with the average temperature & humidity trend of the city of interest, and a crude classification of the water requirement for the plant is established. I based the logic on a very valuable resource from yesteryear that shed light on the rate of evaporation from the surface of the soil titled, "Factors affecting the evaporation of moisture from the soil By F. S. HARRIS, Director and Agronomist, and J. S. ROBINSON, Fellow in Agronomy, Utah Agricultural Experiment Station, dated 1916"

A major excerpt from the study is

"Evaporation depends upon the temperature of the evaporating surface, the dryness of the air, and the velocity of the wind. The hotter the day, the greater the evaporation; the drier, the greater the evaporation—the ceaseless sucking up of moisture" -

Humidity greatly retards evaporation from the soil surface and wind speed greatly increases it. Since the wind speed is a function of the obstacles in the way of the airflow,[buildings, large trees etc.] I decided to neglect it in the study & just use humidity as a measurable quantity.

The water requirement of the plant was more of a "touch & feel" decision. The tactile feedback of wetting the soil & deciding if it was moist enough or not was used as a basis to determine the levels of moisture.

No alt text provided for this image

I ran multiple tests on the soil's behaviour with temperature & humidity through the span of a day for different varieties to figure out an optimum water quantity to maintain moisture.

No alt text provided for this image
No alt text provided for this image

The 12V DC water pump was calibrated to dispense the required volume of water as a function of to time of operation.

No alt text provided for this image

Far From a Final Solution

This is purely a prototype. Obviously it has its flaws. Pretty glaring ones if I'm being honest. I hope to incrementally improve on the sticky points & develop a more holistic solution to the problem of overwatering.

  • It does not have a graphical user interface
  • It uses 2 different microcontrollers to do what it does, there is scope to minimize it
  • As the design stands today, it requires the laptop [connected to the arduino] to send signals for the program to initiate. That would mean the laptop to be kept near your garden each time a signal needs to be sent! Talk about the inconvenience! We could use the Rasberry Pi to solve this problem
  • Each time this system needs to be installed on a new plant, the pump will need to be re-calibrated. The mass of soil available in the new pot and the surface area of the soil exposed to evaporation are the two major parameters that affect the moistness of the soil. These can vary with pot size & shape and so, will need to be reset each time

Although I personally prefer the mindful practice of watering the garden myself whilst listening to the chirping birds and taking in the freshness of the early morning air, this system could be useful in situations when the physical presence of the user isn't possible.

No alt text provided for this image

Check out this montage for more details.










要查看或添加评论,请登录

Reuben Abraham的更多文章

社区洞察

其他会员也浏览了