Your cart is currently empty!
Interface Arduino with water level indicator using sonic sensor and LEDs in proteus
Interface Arduino with water level indicator using sonic sensor and LEDs in proteus
In this article we will learn how to Interface Arduino with water level indicator using sonic sensor and LEDs in proteus.
In the last post we will learn how to Interface Arduino FDC1004 Breakout Board circuit in proteus. You can visit our website,
I hope you appreciate my work, let’s discuss about today’s project.
Components:
- Arduino Uno
- Sonar sensor
- Volt meter
- Resistor variable
- Resistors (330)
- LEDs
- Jumper wires
Construction…
- Connect Trigger pin of Sonar sensor with pin 9 of Arduino Uno
- Connect Echo pin of Sonar sensor with pin 10 of Arduino Uno
- Connect +5V pin of Sonar sensor with +ve
- Connect GND pin of Sonar sensor with GND
- Connect test pin of Sonar sensor with signal pin of Resistor variable through +ve terminal of Voltmeter
- Connect –ve side of Volt meter with GND
- Connect collector pin of variable with +ve
- Connect Ammeter pin of variable with GND
- Connect A0 pin of Arduino with one side of 1st resistor
- Connect 2nd side of 1st resistor with +ve side of 1st LED
- Connect A1 pin of Arduino with one side of 2nd resistor
- Connect 2nd side of 2nd resistor with +ve side of 2nd Led
- Connect A2 pin of Arduino with one side of 3rd resistor
- Connect 2nd side of 3rd resistor with +ve side of 3rd LED
- Connect A3 pin of Arduino with one side of 4th resistor
- Connect 2nd side of 4th resistor with +ve side of 4th LED
- Connect A4 pin of Arduino with one side of 5th resistor
- Connect 2nd side of 5th resistor with +ve side of 5th LED
- Connect –ve sides of All LEDs with GND
hardware image…
Working…
A water level indicator using an ultrasonic sensor is a simple and effective way to measure the level of water in a tank or container. Ultrasonic sensors work by emitting high-frequency sound waves and measuring the time it takes for those waves to bounce back after hitting an object.
Applications…
- Agriculture
- Industrial Processes
- Environmental Monitoring
- Home and Residential Use
- Water Treatment Plants
Advantages…
- High Accuracy
- Wide Range
- Continuous Monitoring
- Low Maintenance
- Easy Installation
Program code images…
Program code…
[dt_code]
#define trigpin 9
#define echopin 10
int led1 = A0;
int led2 = A1;
int led3 = A2;
int led4 = A3;
int led5 = A4;
void setup()
{
Serial.begin(9600);
pinMode(trigpin, OUTPUT);
pinMode(echopin, INPUT);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
delay(1000);
}
void loop()
{
int duration, distance;
digitalWrite(trigpin, HIGH);
delayMicroseconds(1000);
digitalWrite(trigpin, LOW);
duration = pulseIn(echopin,HIGH);
distance = ( duration / 2) / 29.1*10;
Serial.println(“mm:”);
Serial.println(distance);
if( (distance > 60) && (distance <= 70) )
{
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
} else
if( (distance > 70) && (distance <= 90) )
{
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
} else
if( (distance > 90) && (distance <= 110) )
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
} else
if( (distance > 110) && (distance <= 130) )
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
} else
if( (distance > 130) && (distance <= 150) )
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, HIGH);
} else
if( distance > 150 )
{
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
}
}
[/dt_code]