Inspiration

We were inspired by home security systems like Ring and the growing awareness of everyday crime, along with how easy it can be to pick traditional locks. We wanted to build a system that actively prevents unauthorized access instead of just recording it.

What it does

LockWatch uses an Arduino with depth and light sensors to scan a key and compare it to a lock in real time. It applies mathematical concepts like logarithms and summation notation and trigonometry, along with algorithms such as binary search to detect key pattern peaks and determine a match. If the key does not match, the system alerts users through a live feed that updates every 3 seconds and allows them to report suspicious activity. All data is continuously stored and retrieved from MongoDB to support real time updates and logging.

How we built it

We built the frontend using vanilla HTML, CSS, and JavaScript, along with Chart.js for data visualization and Leaflet.js for mapping. The Arduino code was written in C++ to process sensor data. A major part of our system relied on MongoDB, which we used as a central database to store logs, sensor outputs, user reports, and images. We converted images into base64 format to efficiently store and retrieve them directly from the database, allowing seamless integration with our live feed and dashboard.

Challenges we ran into

One major challenge was sending Arduino data to MongoDB in real time and ensuring it stayed consistent. To solve this, we built a continuously running subprocess called an Arduino logger that pushes updates to MongoDB every 3 seconds. We also had to carefully structure our database to handle frequent writes, image storage, and fast queries for the live dashboard. Another challenge was creating accurate matching algorithms from scratch without relying on external libraries.

Accomplishments that we're proud of

We are proud of building a system that achieves real time updates powered by MongoDB, allowing data to flow smoothly from hardware to the web interface. We successfully stored and rendered images using base64 encoding and created a responsive dashboard backed entirely by our database. We also developed custom algorithms using advanced math to detect key and lock compatibility, and integrated the Gemini API to help predict potential security threats.

What we learned

We learned how to fully utilize MongoDB beyond basic storage, including handling high frequency updates, structuring collections for performance, and storing complex data types like images. We also learned how to connect Arduino hardware to a web-based system, and how to visualize real time data using charts and maps.

What's next for LockWatch

Next, we want to further optimize our MongoDB usage for scalability and faster queries as the system grows. We also plan to refine the physical Arduino setup into a more polished product and improve the accuracy and consistency of our matching algorithms for real world deployment.

Built With

Share this project:

Updates