[go: up one dir, main page]

0% found this document useful (0 votes)
18 views3 pages

Practical #07

PRACTICAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Practical #07

PRACTICAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

 APPLIED PHYSICS LAB

PRACTICAL#7.
 NAME:- ROLL
#
 CH.MUHAMMAD USMAN SHAKEEL. (SSP20-
PG03)
 TEACHER:-
( DR.MUJTABA IKRAM )

 ARDUINO usinG WATER LEVEL


SENSOR.
 INTRODUCTION:-
 Arduino based automatic water level indicator and
controller project measures the water level by using ultrasonic sensors.
 Basic principal of ultrasonic distance measurement is based on ECHO.
 When sound waves are transmitted in environment then they return back
to the origin as ECHO after striking on any obstacle.
 So we have to only calculate its traveling time of both sounds means
outgoing time and returning time to origin after striking on any obstacle.
 And after some calculation we can get a result that is the distance.
 This concept is used in our water controller project where the water motor
pump is automatically turned on when water level in the tank becomes
low.

 Hardware Required:-
 Arduino UNO.
 WATER LEVEL SENSOR.
 BREADBOARD.
 CONNECTION WIRES.
 PC OR LAPTOP.

 CONNECTIONS:-
 First you need to supply power to the sensor.
 For that you can connect the + (VCC) pin on the module to 5V on the
Arduino and – (GND) pin to ground.
 However, one commonly known issue with these sensors is their short
lifespan when exposed to a moist environment.
 Having power applied to the probe constantly speeds the rate of corrosion
significantly.
 To overcome this, we recommend that you do not power the sensor
constantly, but power it only when you take the readings.
 An easy way to accomplish this is to connect the VCC pin to a digital pin of
an Arduino and set it TO HIGH or LOW as per your requirement.
 So, we’ll connect the VCC pin to the digital pin #7 of an Arduino.
 Finally, connect the S (Signal) pin to the A0 ADC pin on your Arduino.

 Circuit Diagram:-
 WORKINGS:-
 The working of the water level sensor is pretty straightforward.
 The series of exposed parallel conductors, together acts as a variable
resistor (just like a potentiometer) whose resistance varies according to
the water level.
 The change in resistance corresponds to the distance from the top of the
sensor to the surface of the water.
 The resistance is inversely proportional to the height of the water:
 The more water the sensor is immersed in, results in better conductivity
and will result in a lower resistance.
 The less water the sensor is immersed in, results in poor conductivity and
will result in a higher resistance.
 The sensor produces an output voltage according to the resistance, which
by measuring we can determine the water level.

 CODINGS:-
// Sensor pins

#define sensorPower 7

#define sensorPin A0

// Value for storing water level

int val = 0;

void setup() {

// Set D7 as an OUTPUT

pinMode(sensorPower, OUTPUT);

// Set to LOW so no power flows through the sensor

digitalWrite(sensorPower, LOW);

Serial.begin(9600);

void loop() {

//get the reading from the function below and print it

int level = readSensor();


Serial.print("Water level: ");

Serial.println(level);

delay(1000);

//This is a function used to get the reading

int readSensor() {

digitalWrite(sensorPower, HIGH); // Turn the sensor ON

delay(10); // wait 10 milliseconds

val = analogRead(sensorPin); // Read the analog value form sensor

digitalWrite(sensorPower, LOW); // Turn the sensor OFF

return val; // send current reading

 APPLICATIONS:-
 This sensor can be used for the water level detection for the pan of a
water heater.
 It’s very common for these heaters to leak when they get older. Placing a
sensor in the pan to detect the presence of water where there should be
none.
 Same goes for under sink links. Especially in homes that are vacant for
much of the year.
 Although not specifically designed for soil moisture readings, it does work
relatively well for that purpose. Again, you’ll need to experiment with the
numbers but this device could be used to determine if plants need water
and to initiate a sprinkler to hydrate them.

You might also like