Since a PIR sensor is suggested so often, but a PIR doesn't tell you how close the human is, what about an infrared camera that can do facial recognition?
You're looking for a "full spectrum" camera. RGB-IR cameras do exist, that do multispectral imaging, however, I think that's rarely used for most facial recognition.
How to modify a webcam to be full spectrum: [1]
The facial recognition on an iPhone uses infrared illumination so that it can work in the dark as well.