Týždenné relé - Vyskúšajte online TU!


Stručný popis:

  • Týždenné riadenie relé s nastavením času zapnutia
  • Relé sú aktívne v nastavenom čase vo web rozhraní vo všetkých dňoch počas týždňa.
  • Možnosť zvolenia konkrétneho dátumu s nastavením času zapnutia (v súčasnosti neimplementované)
  • Ovládanie až 32 relé výstupov s centrálnou webaplikáciou, možno použiť jedno/dve Arduiná
  • Možnosť modifikovať názvy relé, prezrieť a aplikovať zdrojový kód.
  • Login systém s možnosťou zmeny mena a hesla
  • Hardvér pre projekt:
  • Arduino Mega 2560 (2x)
  • Ethernet shield W5100(2x)
  • 16-kanálové relé (2x)

  • Screenshoty



    Zdrojový kód pre Arduino Mega2560 s Ethernet shieldom W5100 - komunikuje priamo s ukážkovým web rozhraním

    #include <avr\wdt.h> //kniznica watchdogu
    #include <SPI.h>                     //kniznica SPI
    #include <Ethernet.h>                //kniznica k ethernet shieldu
    const int rele1 = 22; //rele 1 na pine D22
    const int rele2 = 23; //rele 2 na pine D23
    const int rele3 = 24; //rele 3 na pine D24
    const int rele4 = 25; //rele 4 na pine D25
    const int rele5 = 26; //rele 5 na pine D26
    const int rele6 = 27; //rele 6 na pine D27
    const int rele7 = 28; //rele 7 na pine D28
    const int rele8 = 29; //rele 8 na pine D29 
    const int rele9 = 30; //rele 9 na pine D30
    const int rele10 = 31; //rele 10 na pine D31
    const int rele11 = 32; //rele 11 na pine D32
    const int rele12 = 33; //rele 12 na pine D33
    const int rele13 = 34; //rele 13 na pine D34
    const int rele14 = 35; //rele 15 na pine D35
    const int rele15 = 36; //rele 15 na pine D36
    const int rele16 = 37; //rele 16 na pine D37
    byte mac[] = { 0x20, 0x1A, 0x06, 0x75, 0x8C, 0xAA };  
    char server[] = "www.arduino.php5.sk";  
    IPAddress dnServer(192, 168, 1, 1);
    IPAddress gateway(192, 168, 1, 1);
    IPAddress subnet(255, 255, 255, 0);
    IPAddress ip(192, 168, 1, 150);                    
    EthernetClient client;
    String readString;
    int x=0; //row counter
    char lf=10;
    void setup() {
      pinMode(rele1, OUTPUT);
      pinMode(rele2, OUTPUT);
      pinMode(rele3, OUTPUT);
      pinMode(rele4, OUTPUT);
      pinMode(rele5, OUTPUT);
      pinMode(rele6, OUTPUT);
      pinMode(rele7, OUTPUT);
      pinMode(rele8, OUTPUT);
      pinMode(rele9, OUTPUT);
      pinMode(rele10, OUTPUT);
      pinMode(rele11, OUTPUT);
      pinMode(rele12, OUTPUT);
      pinMode(rele13, OUTPUT);
      pinMode(rele14, OUTPUT);
      pinMode(rele15, OUTPUT);
      pinMode(rele16, OUTPUT);
      
      Serial.begin(9600);
      if (Ethernet.begin(mac) == 0) {                  //V PRIPADE ZLYHANIA NASTAVENIA DHCP
        Serial.println("Chyba konfiguracie, manualne nastavenie");
        Ethernet.begin(mac, ip, dnServer, gateway, subnet);
        delay(500);
      }
      wdt_enable(WDTO_8S); //8 sekundovy watchdog
    }
    void vystup_rele1(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele1.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele1, LOW);
        Serial.println("Zapinam rele1");
      }else if(readString=="VYP"){
        digitalWrite(rele1, HIGH);
        Serial.println("Vypinam rele1");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	void vystup_rele2(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele2.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele2, LOW);
        Serial.println("Zapinam rele2");
      }else if(readString=="VYP"){
        digitalWrite(rele2, HIGH);
        Serial.println("Vypinam rele2");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	void vystup_rele3(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele3.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele3, LOW);
        Serial.println("Zapinam rele3");
      }else if(readString=="VYP"){
        digitalWrite(rele3, HIGH);
        Serial.println("Vypinam rele3");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	void vystup_rele4(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele4.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele4, LOW);
        Serial.println("Zapinam rele4");
      }else if(readString=="VYP"){
        digitalWrite(rele4, HIGH);
        Serial.println("Vypinam rele4");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	void vystup_rele5(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele5.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele5, LOW);
        Serial.println("Zapinam rele5");
      }else if(readString=="VYP"){
        digitalWrite(rele5, HIGH);
        Serial.println("Vypinam rele5");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    	void vystup_rele6(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele6.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele6, LOW);
        Serial.println("Zapinam rele6");
      }else if(readString=="VYP"){
        digitalWrite(rele6, HIGH);
        Serial.println("Vypinam rele6");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    	void vystup_rele7(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele7.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele7, LOW);
        Serial.println("Zapinam rele7");
      }else if(readString=="VYP"){
        digitalWrite(rele7, HIGH);
        Serial.println("Vypinam rele7");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    	void vystup_rele8(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele8.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele8, LOW);
        Serial.println("Zapinam rele8");
      }else if(readString=="VYP"){
        digitalWrite(rele8, HIGH);
        Serial.println("Vypinam rele8");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    	void vystup_rele9(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele9.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele9, LOW);
        Serial.println("Zapinam rele9");
      }else if(readString=="VYP"){
        digitalWrite(rele9, HIGH);
        Serial.println("Vypinam rele9");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    	
    	void vystup_rele10(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele10.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele10, LOW);
        Serial.println("Zapinam rele10");
      }else if(readString=="VYP"){
        digitalWrite(rele10, HIGH);
        Serial.println("Vypinam rele10");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    void vystup_rele11(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele11.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele11, LOW);
        Serial.println("Zapinam rele11");
      }else if(readString=="VYP"){
        digitalWrite(rele11, HIGH);
        Serial.println("Vypinam rele11");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	void vystup_rele12(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele12.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele12, LOW);
        Serial.println("Zapinam rele12");
      }else if(readString=="VYP"){
        digitalWrite(rele12, HIGH);
        Serial.println("Vypinam rele12");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    	
    	void vystup_rele13(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele13.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele13, LOW);
        Serial.println("Zapinam rele13");
      }else if(readString=="VYP"){
        digitalWrite(rele13, HIGH);
        Serial.println("Vypinam rele13");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    	
    	void vystup_rele14(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele14.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele14, LOW);
        Serial.println("Zapinam rele14");
      }else if(readString=="VYP"){
        digitalWrite(rele14, HIGH);
        Serial.println("Vypinam rele14");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    	void vystup_rele15(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele15.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele15, LOW);
        Serial.println("Zapinam rele15");
      }else if(readString=="VYP"){
        digitalWrite(rele15, HIGH);
        Serial.println("Vypinam rele15");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    	
    	
    	
    	
    	void vystup_rele16(){
        if (client.connect(server, 80)){
            client.println("GET /rele2/arduino1/rele16.txt HTTP/1.1");
            client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
            client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
            client.println();  
            Serial.println("Pripojenie k vystupu rele 1 uspesne");
        }else{
            Serial.println("Neuspesne pripojenie pre ziskanie vystupu rele 1");
        }
         while(client.connected() && !client.available())
            while (client.connected() || client.available()) { //pramenna
              char c = client.read(); //dostan bity z buffera
              if (c==lf) x=(x+1); //pocitaj
                else if (x==12) readString += c; //nasa premenna
          }
    if(readString=="ZAP"){
        digitalWrite(rele16, LOW);
        Serial.println("Zapinam rele16");
      }else if(readString=="VYP"){
        digitalWrite(rele16, HIGH);
        Serial.println("Vypinam rele16");  
        }    
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
        }
    	
    void aktualizuj_vystupy(){
      if (client.connect(server, 80)) {               // AK SA NAPOJI NA SERVER NA PORTE 80 (HTTP)
          client.print("GET /rele2/over-rele.php");        
          client.println(" HTTP/1.1");                 // UKONCENIE REQUESTU ZALOMENIM RIADKA A DOPLNENIM HLAVICKY HTTP S VERZIOU
          client.println("Host: www.arduino.php5.sk"); // ADRESA HOSTA, NA KTOREHO BOL MIERENY REQUEST (NIE PHP SUBOR)
          client.println("Connection: close");         //UKONCENIE PRIPOJENIA ZA HTTP HLAVICKOU
          client.println();                            //ZALOMENIE RIADKA KLIENTSKEHO ZAPISU
          client.stop();                                   // UKONCENIE PRIPOJENIA ETHERNET SHIELDU
          Serial.println("Vystupy aktualizovane");    
      }else{
        Serial.println("Neuspesne pripojenie pre aktualizaciu vystupov");
        }
    }
    void loop() {
    wdt_reset();
       if (Ethernet.begin(mac) == 0) {
        Serial.println("Chyba konfiguracie, manualne nastavenie");
        Ethernet.begin(mac, ip, dnServer, gateway, subnet);
        wdt_reset();
        delay(500);
      }
      wdt_reset();
      aktualizuj_vystupy(); 
      wdt_reset();
      vystup_rele1();
      wdt_reset();
      vystup_rele2();
      wdt_reset();
      vystup_rele3();
      wdt_reset();
      vystup_rele4();
      wdt_reset();
      vystup_rele5();
      wdt_reset();
      vystup_rele6();
      wdt_reset();
      vystup_rele7();
      wdt_reset();
      vystup_rele8();
      wdt_reset();
      vystup_rele9();
      wdt_reset();
      vystup_rele10();
      wdt_reset();
      vystup_rele11();
      wdt_reset();
      vystup_rele12();
      wdt_reset();
      vystup_rele13();
      wdt_reset();
      vystup_rele14();
      wdt_reset();
      vystup_rele15();
      wdt_reset();
      vystup_rele16();   
      delay(4000);  
     }
     
    			

    Arduino parser pre druhých 8 relé (s loginom: admin, pass: admin)

    #include <SPI.h>
    #include <Ethernet.h>
    const int vystup1 = 0;
    const int vystup2 = 1;
    const int vystup3 = 2;
    const int vystup4 = 3;
    //D4 vynechany - pre SD kartu
    const int vystup5 = 5;
    const int vystup6 = 6;
    const int vystup7 = 7;
    const int vystup8 = 8;
    
    byte mac[] = { 0xAA, 0xBB, 0xCC, 0x81, 0x7B, 0x4C }; //fyzicka adresa MAC
    char serverName[] = "www.arduino.php5.sk"; // webserver
    IPAddress ip(192, 168, 1, 253);
    EthernetClient client;
    String readString;
    int x=0; //pocitadlo riadkov
    char lf=10; //line feed character
    void setup(){
    pinMode(vystup1, OUTPUT);
    pinMode(vystup2, OUTPUT);
    pinMode(vystup3, OUTPUT);
    pinMode(vystup4, OUTPUT);
    pinMode(vystup5, OUTPUT);
    pinMode(vystup6, OUTPUT);
    pinMode(vystup7, OUTPUT);
    pinMode(vystup8, OUTPUT);
     if (Ethernet.begin(mac) == 0) {
        Serial.println("DHCP nepridelilo adresu, skusam so statickou...");
        Ethernet.begin(mac, ip); //nastav k mac adrese i IP adresu staticku
      }
      Serial.begin(9600); 
    }
    void stav_vystup1(){
      if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
        Serial.println("connected");
        client.println("GET /rele/rele10.txt HTTP/1.1"); //download text
        client.println("Host: www.arduino.php5.sk");
        client.println("Connection: close");  // ukonc HTTP/1.1 spojenie
        client.println(); //koneic requestu
      } 
      else {
        Serial.println("Pripojenie neuspesne"); //chyba ak nie som pripojeny
        Serial.println();
      }
    
      while(client.connected() && !client.available()) delay(1); //cakaj na data
      while (client.connected() || client.available()) { //pramenna
        char c = client.read(); //dostan bity z buffera
        Serial.print(c); //cela http hlavicka
        if (c==lf) x=(x+1); //pocitaj 
        else if (x==12) readString += c; //nasa premenna
    
       } 
    if(readString=="ZAP"){
      digitalWrite(vystup1, HIGH); 
      }else if(readString=="VYP"){
      digitalWrite(vystup1, LOW);  
        }
        else{
     Serial.println("Nepodporovany stav! - chyba");
     }  
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
      }
      void stav_vystup2(){
      if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
        Serial.println("connected");
        client.println("GET /rele/rele11.txt HTTP/1.1"); //download text
        client.println("Host: www.arduino.php5.sk");
        client.println("Connection: close");  // ukonc HTTP/1.1 spojenie
        client.println(); //koneic requestu
      } 
      else {
        Serial.println("Pripojenie neuspesne"); //chyba ak nie som pripojeny
        Serial.println();
      }
    
      while(client.connected() && !client.available()) delay(1); //cakaj na data
      while (client.connected() || client.available()) { //pramenna
        char c = client.read(); //dostan bity z buffera
        Serial.print(c); //cela http hlavicka
        if (c==lf) x=(x+1); //pocitaj 
        else if (x==12) readString += c; //nasa premenna
    
       } 
    if(readString=="ZAP"){
      digitalWrite(vystup2, HIGH); 
      }else if(readString=="VYP"){
      digitalWrite(vystup2, LOW);  
        }
        else{
     Serial.println("Nepodporovany stav! - chyba");
     }  
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
      }
        void stav_vystup3(){
      if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
        Serial.println("connected");
        client.println("GET /rele/rele12.txt HTTP/1.1"); //download text
        client.println("Host: www.arduino.php5.sk");
        client.println("Connection: close");  // ukonc HTTP/1.1 spojenie
        client.println(); //koneic requestu
      } 
      else {
        Serial.println("Pripojenie neuspesne"); //chyba ak nie som pripojeny
        Serial.println();
      }
    
      while(client.connected() && !client.available()) delay(1); //cakaj na data
      while (client.connected() || client.available()) { //pramenna
        char c = client.read(); //dostan bity z buffera
        Serial.print(c); //cela http hlavicka
        if (c==lf) x=(x+1); //pocitaj 
        else if (x==12) readString += c; //nasa premenna
    
       } 
    if(readString=="ZAP"){
      digitalWrite(vystup3, HIGH); 
      }else if(readString=="VYP"){
      digitalWrite(vystup3, LOW);  
        }
        else{
     Serial.println("Nepodporovany stav! - chyba");
     }  
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
      }
     void stav_vystup4(){
      if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
        Serial.println("connected");
        client.println("GET /rele/rele13.txt HTTP/1.1"); //download text
        client.println("Host: www.arduino.php5.sk");
        client.println("Connection: close");  // ukonc HTTP/1.1 spojenie
        client.println(); //koneic requestu
      } 
      else {
        Serial.println("Pripojenie neuspesne"); //chyba ak nie som pripojeny
        Serial.println();
      }
    
      while(client.connected() && !client.available()) delay(1); //cakaj na data
      while (client.connected() || client.available()) { //pramenna
        char c = client.read(); //dostan bity z buffera
        Serial.print(c); //cela http hlavicka
        if (c==lf) x=(x+1); //pocitaj 
        else if (x==12) readString += c; //nasa premenna
    
       } 
    if(readString=="ZAP"){
      digitalWrite(vystup4, HIGH); 
      }else if(readString=="VYP"){
      digitalWrite(vystup4, LOW);  
        }
        else{
     Serial.println("Nepodporovany stav! - chyba");
     }  
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
      }
        void stav_vystup5(){
      if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
        Serial.println("connected");
        client.println("GET /rele/rele14.txt HTTP/1.1"); //download text
        client.println("Host: www.arduino.php5.sk");
        client.println("Connection: close");  // ukonc HTTP/1.1 spojenie
        client.println(); //koneic requestu
      } 
      else {
        Serial.println("Pripojenie neuspesne"); //chyba ak nie som pripojeny
        Serial.println();
      }
    
      while(client.connected() && !client.available()) delay(1); //cakaj na data
      while (client.connected() || client.available()) { //pramenna
        char c = client.read(); //dostan bity z buffera
        Serial.print(c); //cela http hlavicka
        if (c==lf) x=(x+1); //pocitaj 
        else if (x==12) readString += c; //nasa premenna
    
       } 
    if(readString=="ZAP"){
      digitalWrite(vystup5, HIGH); 
      }else if(readString=="VYP"){
      digitalWrite(vystup5, LOW);  
        }
        else{
     Serial.println("Nepodporovany stav! - chyba");
     }  
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
      }
    void stav_vystup6(){
      if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
        Serial.println("connected");
        client.println("GET /rele/rele15.txt HTTP/1.1"); //download text
        client.println("Host: www.arduino.php5.sk");
        client.println("Connection: close");  // ukonc HTTP/1.1 spojenie
        client.println(); //koneic requestu
      } 
      else {
        Serial.println("Pripojenie neuspesne"); //chyba ak nie som pripojeny
        Serial.println();
      }
    
      while(client.connected() && !client.available()) delay(1); //cakaj na data
      while (client.connected() || client.available()) { //pramenna
        char c = client.read(); //dostan bity z buffera
        Serial.print(c); //cela http hlavicka
        if (c==lf) x=(x+1); //pocitaj 
        else if (x==12) readString += c; //nasa premenna
    
       } 
    if(readString=="ZAP"){
      digitalWrite(vystup6, HIGH); 
      }else if(readString=="VYP"){
      digitalWrite(vystup6, LOW);  
        }
        else{
     Serial.println("Nepodporovany stav! - chyba");
     }  
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
      }
    void stav_vystup7(){
      if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
        Serial.println("connected");
        client.println("GET /rele/rele16.txt HTTP/1.1"); //download text
        client.println("Host: www.arduino.php5.sk");
        client.println("Connection: close");  // ukonc HTTP/1.1 spojenie
        client.println(); //koneic requestu
      } 
      else {
        Serial.println("Pripojenie neuspesne"); //chyba ak nie som pripojeny
        Serial.println();
      }
    
      while(client.connected() && !client.available()) delay(1); //cakaj na data
      while (client.connected() || client.available()) { //pramenna
        char c = client.read(); //dostan bity z buffera
        Serial.print(c); //cela http hlavicka
        if (c==lf) x=(x+1); //pocitaj 
        else if (x==12) readString += c; //nasa premenna
    
       } 
    if(readString=="ZAP"){
      digitalWrite(vystup7, HIGH); 
      }else if(readString=="VYP"){
      digitalWrite(vystup7, LOW);  
        }
        else{
     Serial.println("Nepodporovany stav! - chyba");
     }  
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
      }
     void stav_vystup8(){
      if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
        Serial.println("connected");
        client.println("GET /rele/rele17.txt HTTP/1.1"); //download text
        client.println("Host: www.arduino.php5.sk");
        client.println("Connection: close");  // ukonc HTTP/1.1 spojenie
        client.println(); //koneic requestu
      } 
      else {
        Serial.println("Pripojenie neuspesne"); //chyba ak nie som pripojeny
        Serial.println();
      }
    
      while(client.connected() && !client.available()) delay(1); //cakaj na data
      while (client.connected() || client.available()) { //pramenna
        char c = client.read(); //dostan bity z buffera
        Serial.print(c); //cela http hlavicka
        if (c==lf) x=(x+1); //pocitaj 
        else if (x==12) readString += c; //nasa premenna
    
       } 
    if(readString=="ZAP"){
      digitalWrite(vystup8, HIGH); 
      }else if(readString=="VYP"){
      digitalWrite(vystup8, LOW);  
        }
        else{
     Serial.println("Nepodporovany stav! - chyba");
     }  
      readString = ("");
      x=0;
      client.stop(); //ukonc spojenie
      }
    
    void loop(){
    stav_vystup1();
    stav_vystup2();
    stav_vystup3();
    stav_vystup4();
    stav_vystup5();
    stav_vystup6();
    stav_vystup7();
    stav_vystup8();
    delay(5000); //opakuj slucku loop o 5 sekund
    }