Inspiration

As college students living in the dorms, we noticed that the technology was not as current or up to date as many smart home security systems that currently exist and that are prominent in our communities. We thought it would be cool if we were able to add our own "smart" security system to student living. Additionally, we saw some cool videos online of students across the country automating processes in their dorm rooms, such as wireless locks and automated window blinds, and we thought it would be interesting and challenging to build on those ideas.

What it does

When an individual enters a room and triggers the motion sensor, the Raspberry Pi Pico W will send a message to the host computer via MQTT over the local network. This then triggers a webcam and runs a facial recognition software that checks if the person entering the room is "authorized" or not. If the program detects an individual it doesn't recognize, it will send an alert to the user's cell phone using the Telegram messaging app with the message "INTRUDER DETECTED" as well as an image of the person in the room. If the user is "authorized", nothing will happen. If no faces are detected after the motion sensor is triggered, the user will still receive a message and a photo on Telegram. Furthermore, the user can "arm" and "disarm" the system using Telegram app, that way the system can be disabled if there is a guest in the room.

How we built it

We used a Raspberry Pi Pico W microcontroller connected to a PIR motion sensor to detect any initial disturbances. The Raspberry Pi would then send an MQTT message over the local network to the host computer, which would receive this message via a Python script. The Python script would then use OpenCV to access the webcam and the face-recognition python package to compare the webcam image to an image of the authorized user. After 5 seconds of analysis, a conclusion will be drawn about whether the intruder is authorized or not. Messages are sent using the python-telegram-bot package, which allows us to access the Telegram Bot API using Python. This package also allows us to recieve and respond to arm and disarm messages sent by the user.

Challenges we ran into

Getting the facial recognition to work reliably proved to be extremely challenging. One team member spent ~6 hours trying to make it work with OpenCV, but it just wasn't reliable until we switched to using the face-recognition package. Furthermore, we encountered some challenges with sending MQTT messages over the local network due to administrative network restrictions that are in place.

Accomplishments that we're proud of

We are proud that we were able get all of the components of our project integrated successfully into a working home security prototype. Furthermore, we are especially happy that the facial recognition eventually worked since this was the part of the project that took the longest to complete.

What we learned

We learned how to use and write MicroPython for a Raspberry Pi Pico W, along with sharpening our Python skills and learning how to integrate packages we've never used before into a working script. We also learned some network basics for using MQTT over the local network.

What's next for IntruderID

This system could be improved using a more reliable sensor along with a night vision camera, as this would allow intruders to be detected even with no light in the room. Furthermore, we could create a professional and aesthetic housing for the motion detector and webcam setup.

Built With

Share this project:

Updates