WorksheetsMicro:bit and Ultrasonic Sensor Worksheet
Total questions: 10
Worksheet time: 5mins
What is the main purpose of an ultrasonic sensor with Micro:bit?
To measure temperature
To measure distance
To measure light
To control voltage
Which pins of the Micro:bit are usually used with the ultrasonic sensor?
P0, P1, or P2
GND and 3V only
RX and TX
SDA and SCL
What is the role of the ‘if’ block in Micro:bit MakeCode?
To repeat the code
To check a condition and execute code if true
To display images
To set pin voltage
What happens when the measured distance is less than the threshold in Micro:bit if-else program?
LED turns on
LED turns off
Program stops
Motor starts
What does the ‘else’ block do in Micro:bit MakeCode?
Executes code when the ‘if’ condition is false
Stops the Micro:bit
Turns off the LED permanently
Measures distance again automatically
Which Micro:bit block measures the distance from the ultrasonic sensor?
Digital write pin
Ultrasonic distance
Show string
Which statement correctly turns on an LED when an object is close?
if distance < 10: show LED
else distance > 10: show LED
while distance > 10: turn off LED
repeat forever: turn on LED
Why do we use if-else statements with an ultrasonic sensor on Micro:bit?
To control motor speed
To decide when to turn the LED on or off based on distance
To charge the battery
To measure voltage
Which Micro:bit pin type is used to connect the ultrasonic sensor?
Analog pin
Digital pin
I2C pin
RX/TX pin
How does the Micro:bit calculate distance using ultrasonic sensor?
Using sound waves and time of flight
Using light reflection
Using battery voltage
Using temperature difference
