The most fascinating PIC project I had worked on was an automatic urinal flusher. These were battery operated ones that detected a person approaching the urinal and would automatically flush water twice, one before and once after use.
Being battery powered, power consumption was important. So, I used the PIC16F84's watchdog timer feature to periodically wake the circuit after going to sleep for a fraction of a second. Once awaken, it would fire a short burst of 38Khz pulsed IR beam. If there was a person present, the IR beam would reflect from the body and be detected by an IR sensor. This sensor was sensitive to the 38Khz frequency and so was able to discriminate against any background source. If no person was detected, the circuit was put to momentary sleep to conserve power until the next watchdog reset.
Using a 455Khz clock frequency on the PIC, the 38Khz pulse was generated by using just 3 instructions repeated several times.