If you ever thought how fast you can react to external stimulus here is the circuit that can measure your response time. It measures the time it takes for you to press the push button in response to turning the LED ON. The average human response time is about 300 ms. The principle of operation is relatively simple. Timer 1 was used to generate 1 ms counts immediately after turning ON the LED. Next the program counts the number of millisecond pulses until the switch is pressed and this is your reaction time. Here is the schematic.
A few words about limitations of this project and possible future improvements. Currently the time it takes to turn the LED ON is not random, so implementing a random number generator routine can be a useful upgrade. This function can be based for example on random noise present at the A/D converter input. Also in order to restart the circuit you’ll need to turn the supply voltage OFF/ON or connect a simple push button between pin 1 of PIC and ground. I’ve recorded a short video clip demonstrating the operation of this design available at the bottom of this post.