     return;
   }
 
-  if (( millis() - startMills ) < ( revMills / 3 )) {
+  /*
+    if (( millis() - startMills ) < ( revMills / 5 )) {
     return;
-  } else {
+    } else {
     revMills   = (millis() - startMills)  ;
     startMills = millis();
     irStatus   = !irStatus ;
-  }
+    revCounts++;
+    }
+  */
+
+  revMills   = (millis() - startMills)  ;
+  startMills = millis();
+  irStatus   = !irStatus ;
+  revCounts++;
+
 }
 
 String macToStr(const uint8_t* mac)

    wifi_connect();
  }

  VIrms = emon1.calcIrms(1480) * 220.0;
  ave.push(VIrms);
  average = ave.mean();

  if ( revMills > 600 ) {
    revValue = (float(( 3600  * 1000 ) / ( 600 * float(revMills) ) ) * 1000);

#define DOORPIN 5

//#define REPORT_INTERVAL 60000 // in msec
#define REPORT_INTERVAL 1000 // in msec

volatile unsigned long startMills ;
volatile unsigned long revMills ;
