SMS Water Pump Controller with Automatic Dry Run Shut Off.

The SMS water water pump controller with automatic shutdown of pump when no water flow through the pump is detected.

What is Dry Run in Motors:
Dry running means running the water pump without liquid flow. The consequence can be serviceable damage to unserviceable damage depending on how long the motor was running without pumping the water and the quality of the water pump.

Yes, the water pumps are not cheap and if you are an agriculturist who irrigate the field every day, then a small issue with your water pump can land you in economic loss.

Servicing the pump may take some time and money, so it is better to follow the famous slogan “prevention is better than cure”.

Motor dry run is a very common problem, when there is not enough water to flow through the pump, over heating of mechanical components as well as electrical components will occur.

At a point the mechanical components will start to melt and also may cause short circuit.

Such disaster may be prevented using the circuit, proposed in this project.

To detect the flow of water, we are utilizing YF-S201 water flow sensor. When no water flow is detected by the sensor, it cuts off the power supply to water pump and send an SMS acknowledgement to the recipient about the dry run shut off.

With this GSM based control you can turn on and off the pump and also the circuit acknowledges about the pump dry run issue.

The circuit consists of AC to DC converter using 9V transformer, bridge rectifier a smoothing capacitor of 1000 uF and a LM7809 9V regulator. Two DC jacks are provided for powering Arduino board and SIM 800 / SIM 900 GSM module.

SMS Water pump Controller Circuit:
Connection Details:

The connection between Arduino and GSM module as follows:
Arduino TX ———————- RX SIM
Arduino RX ——————— TX SIM
Arduino GND ——————- GND SIM

The main supply is provided by the LM 7809 regulator.
The LED indicator will glow if the relay is activated and turns off when the relay is deactivated.

The diode IN4007 will absorbed high voltage spike which occurs while switching the relay on and off.

The water flow sensor is connected to A0 pin of Arduino, 5V and GND provided from Arduino board.

Complete and tested code:

int motor = 8;
int LED = 9;
int temp = 0;
int i = 0;
int j = 0;
int k = 0;
int X = 0;
int Y = 0;
int mtr_on = 0;
float Time = 0;
float frequency = 0;
const int input = A0;
const int test = 6;
char str[15];
void setup()
{
Serial.begin(9600);
pinMode(motor, OUTPUT);
pinMode(LED, OUTPUT);
digitalWrite(motor, LOW);
digitalWrite(LED, LOW);
analogWrite(test, 100);
for (k = 0; k < 60; k++)
{
delay(1000);
}
Serial.println("AT+CNMI=2,2,0,0,0");
delay(1000);
Serial.println("AT+CMGF=1");
delay(500);
Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);
Serial.println("System is ready to receive commands.");// The SMS text you want to send
delay(100);
Serial.println((char)26); // ASCII code of CTRL+Z
delay(1000);
}
void loop()
{
if (temp == 1)
{
check();
temp = 0;
i = 0;
delay(1000);
}
if (mtr_on == 1)
{
X = pulseIn(input, HIGH);
Y = pulseIn(input, LOW);
Time = X + Y;
frequency = 1000000 / Time;
if (isinf(frequency))
{
digitalWrite(motor, LOW);
digitalWrite(LED, LOW);
delay(1000);
Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);
Serial.println("Motor Deactivated. Dry Run Shut Off!");// The SMS text you want to send
delay(100);
Serial.println((char)26); // ASCII code of CTRL+Z
mtr_on = 0;
delay(1000);
}
}
}
void serialEvent()
{
while (Serial.available())
{
if (Serial.find("/"))
{
delay(1000);
while (Serial.available())
{
char inChar = Serial.read();
str[i++] = inChar;
if (inChar == '/')
{
temp = 1;
return;
}
}
}
}
}
void check()
{
if (!(strncmp(str, "motor on", 8)))
{
digitalWrite(motor, HIGH);
digitalWrite(LED, HIGH);
delay(1000);
Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);
Serial.println("Motor Activated");// The SMS text you want to send
delay(100);
Serial.println((char)26); // ASCII code of CTRL+Z
for (j = 0; j < 20 ; j++)
{
delay(1000);
}
mtr_on = 1;
}
else if (!(strncmp(str, "motor off", 9)))
{
digitalWrite(motor, LOW);
digitalWrite(LED, LOW);
mtr_on = 0;
delay(1000);
Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);
Serial.println("Motor deactivated");// The SMS text you want to send
delay(100);
Serial.println((char)26); // ASCII code of CTRL+Z
delay(1000);
}
else if (!(strncmp(str, "test", 4)))
{
Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);
Serial.println("The System is Working Fine.");// The SMS text you want to send
delay(100);
Serial.println((char)26); // ASCII code of CTRL+Z
delay(1000);
}
} 

About the Author

Subramanian

Hello! My Dear Friends. I am Subramanian. I am writing posts on androiderode about Electronics testing and equipments.

View All Articles