Arduino based Watering System (Aqza)


Sometimes we may like gardening , but when we have a lot of works we have failed to watering the plants and destroy them permanently. So here i come up with an idea , micro-controller (Arduino) based watering system.

Materials Required

  • Arduino Uno
  • 20*4 LCD display
  • DS3231 RTC module
  • 4X4 keypad
  • 2CH Relay(With Coupling)
  • 1CH Relay (Without Coupling)
  • 12v 60W water pump
  • 220v Water Valve
  • 12v 5A power supply

Circuit Diagram

The complete project can be built on top of a breadboard with some connecting wires. The circuit diagram made using fritzing that shows the breadboard view of the project is shown below

Understanding the main idea

Basically the whole project is time based one.So i have used DS3231 RTC module which allows to interact with real time clock.The RTC module have a CR2032 battery which allows the module to remember the time when the module is not having the power.The system have functions,setting the real time,set start time,set ending time,allows manual mode.

Programming the Arduino

The complete Arduino Program is given at the end of this page you can jump down if you eager or read further to understand how the code works.


Here i have mentioned the libraries that i used inside the code. For this project i have used a 20X4 LCD 12C lcd display. You can refer more details about the lcd panel here.After that i have define my 4X4 kepad keys and it's related pins.

Here is the code for assigning the current date and time to the RTC module.


Here is the sample functions which i used to enter user input to the RTC module.At the same time i have did the validation for each of them.


Here is the condition which triggers the relay and activate  the motors and valve.

Practical Problem

When i testing my system at certain point i  have a huge problem.Sometimes i have setting the current time , starting time and ending time but suddenly when system faces a power cut the system only remember the  current time and forgot starting and ending times.So i have come up with a solution for this problem. Arduino has EEPROM: memory whose values are kept when the board is turned off (like a tiny hard drive).You could find more details here.


When the user set the starting and ending times,the function write the values to EEPROM.

 When the micro-controller restarts (power fails) , at the beginning of the program it reads the values from the EEPROM. 







For the complete code, please click here.


Comments

Popular Posts