Ultrasonic sensors operate by emitting sound pulses that reflect off nearby objects. The sensor then detects the echo to determine the distance to the object. There are four main components: a transducer that emits and receives sound, a comparator that calculates distance from time of flight, a detector circuit, and a solid-state output. Ultrasonic sensors can detect most materials and are less affected by moisture than optical sensors, but have difficulty detecting soft absorbing materials. Their sensing range depends on factors like target size, material, temperature, and environmental noise. Common transducer types include piezoelectric crystals and electrostatic foils.