Color sensing (as well as detecting empty spaces) settled on IR-based sensors commonly used in line-following robots. You can watch the clock in action in the video embedded below just under the ...
(Passive InfraRed sensor) A device used to detect motion by receiving infrared radiation. When a person walks past the sensor, it detects a rapid change of infrared energy and sends a signal.