Recall & Review
beginner
What is the purpose of the HC-SR04 ultrasonic distance sensor?
The HC-SR04 sensor measures the distance to an object by sending ultrasonic sound waves and calculating the time it takes for the echo to return.
Click to reveal answer
beginner
Which two pins on the HC-SR04 sensor are used to trigger and receive the ultrasonic pulse?
The 'Trig' pin sends the ultrasonic pulse, and the 'Echo' pin receives the reflected pulse to measure distance.
Click to reveal answer
intermediate
How do you calculate distance from the duration of the echo pulse in Arduino code?
Distance (cm) = (duration of echo pulse in microseconds) / 58. This formula converts the time into centimeters.
Click to reveal answer
beginner
What Arduino function is used to measure the duration of the echo pulse?
The function 'pulseIn()' measures the time in microseconds that the echo pin stays HIGH, representing the echo duration.
Click to reveal answer
intermediate
Why do we need to set the Trig pin LOW before sending a HIGH pulse?
Setting the Trig pin LOW first ensures a clean HIGH pulse of 10 microseconds, which triggers the sensor correctly without noise.
Click to reveal answer
What is the typical duration of the HIGH pulse sent to the Trig pin to start a measurement?
✗ Incorrect
The HC-SR04 sensor requires a 10 microsecond HIGH pulse on the Trig pin to start the ultrasonic burst.
Which Arduino function reads the time the Echo pin stays HIGH?
✗ Incorrect
pulseIn() measures the length of a pulse on a pin in microseconds, perfect for reading the Echo pin duration.
If the echo duration is 1160 microseconds, what is the approximate distance in centimeters?
✗ Incorrect
Distance = duration / 58, so 1160 / 58 = 20 cm approximately.
What does the Echo pin output when no object is detected within range?
✗ Incorrect
If no echo is received, the Echo pin stays LOW because no reflected pulse returns.
Why is it important to wait some milliseconds between measurements?
✗ Incorrect
Waiting ensures the previous echo pulse is complete and prevents overlapping signals that cause wrong readings.
Explain how the HC-SR04 sensor measures distance step-by-step.
Think about sending a sound wave and timing its return.
You got /5 concepts.
Describe how you would connect and program the HC-SR04 sensor with an Arduino to measure distance.
Focus on wiring and the main code steps.
You got /5 concepts.
