Ultrasonic Sensor
Measure distance between ultrasonic sensor connected to EV3 brick and nearest object
Add-On Required: This feature requires the Simulink Support Package for LEGO MINDSTORMS EV3 Hardware add-on.
Libraries:
Simulink Support Package for LEGO MINDSTORMS EV3 Hardware
Description
Use the Ultrasonic Sensor block to measure the distance between the ultrasonic sensor connected to the EV3 brick and the nearest object in front of the sensor. The sensor can detect objects from approximately 5 to 255 centimeters away. The block measures approximate distances from the object. For greater precision, calibrate the sensor output values against physical measurements.
The distance from which the sensor first detects an approaching object depends on these factors.
The ultrasonic reflectance of the object, which is a function of the object’s size and composition. The sensor detects large hard objects from a greater distance than small soft ones. For example, the sensor might detect a pane of glass at 255 cm and a hand puppet at 150 cm.
The angle of incidence of the object relative to the sensor. The sensor detects objects directly in front of it at greater distances than objects off to the sides.
During simulations without hardware, this block emits zeros. See Block Produces Zeros or Does Nothing in Simulation.
Examples
Ports
Output
Parameters
Version History
Introduced in R2012a
See Also
Open Block Library for LEGO MINDSTORMS EV3 Hardware | Motor | Run Model on EV3 Hardware