The goal of the fuzzy logic based algorithm  is to determine the volume of water and the duration of irrigation (opening of electric valve) required in each case. Knowledge rules are established for the humidity sensor in three situations: when the sensor is wet, when the sensor is partly wet and finally when the sensor is dry. Table 2 shows the irrigation time for each case.