Automatic Water Sprinkler system using Arduino.

Automatic Water Sprinkler system using Arduino.

Automatic Water Sprinkler system using Arduino.

In this article we are going to make something very interesting, if we want to turn OFF or ON any of our homeappliances or device any particular time of day automatically.

For example if we want our geyser will automatically turn ON in the morning and after sometime it will turned OFF, something like this we are going to make in this article, we will learn how to trigger a relay with an Arduino for an specific time. 

Components Required

Designing the PCB

To design the circuit and PCB, we used EasyEDA which is a browser based software to design PCBs.

Designing the circuit works like in any other circuit software tool, you place some components and you wire them together. 

Then, you assign each component to a footprint.

Having the parts assigned, place each component. When you’re happy with the layout, make all the connections and route your PCB.


Save your project and export the Gerber files.

Ordering the PCBs at PCBWay

This project is sponsored by PCBWay. PCBWay is a full feature Printed Circuit Board manufacturing service.

Turn your DIY breadboard circuits into professional PCBs – get 10 boards for approximately $5 + shipping (which will vary depending on your country).

Once you have your Gerber files, you can order the PCB. Follow the next steps.

1. Download the Gerber files – click here to download the .zip file.

2. Go to PCBWay website and open the PCB Instant Quote page.

3. PCBWay can grab all the PCB details and automatically fills them for you. Use the “Quick-order PCB (Autofill parameters)”.

4. Press the “+ Add Gerber file” button to upload the provided Gerber files.

And that’s it. You can also use the Online Gerber Viewer to check if your PCB is looking as it should.

Now select the shipping method , the one you prefer and has cost efficient.

You can increase your PCB order quantity and change the solder mask color. I’ve ordered the Green color.

PCBWay has lots of other staggering solder mask, Now they can produce pink, orange, grey, even the transparent solder mask. 

Apart from this they also provide Black core PCB.

Once you’re ready, you can order the PCBs by clicking “Save to Cart” and complete your order.

After approximately one week using the DHL shipping method, I received the PCBs at my place.

As usual, everything comes well packed, and the PCBs are really high-quality. 

The letters on the silkscreen are really well-printed and easy to read. Additionally, the solder sticks easily to the pads.

Let's Make it...!

Now grab all the components whose list is mention above, and soldered on the PCB.

Be careful with AC connections , you may take help an expert.

Schematic for connection of loads.

Connect the bulbs as shown in the schematic above.

CODE.

#include <RTClib.h> // for the RTC

// Instance of the class for RTC
RTC_DS1307 rtc;

// Define check in time
const int ONHour1 = 18;
const int ONMinute1 =00;
const int OFFHour1 = 22;
const int OFFMinute1 = 00;
//////////////////////////////////
const int ONHour2 = 04;
const int ONMinute2 =00;
const int OFFHour2 = 06;
const int OFFMinute2 = 00;


int CurrentHour;
int CurrentMinute;
// Pins for LEDs and buzzer

const int relay1 = 2;
const int relay2 = 3;



void setup() {
  Serial.begin(9600);
  rtc.begin();
   pinMode(relay1, OUTPUT);
   pinMode(relay2, OUTPUT);   
 
}
void loop() {
 DateTime now = rtc.now();
   // Save check in time;
    CurrentHour = now.hour();
    CurrentMinute = now.minute();
  Serial.println(CurrentHour);
  Serial.println(CurrentMinute);
  if((CurrentHour==ONHour1) && (CurrentMinute == ONMinute1)){
    digitalWrite(relay1,HIGH);
    digitalWrite(relay2,HIGH);
    Serial.println("LIGHT ON");
    }
if((CurrentHour==OFFHour1) && (CurrentMinute == OFFMinute1)){
      digitalWrite(relay1,LOW);
       digitalWrite(relay2,LOW);
      Serial.println("LIGHT OFF");
    }
      if((CurrentHour==ONHour2) && (CurrentMinute == ONMinute2)){
    digitalWrite(relay2,HIGH);
    digitalWrite(relay1,HIGH);
    Serial.println("LIGHT ON");
    }
if((CurrentHour==OFFHour2) && (CurrentMinute == OFFMinute2)){
      digitalWrite(relay2,LOW);
       digitalWrite(relay1,LOW);
      Serial.println("LIGHT OFF");
    }
}

Open this code in your Arduino ide, and  edit the ‘ON’  ‘OFF’ time according to your need.

After doing the all the necessary changes , upload the code into your arduino nano board after selecting right board and COM port.

Application

This project can be used in garden to sprinker water everyday.Also we can use to supply water in our roof tank everyday in specific time.


Leave a Reply

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

Back To Top