Lesson 5 - Smart Window: Light-based Control System

Lesson 5 Smart Window: Light-based Control System

 

image3.png Challenge 5-1, 5-2

Students will program with light sensor and servo.

image5.png I can explain if then else conditionals in a program.

image7.png I can use if then else conditions.

image7.png I can use a flowchart to plan and organize my ideas.

Engage

image9.png 2 min.

In summer, the sunlight is very strong, direct sunlight exposure makes the home hot.

image11.png

How can we make a smart roof windows to create a more

comfortable space that opens and closes based on the light brightness?

Background

image9.png 3 min.

How does the house sense the light brightness? The light sensor reports the intensity of ambient light from 0–4095, where 0 is full darkness and 4000–4095 is direct sunlight. The ambient light value in the average classroom is anywhere from 3000 to 4000.

image12.png

The program uses an if then else block to choose which servo angle to run in different lighting conditions. The conditions are established with a hexagonal comparison block.

image13.png

Build and Connect

image9.png 15 min.

image14.pngBuild together by the Building instruction.

After groups finish building, prompt them to discuss the questions below:

If the closed window is at 0°, what degree is appropriate to open the window clockwise?

On a hot noon with direct sunlight, what should the smart windows do?

Program

image9.png 20 min.

image15.png Challenge 5-1: Observe the Program & Describe in Natural Language

image17.pngAsk students to predict what they think will happen.
image18.pngEncourage students describe the process in the if/then frame.
image19.pngGroups should open Coding page-Mind+, connect their hardware, upload the project (program5-1) to try it.

NOTE: If 0° does not fully close the roof window, remove the servo, adjust the window’s angle, then reset the servo.

image20.png

image21.png
image22.pngAfter groups finish coding, ask students to describe how the if then else conditional in the starter code works by using the sentence frame below:Ifthen.
Example student answer:“If the ambient light is greater than(>) 2000, the windows open. If the light is not greater than 2000, the windows close.”

image23.png Introduce the key vocabulary flowchart.

A flowchart uses shapes and arrows to clearly show how a program works step by step.

· Start: Shows how the program begins.

· Arrows: Show the order of steps.

· Branches: Show different conditions (e.g., lightness strong / weak).

· Outcomes: Show what happens when conditions are met or

not.

image15.png Challenge 5-2: Complete the Flowchart & Adjust Threshold

image25.pngFill the flowchart to explain how the smart window works.
image26.pngStudents will need to adjust the comparison value so that the windows close properly under your classroom’s light conditions. When the light sensor detects bright sunlight, the windows will close. Setting the value to 4000 works for most classroom light levels.

NOTE: If the classroom light is too strong, move the light sensor to a darker area inside the house for a lower reading.

image12.png

Extra Practice

image9.png 5 min.

Ask students to change greater than (>) to less than (<) in the comparison block so that it reads ambient light < 4000. Then challenge students to change the blocks in the program to make smart window system behave the same.

 

Next Class: Lesson 5

Current Tutorial: Click Here

icon Português.zip 5.11MB Download(0)
icon Smart Home-Lesson 5.zip 5.95MB Download(0)
License
All Rights
Reserved
licensBg
0