Hi everyone and welcome to my tutorial in which
i am going to build a simple plant watering system based on arduino.
I will start by describing all of the needed parts, then I will show my code
and finally I will explain how I connected everything.
For the project you will need:
arduino board, I'm using Arduino Uno,
soil moisture sensor, I'm using FC-28,
relay module,
3-12V water pump,
12V power supply for water pump,
5V power supply for arduino,
small breadboard,
some cables,
plastic pipe for the water pump,
and a water bottle!
No we can examine the code for the project.
I started with creating new sketch and declaring needed variables,
then I went to the setup block and prepared two pins -
one for input and one for output.
After that I went to the main loop and created a simple "if" statement,
which checks if the plant needs to be watered.
If the input is high, arduino will switch one the pump  for one and a half second.
My plant does not need much water so it is enough.
Then the pump is switched off.
After that or if the input is low,
arduino will wait one hour to check again.
Okay, so lets connect everything.
As I declared in the code, the second digital pin from arduino goes to the digital pin in the moistuire sensor
and the eighth digital pin goes to the INI in relay module
Now we need to connect ground and a 5V pin to both the moistuire sensor and the relay module.
To split the 5V into two cables I use a small breadboard.
Now connect two cables to the relay module like in the video.
The red cable goes to the pump (positive), I used a crocodile cable to connect it.
The black and white cable is the plus cable from the power supply.
If I connected everything correctly we should put the water and the pipe to the water bottle.
Connect power supply both for the pump and for the arduino itself
Now our simple watering arduino system should work.
That's all, if you have any questions feel free to ask.
In the description you can find the names of all parts, code and connection scheme.
If you liked this video please live a like, bye for now!
