Lesson 11 Teacher's Guide
Lesson 11 Teacher's Guide
Key Components:
1. Negative Effects of Heavy Rain on Crops:
o Waterlogged soil, nutrient leaching, soil erosion, disease and pest infestations,
delayed planting and harvesting, and crop stress.
2. Arduino Function:
o Using an Arduino setup with a water sensor and servo motor to create a
prototype that can protect crops from excess rain..
Key Programming:
1. Materials:
o Arduino Uno Microcontroller
o Breadboard
o Servo Motor
o Water Sensor
o Photoresistor (for the guided activity)
o Additional recyclable materials (for the independent activity)
2. Assembly Steps:
o Connect the power and ground to the breadboard.
o Connect the servo motor and water sensor as described in the original
lesson.
3. Code:
#include <Servo.h>
Servo servo_crop1;
Servo servo_crop2;
void setup() {
servo_crop1.attach(3); // Connects servo 1 to pin 3
servo_crop2.attach(5); // Connects servo 2 to pin 5
Serial.begin(9600); // Initializes serial communication
}
void loop() {
leftVal = analogRead(leftLDR); // Reads left LDR value
rightVal = analogRead(rightLDR); // Reads right LDR value
Assessment:
Let the students answer the Multiple Choice questions.
Guided Activity:
• Objective: Enhance the early warning system by adding a photoresistor to monitor
sunlight.
• Components: Arduino, breadboard, servo motor, water sensor, photoresistor, buzzer.
• Steps:
1. Set up the photoresistor in the circuit.
2. Write code to control the servo motor based on both water sensor and photoresistor
inputs.
3. Discuss when the buzzer should sound and when the servo should move.
4. Provide sample code for each scenario.
Code:
#include <Servo.h> // Include the Servo library
void setup() {
servo_crop.attach(3); // Attach servo to pin 3
Serial.begin(9600); // Initialize serial communication
}
void loop() {
sensorValue = analogRead(waterSensor); // Read water sensor
value
lightValue = analogRead(photoresistor); // Read photoresistor
value
Explanation:
• The code begins by including the Servo library and declaring variables for the water
sensor, photoresistor, and their respective values.
• In the setup() function, the servo is attached to pin 3, and serial communication is
initialized for debugging.
• The loop() function continuously reads the values from the water sensor and
photoresistor.
• If the water sensor value exceeds 100, the servo moves to 180 degrees to cover the
crops; otherwise, it returns to 0 degrees.
• The code also prints the sensor values to the Serial Monitor for observation.
Guide Questions:
• What happens to the servo motor when the photoresistor detects a high value of light?
• What happens to the servo motor when the water sensor detects a high value of water?
Independent Activity
• Objective: Design a prototype of the early warning device for farmers using recyclable
materials.
• Components:
o Arduino Uno Microcontroller
o Breadboard
o Servo Motor
o Water Sensor
o Photoresistor (for the guided activity)
o Additional recyclable materials (for the independent activity).
• Program/Code: Students will document their code used for the prototype.
Code:
void setup() {
servo_crop.attach(3); // Attach servo to pin 3
Serial.begin(9600); // Initialize serial communication
}
void loop() {
sensorValue = analogRead(waterSensor); // Read water sensor
value
lightValue = analogRead(photoresistor); // Read photoresistor
value
// Photoresistor logic
if (lightValue > 300) { // If high light level detected
// Action when light level is high (e.g., trigger a buzzer)
// Here you can add code to activate a buzzer if necessary
}
Explanation:
• This code is similar to the guided activity but serves as a template for students to expand
upon based on their designs.
• The students can modify the conditions for the servo or integrate additional components
like a buzzer based on their prototypes.
• Encourage students to explore different threshold values for the water sensor and light
sensor based on their findings from the guided activity.
Answer Keys
Assessment:
I. Multiple Choice
1. C – humid
2. C – topsoil
3. A – iron
4. D – root rot
5. D – nutrient leaching
6. B – delayed planting
7. B – oxygen
8. A – snails and slugs
9. B – waterlogged
10. D – stem breakage