Lesson 07 Teacher's Guide
Lesson 07 Teacher's Guide
• Understand the importance of efficient water management in agriculture and how water
level sensors can help achieve this goal.
• Learn about the key features of water level sensors, including their ability to measure
water levels with high precision and provide real-time monitoring capabilities.
• Gain an understanding of the basic programming needed to set up and read a water
level sensor, including connecting the sensor to the appropriate pin, initializing serial
communication, and reading/outputting water level values.
Key Components:
Water Level Sensors in Agriculture
• Water level sensors measure and monitor water levels in reservoirs, irrigation systems,
ponds, etc.
• Types include float, ultrasonic, and pressure sensors, which help ensure efficient
irrigation, prevent water wastage, and optimize crop growth.
• Water management is critical for improving productivity, reducing costs, and avoiding
environmental damage (e.g., soil erosion, pollution).
Key Features:
• Precision: Sensors can measure with high accuracy.
• Real-time Monitoring: Data on water levels allow farmers to adjust irrigation schedules to
conserve water, avoid over-irrigation, and respond to leaks or system blockages.
Key Programming:
Introduce students to the basic code for setting up and reading water level sensors with
Arduino.
void setup() {
Serial.begin(9600);
}
void loop() {
waterLevel = analogRead(waterSensorPin);
Serial.print("Water Level: ");
Serial.println(waterLevel);
delay(1000);
}
Explanation:
• The program reads data from the sensor and prints it on the serial monitor.
• A 1-second delay is used between readings to prevent excessive data output.
Assessment:
Let the students answer the True and False questions and Identification.
Guided Activity:
Objective: Design a simple system to monitor water levels in a tank and trigger a water pump
when the level is too low.
Materials:
• Water level sensor • Arduino Uno
• LCD I2C module • Jumper wires
• Relay • Breadboar
• Water pump
• d
•
Circuit Design:
• Step 1: Connect the water level sensor to analog pin A0.
• Step 2: Connect the LCD I2C to pins A4 and A5 for SDA and SCL.
• Step 3: Attach the relay to digital pin 3 to control the water pump.
• Step 4: Wire the water pump to the relay and test the system by observing the LCD
readings and checking if the pump activates when the water level is low.
Programming: Upload the code to display the water level on the LCD and activate the pump
when needed.
#include <LiquidCrystal_I2C.h>
// Define the pins for the water sensor, relay, and water pump
int waterSensorPin = A0; // Water level sensor connected to analog pin A0
int relayPin = 3; // Relay connected to digital pin 3
int waterLevel; // Variable to store water level reading
int threshold = 500; // Threshold value for water level
void setup() {
// Initialize the LCD
lcd.begin();
lcd.backlight(); // Turn on the LCD backlight
void loop() {
// Read the water level from the sensor
waterLevel = analogRead(waterSensorPin);
Explanation:
1. The water level sensor is connected to analog pin A0 to measure the water level.
2. The relay is connected to digital pin 3 and controls the water pump.
3. The water level is displayed on the LCD and printed in the serial monitor.
4. If the water level is below the threshold (500 in this example), the relay will turn on the
water pump for 5 seconds.
5. The LCD will also show the pump status ("Pump ON" or "Pump OFF").
Independent Activity
Objective: Implement a real-time water monitoring system using water level sensors, LCD, and
Arduino to help manage farm irrigation.
Materials:
• Arduino Uno, Water level sensor, LCD I2C, Relay, Water pump, Breadboard, and
Jumper wires.
Procedure:
1. Assemble the circuit as instructed.
2. Upload the code and calibrate the water sensor based on the crops being monitored.
3. Test the system by monitoring how it performs over different water levels.
4. Document observations of water levels for various plants (e.g., onions, tomatoes,
lettuce).
Sample code for the activity:
#include <LiquidCrystal_I2C.h>
void setup() {
// Initialize the LCD
lcd.begin();
lcd.backlight(); // Turn on the LCD backlight
void loop() {
// Read the water level from the sensor
waterLevel = analogRead(waterSensorPin);
Explanation:
1. The water level sensor is connected to analog pin A0.
2. The water level is displayed on the LCD and printed in the serial monitor.
3. There is no pump control in this version; the focus is on reading and displaying sensor
data.
Rubrics for grading the activities:
Answer Keys
Assessment:
I. True or False 10. True
1. True II. Identification
2. False 1. irrigation
3. True 2. water
4. False 3. pressure
5. False 4. time
6. True 5. wastage
7. True
8. False
9. False