 
 // These constants won't change.  They're used to give names
 // to the pins used:
-const int analogOutPin = 3; // Analog output pin that the LED is attached to
+const int valvePin = 3; // Analog output pin that the LED is attached to
 const int analogInPin = A0;
 const int pumpPin = 4;
 const int ledPin = 13;

    }
  }
  
  if (!levelIsDown) //It is time to activate the pump
  {
    
    if (levelWasDown) //normal case, the level was previously low
    { 
      //Active the pump for a few seconds (if not freezed)
      if (!freeze)
      {
        digitalWrite(pumpPin, HIGH);
        Serial.println("Pump");
        delay(1000);
        digitalWrite(pumpPin, LOW);
        delay(2000);
        dropCounter = 0; //Reset the drop counter
      }

}

void loop() {    
  Serial.print("dropCounter: ");
  Serial.println(dropCounter);
  managePump();
  makeADrop();
}

void managePump() {
  sensorValue = analogRead(analogInPin);
  Serial.print("Sensor: ");
  Serial.println(sensorValue);
  
  waterLevelIsUp = sensorValue>sensorMax/2;
  
  if (dropCounter>150) //This should normaly never happen, the sensor should start the pump before
  {
    if (waterLevelIsUp)
    { //Too many drops without sensor activation: sensor is not working, stop everything!
      freeze = true;
    }
