0% found this document useful (0 votes)
4 views

Activity_Card_3-Water_Level_Sensor

Uploaded by

rajsaini088
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Activity_Card_3-Water_Level_Sensor

Uploaded by

rajsaini088
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ACTIVITY CARD - 3

WATER LEVEL SENSOR

Introduction
Water Level sensor works on the principal of conduction. When the sensor is immersed
in water or any other conductive liquid, the resistance of the sensor changes. This in
turn produces an analog voltage signal which is dependent on the level of water. As
shown in below figure, depending on the level of water the resistance of water level
sensor decreases. For example, if level of the water is high, it measures low resistance.
That resistor can be measured by using multimeter.

70K 45K 70K

Objective:
During this activity, you will help students to achieve following objectives:
▪ Understanding principle and operations of Water Level sensor.
▪ Design algorithm and flowchart to sense water level using Water Level sensor.
▪ Programming Water Level sensor using Arduino API for Intel Genuino.
▪ Interfacing Water Level sensor with Intel Genuino using analog pin A0.
Algorithm
Step 1 Assign analog pin A0 to water level sensor

Step 2 Define and initialize SensorValue to 0 I,e int SensorValue=0

Step 3 Read SensorPin and store value in SensorValue variable

Step 4 Print SensorValue on Serial monitor


Flowchart
Programming

A/n* alogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor. Graphical
representation is available using serial plotter (Tools > Serial Plotter menu)
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and
ground.

*/

int WaterSensor = A0;

// the setup routine runs once when you press reset:

void setup() {

// initialize serial communication at 9600 bits per second:

Serial.begin(9600);
}

// the loop routine runs over and over again forever:

void loop() {
// read the input on analog pin 0: int

sensorValue = analogRead(WaterSensor);

// print out the value you read:

Serial.println(sensorValue)
; delay(1); // delay in between reads for
} stability
Hardware

Instructions:
• Connect GND pin of Water Level sensor to GND on the Genuino board
• Connect Out pin of Water Level sensor to A0 on the Genuino board
• Connect VCC pin of Water Level sensor to 5V on the Genuino board
• Connect power supply to the Genuino and USB to USB Client Port on the
• Genuino
• Open Arduino IDE under Tools → Board select Intel® Genuino
• Under Tools → Serial Port select the Com # where the Genuino is connected to
• Write the above code on Arduino IDE
• Upload to the Genuino by clicking the upload button
• Monitor the value of the water level sensor in the Serial Monitor

Hardware Connection
Genuino pin Water Level Sensor Pin

5V VCC

GND GND

Analog pin 0 Signal


Circuit Diagram:

You might also like