    
 }
 String tankState(){
+   digitalWrite(OBSTACLE_POWER_PIN, LOW);
+   delay(500);
   if(digitalRead(OBSTACLE_PIN) == LOW){
     return "FULL";
   }else{
     return "EMPTY";
   }
-}
+   digitalWrite(OBSTACLE_POWER_PIN, HIGH);
+}
+
 //------------- end main functions----------------------------------------  
 void setup() {
   pinMode(TRIGGER_PIN, INPUT_PULLUP);
+  pinMode(MOTOR_PIN, OUTPUT);
   pinMode(LED_PIN_RED, OUTPUT);
   pinMode(LED_PIN_BLUE, OUTPUT);
   pinMode(LED_PIN_GREEN, OUTPUT);
+  pinMode(OBSTACLE_POWER_PIN, OUTPUT);
   pinMode(OBSTACLE_PIN, INPUT);
   digitalWrite(LED_PIN_RED, HIGH); //turn off led  
   digitalWrite(LED_PIN_BLUE, HIGH); //turn off led 
   digitalWrite(LED_PIN_GREEN, HIGH); //turn off led 
-
+  digitalWrite(OBSTACLE_POWER_PIN, HIGH); //power off obstacle sensor
+  digitalWrite(MOTOR_PIN, HIGH); //power off motor pin 360 servo
   
   int start_time = millis(); // remember starttime
   servo.attach(MOTOR_PIN);
-  servo.write(0); // initial position
+  servo.write(0); // initial position for normal servo!!!!
   
   Serial.begin(115200);
   Serial.print("\n Starting at :");

//-------------main functions----------------------------------------
  void doFeed(String sval) {
        int ival = sval.toInt();
        for(int a=0; a<ival; a++){
              for(int i=0; i<180; i++){
                 goblink(i);
                 servo.write(i);
                 delay(10);
                 }
                 for(int i=180; i>0; i--){
                 goblink(i);
                 servo.write(i);
                 delay(5);
                 }
                 delay(200); // for fill the bank))
        }
  }
  void goblink(int i){ 
    if ((i%10) == 0){ 

String DID = ""; //device ID
String DHEX = ""; //Device md5 hex id based


bool initialConfig = false; // Indicates whether ESP has WiFi credentials saved from previous session
ADC_MODE(ADC_VCC); //for voltage measuring
