Lesson 8 · Wiring And Coding The IR Sensor


Suggested Time: 25-30 minutes

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

  1. Wire the IR sensor exactly as demonstrated in the video.
  2. Add the sensor blocks to your program.
  3. Test the sensor and observe how its value or state changes when an object is detected.
  4. 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.


Additional Resources

Videos

Documents

Other