Ultrasonic sensor provides vision capabilities to the robot. Ultrasonic sensor helps robot judge distances and identifies the object locations. Using the NXT Brick, the Ultrasonic Sensor is able to detect an object and measure its proximity in inches or centimeters. A simple usage of ultrasonic sensor can be to check for an obstacle in front.
An ultrasonic sensor measures distance by using the same mechanism by which bats can “see” at night. The ultrasonic sensor consists of two main components, an emitter and a detector; the emitter creates ultrasonic audio waves (ultra-sonic means audio beyond the capability of human hearing) and sends them towards an object. The ultrasonic sound is reflected back by an object and is received by the detector. This process is like you hearing an echo of what you say in a large empty room. By measuring the time it took for the detector to hear the echo of the reflected audio, the sensor can calculate how far an object is, the longer it took the farther the object is.