Lesson 2 Home Lighting – Input and Output Exploration
Challenges: 2-1, 2-2
Students will explore input and output systems in smart home devices.
I can use a PIR motion sensor input to control an LED output.
I can identify and connect inputs and outputs correctly.
I can explain how inputs trigger outputs in a system.
Engage
2 min.
Imagine walking to your house on a dark evening. You don’t have to fumble for a light switch — the lights turn on automatically as you step near!

Why does the light on automatically?
What smart lights have you seen at home or in public?
Share your ideas with your classroom!
Background
3 min.
Lighting sensors are vital components in smart light systems. They play a crucial role in optimizing the performance and efficiency of lighting installations. There are several common types:
Light sensors, work by detecting ambient light levels.
Passive Infrared (PIR) sensors are designed to detect body heat by sensing the infrared radiation emitted by living things.
Ultrasonic sensors utilize high-frequency sound waves to detect distance.

Inputs: Signals that tell the system what to do. These can be motion from a sensor, a button press, a voice command, or even a tap on a phone app. The PIR motion sensor is the input sensor for this lesson.

Outputs: The system’s response to an input. This could be an LED turning on, a light dimming, a speaker playing a sound, or a screen showing a message. The strip light is the output actuator of this lesson.

Build and Connect
10 min.
![]() | Build together by the building instruction. |
When groups finish building, prompt them to discuss these questions:
Where would you place the PIR motion sensor and strip light in your home to help you at night?
Why is that spot better than others?
Students should set up the PIR motion sensor and strip light based on their discussion.
Program
25 min.
Challenge 2-1: Upload and Connect
![]() | Ask students to connect the UNIHIKER K10 to computer with the cable. |
![]() | Ask students to load and upload the starter project [program2-1]. |
![]() | ![]() Read the code block and figure out which pins on the UNIHIKER K10 the sensor and actuator are connected to. Ask student to complete the drawing and make hardware connections following the diagram. This is the standard diagram of the finished connection diagram. |
![]() | When groups finish connecting, prompt them to explore the PIR motion sensor and the strip light. They could wave hands in front of the sensor and observe what happens. As groups explore, you can encourage them to start using the term input to explain the what detected by the sensor and output to describe the light. when it receives each input. Students will discuss the relationship between inputs and outputs observed in their model. |
NOTE: The strip light has two sockets. Please make sure to connect the correct side (the arrow start) to the UNIHIKER K10’s pin socket. And the other socket is for extending the strip light.
Challenge 2-2: Explore PIR Sensor Detection
![]() | Encourage groups to discuss:What does read digital = 1/0 mean?Explain that this command reads digital signals of 1 or 0 from Pin 0. Here, 1 indicates detected motion, while 0 means no motion is detected. |
![]() | ![]() Ask students to change 1 to 0 in the comparator block so that it reads P0 = 0. Then challenge students to change the blocks in the program to make the system behaving the same. Here’s what the completed program should look like. |
Extra Practice
5 min.
Brainstorm other objects or creatures that might trigger the PIR motion sensor (e.g., stationary hand, a moving book).
Test each item in the sensor’s working zone. Which ones trigger the LED? Why do you think that is?
Share your findings with the class—did anyone discover a surprising trigger?
Next Class: Lesson 3
Current Tutorial: Click Here


















