The HC-SR04 ultrasonic sensor is a ranging sensor that can measure distances of up to 400cm using ultrasonic waves. It has four pins - VCC, Trigger, Echo, and Ground - where a 10us pulse is sent to the Trigger pin to initiate a measurement, then the sensor outputs a pulse on the Echo pin whose duration corresponds to the distance measured.