Lesson Plan
Wiring And Coding The IR Sensor
Now you’ll give your Magic Box another way to sense the world. In this lesson, you’ll wire and code the IR sensor.
Tutorial Video
What You’ll Learn
- Connect the IR sensor to the Magic Box circuit
- Understand the IR sensor as an input
- Use sensor information in your block-based program
Follow Along
- Wire the IR sensor exactly as demonstrated in the video.
- Add the sensor blocks to your program.
- Test the sensor and observe how its value or state changes when an object is detected.
- Adjust your setup as needed so detection is reliable.
Check Your Work
Before moving on, make sure your project behaves like the example shown in the video. If something isn’t working, compare your wiring and code carefully with the video before changing multiple things at once.
What’s Next?
In the final lesson, you’ll combine the button and IR sensor to trigger the finished Magic Box.