   Serial.println("Going sleep");
 
   scale.power_down();
-
-  //
-  MeasuredIsSent = LOW;
-  Attempt = 0;
-
-  //
+ 
   //digitalWrite(espnemoIsOnPadPin, LOW);
   digitalWrite(ledPowerPin, LOW);
 

      Serial.print(Measured);
      Serial.print("   ==> ");

      if (( Measured > 500 ) && ( Measured > (average - 500)))
      {
            total = total - readings[indexof];
            readings[indexof] = Measured;

              Serial.print("============> nemo is not on pad now");
            }
            Attempt++;

            if ( average > 3000 )
            {
                  VccValue = vcc.Read_Volts() * 1000 ;
                  Serial.println("");
                  Serial.print("==========> average ");
                  Serial.print(average) ;
                  Serial.print("   =====> VCC ");
                  Serial.println(VccValue);
                  espReset();
                  Attempt = 0;
            }

      } else {
            Attempt == 0 ;
      }

      if ( Attempt == 20 )
      {
            Serial.println("======> Measurement has problem");
            sleepNow();
      }
      delay(500);

  } else {

      Attempt++;
      if ( Attempt == 20 ) 
      {
          Serial.println("======> I2C has problem");
          sleepNow();
      }

      if (( mqttMsgSent == HIGH ) 
      {
        Serial.println("======> mqtt msg has sent");
        digitalWrite(ledPowerPin, LOW);
        delay(300);
        digitalWrite(ledPowerPin, HIGH);    
        sleepNow();
      }

      delay(1000);
  }

}
