This is a simple project to attempt to catch a leprechaun on St. Patrick's Day. It was my daughter's idea to build a trap and we constructed it together. We used an ST 6180X time-of-flight ranging sensor to detect when an object is present and rotate the trap into place using an RC servo. The ST 8160x also has a built-in light sensor so I added code to detect if the leprechaun is 'bright' or not. The whole thing runs on a Raspberry Pi which is obvious overkill but we were going for simplicity over power efficiency.
This was a great project to get kids involved in making stuff. Cardboard and hot glue are easy to build with and the subject matter was fun enough to keep them interested long enough to finish it. It also gave me a chance to get a little deeper into Python programming, porting the ST 6180X library from Arduino.