Ceiling-mounted motion detector for occupancy detection and other uses