Articles, Blog

DIY IoT drip irrigation


Hi! I’m Swapnil Bhoite. Today I’m going to show you one small project
that I have done in the last couple of weekends. So a lot of time what happens is, like when
I bought my plants, I was wondering what’s going to happen to them when I’m out for a
long vacation for like a month or two? Who is going to water them? Or otherwise, they would die. So that kept me thinking and I got an idea
to do one small project, so today I’m going to share that
with you guys. So let’s see the actual action happening. So I have this my phone you can see it’s connected
to a mobile network and not connected to my local Wi-Fi. So I’m already connected to the Raspberry
Pi via SSH. And I’m just going to execute this script
that I have written to just turn the water pump ON, which is called `test.py`. So I’m just going to execute this right now. You must have heard the noise that just the
relay made. So you can see this channel 1 is ON, and so
is the water pump is ON. So you can see. So the pump is ON, and you can see the water is already ON. And I’ve put this connector here because there
is some leaking water, so it won’t be wasted and it will go back into the container. You can see the script is running and the
log is running. So I have calculated that like 180 seconds
which is like 3 minutes is enough water for all my these my plants. So you can see it would keep the water pump
ON for like 180 seconds and it would automatically turn
it OFF then. So 180 seconds are done and it had turned
the water pump OFF now. So let’s start with the setup, so these are
my plants as you can see. So I have set up a small irrigation system
which is like just normal pipes and it has drip irrigation, this thing I don’t even know
what’s the name of this thing, but it just like it just drips the water. And so I have both of these set it up in my
both of these containers. So these pipes are connected to this thing
which is connected to a small water pump, where this water pump is taking water from
a big container. So I’m still testing it but I hope this much
water is would be enough for like 20 days or a month or so. So this is the connection of the motor. So it is going from my balcony to my living
room. You can see it’s like this. So this water pump is connected to a relay. So I’ll explain why I need the relay and this
later. And this relay is connected to a Raspberry
Pi and this is its power supply. So this is just a Raspberry Pi 4, but you
can I think you can use even use the Raspberry Pi 3 or so, because we don’t need as much
as power just to drive this motor. We just need a thing which is connected to
the Internet. So the reason we have the relay is like the
Raspberry Pi it operates on like 5 volts and a very limited
amount of current, but the water pump for water, the one we have it operates on like
12 volts and it takes a lot of current which this Raspberry Pi can’t drive on its own. So I got this 8 channel relay which is like
it takes a digital input like to turn ON the water pump or to turn OFF the water pump. And then it uses this 12-volt supply. And when then Raspberry Pi commands it to
turn the motor ON it actually gets the power supply from this 12-volt adapter and then
it passes to the water pump and it would turn ON or OFF. Then the next interesting thing is like as
you know this is a Raspberry Pi 4, so it has already built-in wireless connection and everything. So I have this connected to my home
internet and I have opened up my SSH port. So I can connect to this Raspberry Pi my SSH
from anywhere on the internet. So I can, even if I’m on like a vacation or
anything, I can just connect it from an SSH client from even from my Android phone or
anything, or any laptop or anything. So the next time what I’m doing right now
is I’m trying to integrate this setup with the Google Assistant so that whenever I’m
home, and not on vacation, and instead of logging into SSH every time just to turn the
pump on I can just ask the Google Assistant to run this script. So it would look something like this, I can
just say, Me: “Hey Google, ask smart pump to water my plants” Google Assistant: “Okay getting the test version of the
smart pump” Google Assistant: “Okay, turning on the water pump for 3 minutes.” Me: “Thanks!” So ideally it would just run this script and
it would turn the water pump ON for same this 180 seconds. Actually, this raspberry is simply a pocket-sized
PC so not just Google Assistant but its since it’s just a normal PC and an operating system
is running on it, Linux operating system is running on it, there are like limitless possibilities
what we can do with it. For example, I can just write one script as
well, to turn this water pump ON at, let’s say 8:00 a.m. every morning or something like
that. So yeah there are endless possibilities are
there. So yeah that was the project, so if you need
any help setting this up at your home, feel free to reach out to me in the comment section. Thank you.

3 Comments

Leave a Comment

Your email address will not be published. Required fields are marked *