Arduino Based Water Level Indicator
Ultrasonic sensors are bang-up tools to mensurate distance without actual contact
in addition to used at several places like water level measurement, distance measuring etc. This is an efficient way to mensurate modest distances precisely. In this projection nosotros direct maintain used an Ultrasonic Sensor to make upward one's heed the distance of an obstruction from the sensor. Basic mind of ultrasonic distance measuring is based on ECHO. When audio waves are transmitted inwards environs in addition to thus waves are provide dorsum to rootage every bit ECHO afterwards hitting on the obstacle. So nosotros exclusively need to calculate the travelling fourth dimension of both sounds agency outgoing fourth dimension in addition to returning fourth dimension to rootage afterwards hitting on the obstacle. As speed of the audio is known to us, after some calculation nosotros tin dismiss calculate the distance.
in addition to used at several places like water level measurement, distance measuring etc. This is an efficient way to mensurate modest distances precisely. In this projection nosotros direct maintain used an Ultrasonic Sensor to make upward one's heed the distance of an obstruction from the sensor. Basic mind of ultrasonic distance measuring is based on ECHO. When audio waves are transmitted inwards environs in addition to thus waves are provide dorsum to rootage every bit ECHO afterwards hitting on the obstacle. So nosotros exclusively need to calculate the travelling fourth dimension of both sounds agency outgoing fourth dimension in addition to returning fourth dimension to rootage afterwards hitting on the obstacle. As speed of the audio is known to us, after some calculation nosotros tin dismiss calculate the distance.
Components Used-
Arduino Uno
Ultrasonic sensor Module
16x2 LCD
Scale
Bread board
nine volt battery
Connecting wire
Ultrasonic sensor Module
16x2 LCD
Scale
Bread board
nine volt battery
Connecting wire
Ultrasonic Sensor Module-
Ultrasonic sensor HC-SR04 is used here to mensurate distance inwards gain of 2cm-400cm
amongst accuracy of 3mm. The sensor module consists of ultrasonic transmitter, receiver in addition to
the command circuit. The working principle of ultrasonic sensor is every bit follows:
High marking shout out for is sent for 10us using Trigger.
amongst accuracy of 3mm. The sensor module consists of ultrasonic transmitter, receiver in addition to
the command circuit. The working principle of ultrasonic sensor is every bit follows:
High marking shout out for is sent for 10us using Trigger.
The module sends viii twoscore KHz signals automatically, in addition to and thus detects whether pulse is received or not.
If the shout out for is received, in addition to thus it is through high level. The fourth dimension of high duration is the fourth dimension gap betwixt sending in addition to receiving the signal.
Distance= (Time x Speed of Sound inwards Air (340 m/s))/2
Timing Diagram-
The module industrial plant on the natural phenomenon of ECHO of sound. Influenza A virus subtype H5N1 pulse is sent for
close 10us to trigger the module. After which the module automatically sends 8 cycles of
twoscore KHz ultrasound shout out for in addition to checks its echo. The shout out for afterwards hitting amongst an obstacle
returns dorsum in addition to is captured past times the receiver. Thus the distance of the obstruction from the
sensor is only calculated past times the formula given as
Distance= (time x speed)/2.
close 10us to trigger the module. After which the module automatically sends 8 cycles of
twoscore KHz ultrasound shout out for in addition to checks its echo. The shout out for afterwards hitting amongst an obstacle
returns dorsum in addition to is captured past times the receiver. Thus the distance of the obstruction from the
sensor is only calculated past times the formula given as
Distance= (time x speed)/2.
Here nosotros direct maintain divided the production of speed in addition to fourth dimension past times 2 because the fourth dimension is the full
fourth dimension it took to attain the obstruction in addition to provide back. Thus the fourth dimension to attain obstruction is just
one-half the full fourth dimension taken.
fourth dimension it took to attain the obstruction in addition to provide back. Thus the fourth dimension to attain obstruction is just
one-half the full fourth dimension taken.
Ultrasonic Sensor Arduino Circuit Diagram -
Explanation -
The circuit diagram for arduino and ultrasonic sensor is shown inwards a higher house to mensurate the distance. In circuit connections Ultrasonic sensor module’s “trigger” in addition to “echo” pins are straight connected to pivot 18(A4) in addition to 19(A5) of arduino. Influenza A virus subtype H5N1 16x2 LCD is connected amongst arduino inwards 4-bit mode. Control pivot RS, RW in addition to En are straight connected to arduino pivot 2, GND in addition to 3. And information pivot D4-D7 is connected to 4, 5, vi in addition to seven of arduino.
First of all nosotros need to trigger the ultrasonic sensor module to transmit shout out for past times using arduino in addition to and thus await for have ECHO. Arduino reads the fourth dimension betwixt triggering in addition to Received ECHO. We know that speed of audio is just about 340m/s. thus nosotros tin dismiss calculate distance past times using given formula:
Distance= (travel time/2) * speed of sound
Where speed of audio just about 340m per second.
Influenza A virus subtype H5N1 16x2 LCD is used for displaying distance.
First of all nosotros need to trigger the ultrasonic sensor module to transmit shout out for past times using arduino in addition to and thus await for have ECHO. Arduino reads the fourth dimension betwixt triggering in addition to Received ECHO. We know that speed of audio is just about 340m/s. thus nosotros tin dismiss calculate distance past times using given formula:
Distance= (travel time/2) * speed of sound
Where speed of audio just about 340m per second.
Influenza A virus subtype H5N1 16x2 LCD is used for displaying distance.
Arduino Ultrasonic Sensor Code for Distance Measurement
In code nosotros read fourth dimension past times using pulseIn(pin). And in addition to thus perform calculations in addition to displayed
lawsuit on 16x2 LCD past times using appropriate functions.
lawsuit on 16x2 LCD past times using appropriate functions.
Digitalwrite(trigger,HIGH);
delayMicroseconds(10);
Digitalwrite(trigger,LOW);
delayMicroseconds(2);
time=pulseIn(echo,HIGH);
distance=time*340/20000;
Lcd.clear();
Lcd.print(“Distance”);
Lcd.print(distance);
Lcd.print(“cm”);
delayMicroseconds(10);
Digitalwrite(trigger,LOW);
delayMicroseconds(2);
time=pulseIn(echo,HIGH);
distance=time*340/20000;
Lcd.clear();
Lcd.print(“Distance”);
Lcd.print(distance);
Lcd.print(“cm”);
PROGRAME CODE-
#include <LiquidCrystal.h>
#define trigger 18
#define echo 19
LiquidCrystal lcd(2,3,4,5,6,7);
float time=0,distance=0;
void setup()
{
lcd.begin(16,2);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
lcd.print(" Ultra sonic");
lcd.setCursor(0,1);
lcd.print("Distance Meter");
delay(2000);
lcd.clear();
lcd.print(" Circuit Digest");
delay(2000);
}
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("Distance:");
lcd.print(distance);
lcd.print("cm");
lcd.setCursor(0,1);
lcd.print("Distance:");
lcd.print(distance/100);
lcd.print("m");
delay(1000);
}
#define trigger 18
#define echo 19
LiquidCrystal lcd(2,3,4,5,6,7);
float time=0,distance=0;
void setup()
{
lcd.begin(16,2);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
lcd.print(" Ultra sonic");
lcd.setCursor(0,1);
lcd.print("Distance Meter");
delay(2000);
lcd.clear();
lcd.print(" Circuit Digest");
delay(2000);
}
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("Distance:");
lcd.print(distance);
lcd.print("cm");
lcd.setCursor(0,1);
lcd.print("Distance:");
lcd.print(distance/100);
lcd.print("m");
delay(1000);
}