So why wouldn't I just use an ultrasonic, instead of an optical sensor?

Ultrasonics definitely have advantages when sensing clear objects, liquid level or highly reflective or metallic surfaces. Ultrasonics also function well in wet environments where as an optical beam may refract off the water droplets. However, ultrasonics are susceptible to temperature fluctuations or wind. With optical sensors, you can also have a small spot size, fast response and in some instances, you can project a visible spot on a target to help with sensor alignment.

Faq tags: