Activity_Card_3-Water_Level_Sensor
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.
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
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.
*/
void setup() {
Serial.begin(9600);
}
void loop() {
// read the input on analog pin 0: int
sensorValue = analogRead(WaterSensor);
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