Self Watering System for Plants Using Arduino UNO
by ElectronicSciTech in Circuits > Arduino
3182 Views, 5 Favorites, 0 Comments
Self Watering System for Plants Using Arduino UNO
Introduction:
Won't it be nice to have a fully automated garden in your balcony filled with plants where you enjoy the fresh air every morning? In this project, my goal is not to show you how to make a garden, but to make a basic system where the plant takes care of its own accurate water supply, without any human intervention.
At the end of this project, you will have made your fully automated self watering system. Also there are many more versions of this self watering system like connecting it to your computer/laptop to read the data (or) to use a servo motor and plant more than one plant simultaneously. This project has a huge scope in the agricultural sector too, with much more advanced version. My goal is to show you the simplest of all of the sophisticated systems available.
Get Your Supplies!
What you need for a working system:
- Arduino Uno (including USB Programming cable).
- Two Channel 5V Relay Module.
- Soil moisture sensor.
- 9V Battery along with Battery cap.
- 9V DC Submersible Water Pump along with tube.
- Male to Male connecting wires.
- Male to Female connecting wires.
- Female to Female connecting wires.
- Breadboard.
- Insulation Tape.
- Screw for the relay module (NO and COM ports).
Software:
- Arduino IDE is only used for uploading the code to Arduino UNO.
Get Your Programming Done!
- If you know Arduino Programming, this step will be much easier for you and you can also configure the code on your own.
- For this project, I have used two types of code. One is where the soil moisture sensor sends digital output and I have named the file as digital-self-watering-system. The other is where the soil moisture sensor sends analog output, with which you can check the sensor value and the graph (using serial monitor and serial plotter in 'tools' menu). I have named this file as analog-self-watering-system.
- You can find the files for the code below and the image of the code above (Note that you have to download these files and open it on Arduino IDE. So before starting this project, you must have the Arduino IDE installed. For the installation, you can refer to youtube videos (or) to the Arduino official website (i.e. https://www.arduino.cc/) (or) if you are facing any issues, you can ask in the Comments and Questions section)
- After this, insert the USB cable in the Arduino to your laptop/pc. You can first upload the digital-self-watering-system to the Arduino, since the digital version is much simpler. After you complete your project, you can change your code and upload the analog version and play around with the Serial Monitor and the Serial Plotter (which is there in Tools>Serial Monitor or Tools>Serial Plotter)
- Note that when you download the (.ino) file, you have to go to Arduino IDE and open the file. Arduino will ask you to create a folder and you can go ahead and create a folder and start using the (.ino) file.
Get Your Connections Done!
- Once the code is uploaded to your Arduino UNO, unplug the USB cable from your laptop/pc. Now we shall start the connections.
- Use 2 female-to-female connecting wires to connect the soil moisture sensor.
- The Arduino UNO has 2 ground ports in the Power section. By using male-to-female connecting wires, connect the GND from the soil moisture sensor to the GND in the Arduino. Then connect the DO pin from the sensor to pin number 8 in the Digital pins section in the Arduino. Then connect the AO pin from the sensor to A0 pin in the Arduino.
- For the relay, I will be using the 2nd relay that is mentioned as [K2] and the pins as [J2]. Connect the GND of the relay to the other GND of the Arduino. Then connect the IN2 pin in the relay to pin number 13 in the Digital pins section in the Arduino.
- Now we need to split the 5V supply from the Arduino to the relay and the sensor. For this, I have used a Breadboard. Connect the 5V supply from the Arduino's Power section to any row of the breadboard using a male-to-male connecting wire, and use this row to supply 5V to the sensor and the relay module. The pin will be mentioned as VCC for both the relay and the sensor.
Connecting the Pump to the Relay
- I consider this as a good step to pause. First you need to make sure that WATER SHOULD NOT SPILL ANYWHERE ON THIS PROTOTYPE EXCEPT THE MOTOR. This is very crucial as your Arduino might also get spoilt if it comes in contact with water.
- Coming back to the connections, Connect the -ve (black wire) of the battery cap to the -ve of the motor, using an insulation tape. Do not connect the battery yet!.
- Connect the +ve of the motor to the NO of the relay (Normally Open) and the +ve(red wire) of the battery cap to the COM of the relay (Common). You can use a wire extension for the +ve of the motor as I used, since my wire was small.
- CAUTION: NEVER CONNECT TWO SUPPLIES TO THE RELAY LIKE +VE SUPPLY IN (NO) AND -VE SUPPLY IN (COM). THIS WILL LEAD TO SHORT CIRCUIT, INTURN DAMAGING THE ARDUINO.
- Now connect the battery to the battery cap.
Get Your Project Done!
Now insert the soil moisture sensor in the plant. Do not thrust it in, just place it at a moderate height and insert it in the soil
Congratulations!!
Your Project is done!
Now find a desired location for the tube to go to the plant and connect your Arduino to your laptop/pc. Since we have already uploaded the program to the Arduino in the beginning, your prototype will function now. You can change your code from digital-self-watering-system to analog-self-watering-system as mentioned earlier, and you can see the Serial Plotter and the Serial Monitor in the IDE.
Get to Know the Working of Your Prototype!
- The soil moisture sensor sends the readings/signals to the Control Board of it. The Control Board can give Digital Output (DO) or Analog Output (AO) from the readings to the Arduino UNO.
- With the help of the readings and the code, the Arduino decides whether to give supply to the Input Pin in the relay module (IN2) based on the readings. If the moisture in the soil is less, then the Arduino will give supply to the relay(HIGH). If it is more, the Arduino will not give supply to the relay (LOW).
- The relay is connected to the submersible water pump, and will give supply to it based on the commands from the Arduino.
- This is how the prototype works in a nutshell.
Thank you for viewing this Instructable. Please share it and feel free to post the photos of your prototype. If you have any issues pertaining to this project, let me know in the Comments and Questions Section.