When you are getting old, you start to forget about things. For example, leaving the garage door open until your neighbor knocked on your door. I want to build something that can alert me when my garage door is left open for a long time. I thought about it and there are a few solutions:
- Use a distance measurer like ultrasound or laser.
- Use a camera with image recognition.
- Use a magnet contact sensor.
I decided to go with #1 first because for #2, I will need to collect a lot of sample images first, e.g. light conditions, with or without cars, etc. I also need to figure out where to run the image processing, locally using OpenCV or use AWS Rekognition. For #3, it is feasible but I will need to see where to put the magnets and where to put the Raspberry Pi.
After buying the ultrasonic module HC-SR04, it only took a while to wire up everything and wrote the program. However, when I took it to the garage, I realized this solution did not work properly: sound does not travel in a straight line but waves. Due to the power outlet position, I could not put the Pi in the middle of the garage that is closed to the garage door, so it was on next to the wall and facing the center of the garage door. Somehow the sound would always hit the edge of the wall around the garage door and return me constant distances, regardless of the garage door being opened or not.
Although the results for me was disappointing, it was fun for me to pick up the Pi again after so long!