 void pirStateChange() {
   static unsigned long last_interrupt_time = 0;
   unsigned long interrupt_time = millis();
-  if (interrupt_time - last_interrupt_time > 1000)
+  if (interrupt_time - last_interrupt_time > 500)
   {
     pir_alarm_state = true;
   }

bool buzzPin_state = LOW;
unsigned long start_buzz_time = 0;
bool soft_alarm_state = false;
<<<<<<< HEAD
bool pir_alarm_state = false;
=======
>>>>>>> 2e87ac67c97485ac5c1b4994cb3e968dcd442e6a

unsigned long currentTime = 0;
unsigned long startTime   = 0;

    payload.humi  = DHT11.humidity;
    payload.light = map(analogRead(optoPin), 0, 1023, 100, 0);
    payload.door  = soft_alarm_state;
    payload.hkey  = random(10000000, 99999999);

    // starts counting
