user55338: #include <SoftwareSerial.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
SoftwareSerial mySerial(0, 1);

int gas_sensor = A5;
int water_sensor = 8;
int buzzer = 9;
int fan = 13;
int sms_count = 0;

void setup() {
  pinMode(gas_sensor, INPUT);
  pinMode(water_sensor, INPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(fan, OUTPUT);
  mySerial.begin(9600);
  Serial.begin(9600);
  lcd.begin(16, 2);
  delay(500);
}

void loop() {
  if (digitalRead(water_sensor) == LOW && analogRead(gas_sensor)) {
    CheckWater_and_Gas();
  }
  else if (digitalRead(water_sensor) == LOW) {
    CheckWater();
  }
  else if (analogRead(gas_sensor)) {
    CheckGas();
  }
  else {
  }
}

void CheckWater_and_Gas() {
  int sensorValue = analogRead(gas_sensor);
  Serial.println(sensorValue);
  delay(1000);
  if ( digitalRead(water_sensor) == LOW && sensorValue > 150 ) {
    digitalWrite(buzzer, HIGH);
    digitalWrite(fan, HIGH);
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(" Water and ");
    lcd.setCursor(0, 1);
    lcd.print(" Gas Leaking ! ");
    SetAlertWater_and_Gas();
  }
  else {
    digitalWrite(buzzer, LOW);
    digitalWrite(fan, LOW);
    lcd.clear();
  }
}

void CheckWater() {
  if ( digitalRead(water_sensor) == LOW ) {
    digitalWrite(buzzer, HIGH);
    lcd.clear();
    lcd.setCursor(0, 1);
    lcd.print(" Water Leaking ! ");
    SetAlertWater();
  }
  else {
    digitalWrite(buzzer, LOW);
    lcd.clear();
  }
}

void CheckGas() {
  int sensorValue = analogRead(gas_sensor);
  Serial.println(sensorValue);
  delay(1000);
  if (sensorValue > 150) {
    digitalWrite(buzzer, HIGH);
    digitalWrite(fan, HIGH);
    lcd.clear();
    lcd.setCursor(0, 1);
    lcd.print("Gas Leaking !");
    SetAlertGas();
  }
  else {
    digitalWrite(buzzer, LOW);
    digitalWrite(fan, LOW);
    lcd.clear();
  }
}


user54511: You schould start searching the root cause for your error: code, display, sensor, … step by step.
Check if your display is working by 1.) reducing your loop() to 
void loop() {
    CheckWater();
}

and 2.) change 
void CheckWater() {
  if ( digitalRead(water_sensor) == LOW ) {
    digitalWrite(buzzer, HIGH);
    ...

to
void CheckWater() {
  if ( true ) {
    digitalWrite(buzzer, HIGH);
   ...

This allows you to check if your LCD is working properly. If not, start looking for the fault in wiring or maybe you are using a different LCD which has to be setup in a different mode as the sketch from online.
If this works, search for the rootcause in the sensor. Go back to the orignial code and put the input of the rain sensor to low. If your display shows: Water Leaking! something with your water sensor or it's Connection to your board seems to be wrong.  

55338: <pre><code>#include &lt;SoftwareSerial.h&gt;
#include &lt;LiquidCrystal.h&gt;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
SoftwareSerial mySerial(0, 1);

int gas_sensor = A5;
int water_sensor = 8;
int buzzer = 9;
int fan = 13;
int sms_count = 0;

void setup() {
  pinMode(gas_sensor, INPUT);
  pinMode(water_sensor, INPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(fan, OUTPUT);
  mySerial.begin(9600);
  Serial.begin(9600);
  lcd.begin(16, 2);
  delay(500);
}

void loop() {
  if (digitalRead(water_sensor) == LOW &amp;&amp; analogRead(gas_sensor)) {
    CheckWater_and_Gas();
  }
  else if (digitalRead(water_sensor) == LOW) {
    CheckWater();
  }
  else if (analogRead(gas_sensor)) {
    CheckGas();
  }
  else {
  }
}

void CheckWater_and_Gas() {
  int sensorValue = analogRead(gas_sensor);
  Serial.println(sensorValue);
  delay(1000);
  if ( digitalRead(water_sensor) == LOW &amp;&amp; sensorValue &gt; 150 ) {
    digitalWrite(buzzer, HIGH);
    digitalWrite(fan, HIGH);
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(" Water and ");
    lcd.setCursor(0, 1);
    lcd.print(" Gas Leaking ! ");
    SetAlertWater_and_Gas();
  }
  else {
    digitalWrite(buzzer, LOW);
    digitalWrite(fan, LOW);
    lcd.clear();
  }
}

void CheckWater() {
  if ( digitalRead(water_sensor) == LOW ) {
    digitalWrite(buzzer, HIGH);
    lcd.clear();
    lcd.setCursor(0, 1);
    lcd.print(" Water Leaking ! ");
    SetAlertWater();
  }
  else {
    digitalWrite(buzzer, LOW);
    lcd.clear();
  }
}

void CheckGas() {
  int sensorValue = analogRead(gas_sensor);
  Serial.println(sensorValue);
  delay(1000);
  if (sensorValue &gt; 150) {
    digitalWrite(buzzer, HIGH);
    digitalWrite(fan, HIGH);
    lcd.clear();
    lcd.setCursor(0, 1);
    lcd.print("Gas Leaking !");
    SetAlertGas();
  }
  else {
    digitalWrite(buzzer, LOW);
    digitalWrite(fan, LOW);
    lcd.clear();
  }
}
</code></pre>
 54511: <p>You schould start searching the root cause for your error: code, display, sensor, … step by step.</p>

<p>Check if your display is working by 1.) reducing your loop() to </p>

<pre><code>void loop() {
    CheckWater();
}
</code></pre>

<p>and 2.) change </p>

<pre><code>void CheckWater() {
  if ( digitalRead(water_sensor) == LOW ) {
    digitalWrite(buzzer, HIGH);
    ...
</code></pre>

<p>to</p>

<pre><code>void CheckWater() {
  if ( true ) {
    digitalWrite(buzzer, HIGH);
   ...
</code></pre>

<p>This allows you to check if your LCD is working properly. If not, start looking for the fault in wiring or maybe you are using a different LCD which has to be setup in a different mode as the sketch from online.</p>

<p>If this works, search for the rootcause in the sensor. Go back to the orignial code and put the input of the rain sensor to low. If your display shows: Water Leaking! something with your water sensor or it's Connection to your board seems to be wrong.  </p>
