Ultrasonic Sensors:
Use high-frequency, inaudible sound waves to determine distance
Reliable in low-light conditions and on surfaces where optical sensors might fail
Like a bat using echolocation to "see" its surroundings
How Temperature Affects Ultrasonic Waves
Speed of Sound:
Warmer air makes molecules move faster, increasing sound speed
Colder air slows sound, affecting the return time of ultrasonic pulses
Temperature variations can alter measurement accuracy
In-Class Experiment: Flood Monitoring
Objective: Use an ultrasonic sensor to measure water levels in a container, simulating a flood
Materials Needed:
Arduino R3/R4 Uno, ultrasonic sensor, buzzer, container, water source, measuring tape, computer, fishing line (thin string), graphing tools (Excel/Google Sheets)
Procedure:
Sensor Setup:
Mount the sensor above the container and record the initial (dry) distance
Uploading the Code:
Upload the provided sketch that triggers the sensor, measures distance, and activates a buzzer when thresholds are met
Data Collection & Analysis:
Pour water gradually and manually measure water level
Plot sensor data versus manual measurements to analyze accuracy
Code Explanation
Triggers the sensor, calculates the time it takes for the echo to return, converts this to a distance measurement
Uses conditional logic to sound a buzzer if the distance falls below a set threshold
Discussion & Real-World Applications
Analysis:
Compare sensor data with manual measurements
Discuss factors (e.g., temperature, water ripples) affecting accuracy
Applications:
Flood monitoring, reservoir management, coastal tide measurement
Broader environmental sensing and early warning systems