These Ultrasonic Sensors are perfect for range detection, especially where lighting and transparent materials can interfere with IR range measurement.
These sensors calculate range based on ping: it measures range by measuring the time it takes between transmitting and receiving an ultrasonic sound wave.