Practical #07
Practical #07
PRACTICAL#7.
NAME:- ROLL
#
CH.MUHAMMAD USMAN SHAKEEL. (SSP20-
PG03)
TEACHER:-
( DR.MUJTABA IKRAM )
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
int val = 0;
void setup() {
// Set D7 as an OUTPUT
pinMode(sensorPower, OUTPUT);
digitalWrite(sensorPower, LOW);
Serial.begin(9600);
void loop() {
Serial.println(level);
delay(1000);
int readSensor() {
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.