Fall 2025 Inquiry Miner Mayhem Programs
The purpose of this lesson is to introduce students to the ultrasonic sensor and learn the use of if-else statements in coding. Students will learn how to:
Read values from an ultrasonic sensor
Use if-else statements to provide different outputs
1x Arduino Mega R3
1x USB A-to-USB B cable
1x Breadboard
1x Ultrasonic sensor
3x LEDs (1 red, 1 yellow, 1 green)
3x 220 Ω resistors
Male to Male (M-M) wires
Chromebook or laptop for each student
Arduino IDE installed or
Access to Arduino web editor with Arduino Create Agent installed
1x Ruler
Ultrasonic: Refers to sound waves with frequencies higher than the upper limit of human hearing, typically above 20,000 Hz.
Signal conditioning: The process of preparing an output signal for a sensor, receiving the input signal from the sensor, and comparing the two to interpret the sensor's readings accurately. This ensures the data from the sensor is usable by the system.
Calibration: A process used to set up a sensor to ensure that the electrical values it reads accurately reflect real-world measurements, thus aligning the sensor's readings with known reference values.
Conditional statement: A programming instruction that performs different actions based on whether a specified condition is true or false, and allows the program to execute certain functions only when certain conditions are met.
Boolean: A variable type that is used to store True or False values.
Using the Arduino Web Editor
Introduction to Programming an Arduino
Arduino Syntax
Conditional Statements
Speed of Sound/Ultrasonic sensor
As you write the code for your students, you may write the code alongside them, sharing your own screen to see exactly where each line goes. The downloadable code is intended for your reference while following the activity.
If you find that the activity is not properly working, make sure to double check you/your students' wiring and code against ours. Working with electronics and Arduinos can be difficult and much of the learning process (for students and teachers) is in the troubleshooting. That being said, if it seems like the activity is still not working or you are stuck, let us know! Send us an email and we will work to troubleshoot as much as possible!