 #define ESP8266_PASS  "certificat"
 #define RXpinSEND 12   // ESP-01 wifiSEND module TX
 #define TXpinSEND 13   // ESP-01 wifiSEND module RX 
-#define RELAYbutton 14 // digital switch 1
-#define ALARMbutton 15 // digital switch 2 
-#define RELAYpin 16    // digital relay 
+#define RELAYbutton 15 // digital switch 1
+#define ALARMbutton 14 // digital switch 2 
 #define DHTpin 21      // digital temp sensor  
 #define BUZZpin 22     // digital buzzer 
 
-#define REFRESHupload 30 //15*60 second to upload data to server / to be changed to 15 min
+#define REFRESHupload 30 //30*60 second to upload data to server / to be changed to 15 min
 
 LiquidCrystal lcd(51, 50, 6, 7, 8, 9); 
 ESP8266_Simple wifiSEND( RXpinSEND, TXpinSEND); 

  pinMode(PIRsensorPin,INPUT); 
  pinMode(ALARMbutton,INPUT); 
  pinMode(RELAYbutton,INPUT); 
  pinMode(RELAYpin, OUTPUT); 
  pinMode(BUZZpin, OUTPUT); 
  Serial.begin(9600); 
  wifiSEND.begin(9600); loadScreen(loadTime); loadTime++; 


  lcd.setCursor(0,0); lcd.print("Resetting...             ");
  for( loadTime = 2 ; loadTime < 10; ++loadTime)
    loadScreen(loadTime); 
  
  char bufferr[300]; 
  wifiSEND.sendCommand(F("AT+CWJAP?"), bufferr, sizeof(bufferr));
  delay(5000); 
  if(DEBUG){ 
    Serial.println(bufferr);
    Serial.println(ESP8266_SSID);     
  }

  if(bufferr!=ESP8266_SSID){ 
  char buffer11[300]; 
  wifiSEND.sendCommand(F("AT+RST"), buffer11, sizeof(buffer11)); 
  delay(5000); 
  wifiSEND.setupAsWifiStation(ESP8266_SSID, ESP8266_PASS, &Serial); 
  delay(5000); 
  } 
  
  lcd.setCursor(0,0); lcd.print("Connecting...             "); 
  for( loadTime = 10 ; loadTime < 16; ++loadTime)

      lcd.setCursor(0,1); 
      lcd.print("         ON!          "); 
      setColor(255,255,255); 
    }
    else{
      lcd.setCursor(0,0); 
