By- Srinidhi Ayyagari
Gardening with IoT
“The love of gardening is a seed which once sown, never dies.”
It is always wonderful to have a garden filled with colorful and lovely plants. They have a peaceful and soothing effect on our cluttered minds. To plant a garden is truly, to plant happiness.
But in today’s busy world, taking care of our dear plants becomes a tough job. Continuously monitoring the plants is a must, to make sure they grow healthily. One has to intuitively guess when to water the plants and which plant to water.
And when there is a home garden with a large variety of different plants it becomes even more difficult because different plants have different water requirements.
As a result, This leads to either overwatering or under watering of the plants. Both of which are harmful for the plant’s health.
It might seem that tending to one’s home garden is one big deal.
But hey! Why fret when gardening with IoT is so much fun! A little Raspberry pi know-how along with some basic idea on Python Programming would do the trick!
Let us get to know the crux of one simple yet interesting project. Now, our idea is to treat each plant’s water requirement differently and water them automatically based on need only. Each plant is consider as an individual entity.
So, at a given point of time only those plants which require water will be automatically supplied with water. This reduces the water wastage and ensures the healthy growth of plants.
Let’s get a quick overview on the software and hardware components:
Raspberry pi 3B: Widely used board for various IOT projects. It acts like a computer and various devices such as mouse, keyboard, and sensors can connect with it
Python: Raspberry pi is programmed by Python programming language
Moisture sensor: Detects the presence of moisture in soil by detecting soils resistance. Dry soil has more resistance while soil with moisture has less resistance
Electric solenoid air valve: It is a basic valve used to control the flow of water depending upon some information received (from moisture sensor here)
Relay: Relays are switches used to open or close circuits electronically.
Water pump: It moves the flow of water from the water source to the valve and eventually, to the plant.
12V Batteries: It is used to provide power to the electric solenoid valves.
Now, how do we go about this?
A moisture sensor and a 12V electric solenoid valve is assigned to each plant.
As soon as the moisture in a plants soil is detected to be below the threshold level, the electric valve connected to the respective plant opens (rather, its relay switches on) and water is supplied to that particular plant only.
To get a very rough idea on the arrangement of the components, check out this block diagram:
As it is observed, both the moisture sensors are directly connected to the Raspberry pi through some GPIO. Whereas the electric solenoid valves are connected through a relay. When the relay switches on, the valve connected to it opens, else the valve is closed.
(But watch out! If the relay is a normally close one, it will be the opposite!)
Additionally, the electric solenoid valves have a 12V power source. The pump is connect to Raspberry pi through a relay. It moves the flow of water from the water source towards the valve using a pipe.
The moisture sensors will be consider as the inputs. And the relay of the electric solenoid valves and the pump (at the water source) will be the outputs.
But then how would we program this project?
Since this project is only for two plants, there will be four simple cases to be consider:
|1.||Both plants lack moisture||Both valves are open|
|2.||Only plant 1 lacks moisture||Only valve 1 is open|
|3.||Only plant 2 lacks moisture||Only valve 2 is open|
|4.||Both plants have sufficient moisture||Both valves are close|
And for these cases, the diagrammatic representation of the algorithm is:
Simple and neat, right? Writing your own code should become easy now.
Well then, your launchpad is ready! You now have a basic idea on how this project works. So, go ahead, and build your very own project and say hello to gardening with IoT!
Because on some days, the coolest thing you can do is Say Hello! 🙂
. . .
This project was developed in the Summer training Program on ‘Integrated approach to using IoT, Cloud Computing, Mobile Application development and AI’, organized by DIC-MHRD, Microsoft University Relations, IGDTUW, ETIL Pvt. Ltd. [JUNE’19 TO JULY’19]
Our team won the runner up prize for developing this simple yet awesome project! 😉
Karnika Pandey, Netaji Subhash University of Technology
Srinidhi Ayyagari, Indira Gandhi Delhi Technical University for Women