Project Bel Automatic uses the RTC in 1302 and Arduino

           ON Years Now Singer, misalnya in the Year 2016 as Now the singer, Supplies ABOUT automation is played big hearts Everything lines of Life, misalnya, We Can turn on the house lights From A Distance, We Can control the aircraft in the tendon order for Until NOT spill, We Can Operate automatic opening door WITH swiping a card such as RFID, we can control the hardware using android And Much Much The other example.
            AT times like now, Supplies ABOUT automation is very important, such as inviting What would I have previously made Nowadays Is Important In A AN indicators Tutoring Institutions, schools and universities, it is A bell indicator Substitution hours.
            Bel Substitution hours it would be nice if you can go off Alone Without ADA Yang pressing button pressed OR. One reason is the prayer of Human carelessness / teacher / Administrative staff (TU) Who can forget Only a few minutes due to the busyness BECAUSE WITH OR can also called Human Error.
             For reviews that Writer MAKE A Ie Bel automation system automatically based on the clock Substitution By Jam Already previous disetting And of course hours disekolahan OR WITH hour Must be the same campus setting the clock The ADA AT tool / her prototype.

PROTOTYPE design


The necessary requirement BETWEEN Design hearts lie:

  1. Arduino UNO Board 1 Piece
  2. Arduino IDE Version 1.6.9
  3. RTC DS 1302 1
  4. RELAY SRD-05VDC-SL-C
  5. Buzzer OR Alarm
  6. Cable ELECTRICAL for review Buzzer
  7. Jumper taste
  8. Switches
  9. Jack
  10. Breadboard
  11. USB cable

The circuit schematic

The circuit schematic



// Free Tutorial Arduino
// www.ioisalman.com 

#include 
#define RELAY1  4

MyRealTimeClock myRTC(6, 7, 8); //pin clk, dat,rst

void setup() {
Serial.begin(9600); //boudrate
pinMode(RELAY1, OUTPUT);  
myRTC.setDS1302Time(01, 19, 10, 7, 17, 9, 2016); // seconds, minutes, hours, days of the week, date, month, year 
}
void loop() {

  int hour=myRTC.hours;
  int minute=myRTC.minutes;
  int second=myRTC.seconds;
  int lastread=0;
  int time1,time2,time3;

  myRTC.updateTime();
  delay(1500);
  time1=myRTC.hours-lastread;
  time2=myRTC.minutes-lastread;
  time3=myRTC.seconds-lastread;

  
if ((time1==7)&&(time2==30)&&(time3==0)) // sound once
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000);      
}
//====================== + 1 Second =========================
if ((time1==7)&&(time2==30)&&(time3==1)) // sound once
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000);      
}


if ((time1==10)&&(time2==0)&&(time3==0)) // sound twice
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000); 
    digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);
   digitalWrite(RELAY1,0);           // Turns ON Relays 1
   Serial.println("Buzzer Off");
   delay(1000);      
}
//====================== 1 second ===========================
if ((time1==10)&&(time2==0)&&(time3==1)) // sound twice
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000); 
    digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);
   digitalWrite(RELAY1,0);           // Turns ON Relays 1
   Serial.println("Buzzer Off");
   delay(1000);      
}

if ((time1==10)&&(time2==20)&&(time3==0)) // sound once
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000);     
}
//====================== 1 second ==========================
if ((time1==10)&&(time2==20)&&(time3==1)) // sound once
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000);     
}



if ((time1==12)&&(time2==0)&&(time3==0)) // sound twice
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000); 
    digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);
   digitalWrite(RELAY1,0);           // Turns ON Relays 1
   Serial.println("Buzzer Off");
   delay(1000);      
}
//====================== 1 second ==========================
if ((time1==12)&&(time2==0)&&(time3==1)) // sound twice
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000); 
    digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);
   digitalWrite(RELAY1,0);           // Turns ON Relays 1
   Serial.println("Buzzer Off");
   delay(1000);      
}
if ((time1==12)&&(time2==50)&&(time3==0)) // sound once
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000);     
}
//=================1second==========================
if ((time1==12)&&(time2==50)&&(time3==1)) // sound once
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000);     
}

if ((time1==15)&&(time2==20)&&(time3==0)) // sound twice
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000); 
    digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);
   digitalWrite(RELAY1,0);           // Turns ON Relays 1
   Serial.println("Buzzer Off");
   delay(1000);      
}
//==================1second===========================
if ((time1==15)&&(time2==20)&&(time3==1)) // sound twice
{
   digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);  
   digitalWrite(RELAY1,0);          // Turns Relay Off
   Serial.println("Buzzer OFF");
   delay(1000); 
    digitalWrite(RELAY1,1);           // Turns ON Relays 1
   Serial.println("Buzzer ON");
   delay(3000);
   digitalWrite(RELAY1,0);           // Turns ON Relays 1
   Serial.println("Buzzer Off");
   delay(1000);      
}


//================ Screen ==============================
Serial.print("Current Date / Time: "); 
Serial.print(myRTC.dayofmonth);
Serial.print("/"); 
Serial.print(myRTC.month); 
Serial.print("/");
Serial.print(myRTC.year); 
Serial.print(" ");
Serial.print(myRTC.hours); 
Serial.print(":");
Serial.print(myRTC.minutes);
Serial.print(":");
Serial.println(myRTC.seconds); 
delay(0);

}


Subscribe to receive free email updates:

0 Response to "Project Bel Automatic uses the RTC in 1302 and Arduino"

Post a Comment