Drip Irrigation Kit(micro:bit): Lesson2 - Know Your Water Level Sensor: Water Collector

1. Engage: Water Level Sensors in Our Daily Lives


Start the lesson by showing short videos or images of everyday devices using water level detection.

Key Question
How does the washing machine decide when to stop? Is there a “secret eye” inside that “sees” the water level?


Activity 1
Brainstorm & Share
Give students 2 minutes to discuss in pairs: “What other devices might need to “check” water levels?” (e.g., rice cookers, garden sprinklers). Share ideas with the class.


2. Explore: How Do Water Level Sensors Work?


Show a simple diagram of a water level sensor.

Use analogies to make it relatable:
For contact sensors: it provides different output voltages depending on how much water touches the sensor.

For non-contact sensors: “Like a bat using sound (ultrasound) to ‘see’—the sensor sends a beep, listens for the echo, and calculates how far the water is!”

 

Key Question
Which type of sensor is more suitable if we need to measure corrosive liquids? (non-contact water level sensors)
Which type of sensor should be chosen if we only need to detect the water level? (contact water level sensors)


3. Engineer: Meet the Water Level Sensor


Display the the water level sensor.

Insert micro:bit into the expansion board and plug the sensor into the A0 port on the expansion board, and then connect the micro:bit to the computer.

Don't forget to set up the 18650 battery and switch the expansion board to ON.
Follow the steps below to build the block structure for the water level sensor section.

Finally, you've finished the connection and building.

Go to the MakeCode editor and create a new project.

Connect and pair your micro:bit to your browser.

Show students how to write code to read the water level through the water level sensor.
Drag out a "show number" block and place an "analog read" block in its circle.
① Then complete the program as shown in the picture below.

② Download the code.

When the sensor is in the air, watch the screen display a number (ranging from 0 to 1023), then observe how the number changes when you dip the sensor in water!


Key Question
What happens to the number on the screen if we dip the sensor deeper into water? Let’s guess before testing!


4. Experience: Code & Test the Sensor


Activity 2
Provide the code above. Let students upload it to their micro:bit.
Ask them to dip the sensor into a cup of water (in air → 1cm → ... →4cm) and record the number on the screen in the table in the activity sheet.


(The scale can be found on the back of the water level sensor PCB.)

Here is a sample sheet:
 

Guided Discussion: Why does the number change? (The number changes because the sensor detects changes in water level)


5. Challenge: Modify Your Code


Activity 3
Design a Low-Water Alarm:
Write a program to read water level data continuously, and make the micro:bit beep when the water level is too low.


Guide them to modify their codes following the steps below.
① Drag another “forever” block out.

② Drag “if-else” block out and put in “forever”.

③ Insert comparison block into “if-else” block, and change the “<” to “≤”.

④ Set the value in the circle block as shown below.

⑤ Complete the “if-else” block with Music blocks.

⑥ Download this program.

Then test their codes!
Students dip the sensor: When it’s dry (analog read ≤ 200), the buzzer beeps. When wet (analog read > 200), it stops.


Key Question
How could this alarm help in real life? (e.g., alerting us to refill a pet’s water bowl)


6. Elaborate: Saving Water with Sensors


Now, let’s imagine we’re building a rainwater collector—a device that catches rain to water plants, wash bikes, or fill birdbaths. 
Question: How could our water level sensor make this rainwater collector smarter and more efficient?
Share ideas and draw simple sketches.

icon Lesson2-Know Your Water Level Sensor Water Collector.zip 5.94MB Download(0)
License
All Rights
Reserved
licensBg
0