In this article, we will study liquid level measurement in the overhead tank using an Arduino microcontroller.
To avoid overflow of the tank the level must be measured and corrective action must be taken. Most people use an overhead tank called syntax to store water and the pump arrangement is used to lift the water from the source and use them, but when the tank gets full the water gets exited through an overflow pipe leads to loss of water.
To overcome the losses due to overflow, we have designed a system to measure the level of the tank using an Arduino microcontroller.
What are the components required to measure the level of the liquid?
The required components are
The power supply required for this system is 12 V DC.
Pin Details of Display unit RG1602A.
How does the measurement system work?
The system working is as follows
Time = Distance /Speed
Distance = (Time * Speed)/2.
= (Time * 0.0342)/2.
What programming language is required to compose the program?
Usually, this program is written in the Arduino C program which is similar to a C program.
LIST OF PROGRAMS
Program 1 “Testing of Ultrasonic Trans-Receiver HC-SR04”
#define echoPin 7 // Echo Pin
#define trigPin 8 // Trigger Pin
#define LEDPin 13 // Onboard LED
int maximumRange = 200; // Maximum range needed
int minimumRange = 0; // Minimum range needed
long int duration, distance; // Duration used to calculate distance
void setup()
{
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(LEDPin, OUTPUT); // Use LED indicator (if required)
}
void loop()
{
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(2);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = duration / 58.2;
if (distance >= maximumRange)
{
Serial.println(“out of area”);
digitalWrite(LEDPin, HIGH);
}
else if (distance <= minimumRange)
{
Serial.println(“within limit”);
digitalWrite(LEDPin, LOW);
} }
Program to measure and indicate the status level
#include <LiquidCrystal.h>
#define trigger 7
#define echo 8
int Range1=0;
int Range2 = 4;
int Range3 = 8;
int Range4 = 12;
int Range5 = 16;
int Range6= 20;
LiquidCrystal.h lcd(12,11,5,4,3,2);
float time=0,level=0,distance=0;
void setup()
{
lcd.begin(16,2);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
lcd.setCursor(0,1);
lcd.clear();
}
void loop()
{
lcd.clear();
digitalWrite(trigger,LOW);
delayMicroseconds(2);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
delayMicroseconds(2);
time=pulseIn(echo,HIGH);
distance=time*340/20000;
lcd.clear();
lcd.print(“LEVEL:”);
lcd.print(distance);
lcd.print(“cm”);
lcd.setCursor(0,1);
if (distance <= Range1)
{
lcd.print(“OVERFLOW“);
}
else if (distance <= Range2)
{
lcd.print(“LEVEL VERY HIGH”);
}
else if (distance >= Range3)
{
lcd.print(“LEVEL HIGH “);
}
else if (distance >= Range4)
{
lcd.print(“LEVEL NORMAL”);
}
else if (distance >= Range5)
{
lcd.print(“LEVEL LOW”);
}
else if (distance >= Range6)
{
lcd.print(“LEVEL VERY LOW PUMP ON “);
}
delay(1000);
}
Learn the example of flip-flop PLC program for lamps application using the ladder logic to…
In this article, you will learn the STAR DELTA programming using PLC controller to start…
Lube oil consoles of rotary equipment packages in industrial process plants are usually equipped with…
Rotating equipment packages such as pumps, compressors, turbines need the lube oil consoles for their…
This article explains how to blink lights in ladder logic with a detailed explanation video…
In this article, a simple example will teach you the conversion from Boolean algebra to…