you could also use a sharp ir sensor and calibrate it when it starts up?
so it turns on, takes a reading of whats in front of it and says if anything is in that range do something.
say you hold your hand 5cm in front of it when it starts, then it will only pay attention to things less than 5cm...