Arduino Questions and Answers – Ultrasonic Sensor

This set of Arduino Multiple Choice Questions & Answers (MCQs) focuses on “Ultrasonic Sensor”.

1. What is the use of the Ultrasonic Sensor?
a) Proximity Detection
b) Humidity Detection
c) Image Processing
d) GPS
View Answer

Answer: a
Explanation: The Ultrasonic Sensor is used for calculating the distance between the sensor and the object. It is mostly used for calculating the acceleration, velocity and position of the sensor attached to the device. It basically has two terminals which emit an Ultrasonic Signal and receive the emitted Ultrasonic Signal. The time difference between these two gives us the required data for such calculations.

2. How many pins are present in the Ultrasonic Sensor?
a) 1
b) 3
c) 2
d) 4
View Answer

Answer: d
Explanation: The pins that are present on the Ultrasonic Sensor include, the Ground, the Vcc and the Signal pins. The role of the Ground and the Vcc is to power the sensor. The Vcc accepts a maximum voltage of approximately 5V. The signal pins; Trigger and Echo are present to detect the obstacle and convey the data from the sensor to the microcontroller or the microprocessor.

3. What mode should we put the Arduino pin to, in order for object detection to work with the Ultrasonic Sensor?
a) Analog
b) Digital
c) PCM
d) TDM
View Answer

Answer: b
Explanation: The TRIGGER pin is to be kept HIGH for a period of 10 microseconds meanwhile the ECHO pin is HIGH for the time period it takes for the sent Ultrasonic wave to return to the sensor. Thus, the entire detection is digital.

4. What will happen if we supply a voltage of 25V to the Vcc of the Ultrasonic sensor?
a) Damage is caused
b) Sensor will work fine
c) Sensor will not respond for the time the voltage is applied
d) Sensor will function normally
View Answer

Answer: a
Explanation: The Ultrasonic Sensors are mostly built to work on a voltage range of approximately 3.3V to 5V. Any voltage lower than that and the sensor will not be able to power on, but however any voltage significantly above that and the sensor may suffer permanent damage.

5. If 1 means an object is detected and 0 meaning no object is detected, then considering the sensor is stationary, what can be said about the movement of the object if the output by the sensor is 1010101?
a) Object is stationary
b) Object is oscillating side by side
c) Object is continuously moving away
d) Object is continuously moving closer
View Answer

Answer: b
Explanation: The only explanation for such output from the sensor would be if the object is moving in such a path, that makes it within the range of the sensor and vice versa after each specified amount of time and this continuously happens along a deterministic path so that we know that the only way this can happen is that if the object is oscillating between two given points.

6. What is the final value of the d2 variable?

const int trigPin = 9;
const int echoPin = 10;
long d1;
int d2;
void setup() {
    pinMode(trigPin, OUTPUT);
    pinMode(echoPin, INPUT);
void loop() {
    digitalWrite(trigPin, LOW);
    digitalWrite(trigPin, HIGH);
    digitalWrite(trigPin, LOW);
    d1 = pulseIn(echoPin, HIGH);
    d2 = d1*0.034/2;

a) Distance
b) Duration
c) Time Period
d) Position
View Answer

Answer: a
Explanation: The above code is used to find the distance between the sensor and the object. First, we set the TRIG pin LOW for 2 microseconds. After that, in order to start the sensor, we need to set the TRIG pin HIGH for 10 microseconds. Now using the pulseIn() function we find the duration of time in microseconds and then convert it to the distance and store it in the d2 variable.

7. What kind of waves does the Ultrasonic Sensor work on?
a) Gas
b) Heat
c) Light
d) Sound
View Answer

Answer: d
Explanation: The Ultrasonic Sensor works on Ultrasonic Sound Waves. These sound Waves are very powerful and have a very high frequency which results in low attenuation.

8. What are the factors that affect the performance of the Ultrasonic Sensor during operation?
a) Distant Target Object
b) Target Object hidden by fog
c) Smoke
d) Dust
View Answer

Answer: a
Explanation: The Ultrasonic Sensor uses sound Waves of very high frequency to locate and track objects that are in it’s range. The advantages of this technique is that since we are using sound Waves, other factors like most, or fog or anything that causes low visibility become immaterial. However, the only problem is since the sound Waves are propagated at every direction from the source, they become weak as the distance increases and so they are inefficient in dealing with long distance targets.

9. What is the optimum current that is required to operate the Ultrasonic Sensor?
a) 20 mA
b) 15 mA
c) 200 A
d) 1 A
View Answer

Answer: b
Explanation: The current rating on any Sensor is given so that users can know the what is the optimum current that needs to be fed to the active sensor such that the internal electronics is not destroyed by excess current.

10. What is the maximum distance that the Ultrasonic Sensor can detect an object?
a) 8 cm
b) 200 cm
c) 9 cm
d) 20.21 cm
View Answer

Answer: b
Explanation: The maximum range of the Ultrasonic Sensor is the greatest distance upto which the sensor can pinpoint an object.

Sanfoundry Global Education & Learning Series – Arduino.

To practice all areas of Arduino, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.