I have seen and used non-contact soap dispensers and water taps in public toilets for a long time already, but only recently have I begun wondering, what kind of sensors they use and how exactly those work. Many of those devices seem to feature some kind of infrared light source, but how do you cheaply measure distances using light without measuring travelling time? Because I guess that would be too expensive and complex for such devices. Or do those sensors not measure distance? And are there any technologies, that don't use infrared light?
EDIT1:
Thanks for all the answers so far. They cover most of the devices I have had a look at. I'd now just like to know, whether there are any other technologies to do this, that do not use infrared light. Because there is this one non-contact hand dryer in my university, which does not seem to feature any IR equipment. Or maybe it is just very well hidden.