Lesson 14 · Using Ultrasonic Sensor To Open And Close Box. Math Included
Lesson Plan
Project Overview
Complete the automatic Magic Box by adding an ultrasonic distance sensor. You’ll learn how the sensor measures distance, work through the math behind it, and program the box to open and close when someone approaches.
Materials
Need materials? Purchase the Magic Box Kit at our e-store.
Classroom sets available. Contact us at info@barnabasrobotics.com to inquire.
Tutorial Video
Magic Box 2.0 - S1E14 - Using Ultrasonic Sensor To Open And Close Box. Math Included
Video length: 32:40
Key Topics
- How an ultrasonic distance sensor works
- Calculating distance from echo timing
- Opening and closing the Magic Box based on distance
Before Moving On
Make sure your circuit and code from this lesson work reliably before continuing to the next episode. Save your code so you can build on it in later lessons.
What’s Next?
Congratulations—you’ve completed the Magic Box tutorial series! Now that your box can sense when someone approaches and open automatically, experiment with your own ideas. Try changing the distance that triggers the box, adjusting how the LEDs behave, modifying the servo movement, or combining sensors and inputs in new ways.