Inspiration
We wanted a simple, fail-safe way to deter unauthorized access to a box/door (e.g., dorm storage, lab cabinet, shared equipment). If the system can’t confidently verify the authorized user, it should default to “deny” and alert.
What it does
SafeLock is a real-time safety guard:
- A Raspberry Pi sensor detects a potential open/access event (light-based trigger in our demo).
- The Pi requests a quick face verification from an auth server (laptop webcam + Gemini vision).
- The system returns a strict true/false decision:
- AUTH_SUCCESS → buzzer stays off
- AUTH_FAIL (unknown / not logged in / unsure) → buzzer alarm
- It’s designed to fail safe: when in doubt, it alerts.
How we built it
- Python for both server + device logic.
- OpenCV to capture and encode webcam images.
- Gemini API (google-genai) to compare the authorized reference photo vs the live photo and output JSON.
- TCP sockets for Pi ↔ laptop communication.
- GPIO on the Raspberry Pi to read the sensor and drive the buzzer.
Challenges
- Rate limits and reliability: added retry/backoff and stricter decisions (only approve when confidence is high).
- Real-time behavior: making sure the loop is responsive without spamming API calls.
- Networking and setup: ensuring the Pi and server communicate reliably on the same network.
What we learned
- Building a clean “sense → verify → act” pipeline with a fail-safe default.
- Integrating hardware triggers with networked AI verification.
- Debugging real-time loops and socket communication under hackathon time pressure.
Built With
- arch
- gemini-api-(google-genai)
- gpio
- opencv
- python
- python-dotenv
- raspberry-pi
- tcp-sockets
Log in or sign up for Devpost to join the conversation.