2023-12-20
Christmas Day is every bit as magical for the parents as it is the kids. Our kids are not allowed downstairs on Christmas morning until we are ready to go down with them. For years we've setup 'traps' for them - aluminum foil on the stairs, string attached to bells. This year, I stepped things up with an Arduino powered electronic trip wire.
This is a pretty simple project, with the major components being readily available cheaply and easily.
Connecting these together was fairly straight forward. The DF Player has a great library with all the info you need DFRobot / DFRobotDFPlayerMini.
For the distance measureing, the Adafruit library & their examples worked perfectly Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout.
Breadboarding these out only took a few minutes. For added functionality, I added a simple button. This will be used to set the distance.
The code got progressively more complicated as I fine-tuned the alerting mechanism. This example uses a fixed alert sound, and some values are hard-coded. Very little is commented.
Although this took longer than I would like admit, a quick trip to the dollar store for a suitable container was all that was needed to find the right home for this creation.