Too often packages (e.g. Amazon) on front doors are stolen by thieves, and there hasn't been an effective solution to prevent this from happening.

What it does

My idea is to have an all-in-1 system camera that can identify when someone is approaching near your house uninvitedly. When detecting an intruder, it will automatically sound an alarm system and scare the intruder away before they could even get near the front porch. Whilst doing so, the camera will also automatically record footage of the intruder, and send it up to a public website where any neighbors can view who the person was and take precautions of their own.

How I built it

There are 3 main parts to this project, the webcam, the alarm system, and the website. Everything runs on local servers and must be connected to the same network in order to work correctly.

  1. The webcam is built with React, TensorflowJs, and Firebase. React is the underlying structure of this web application. It is a front-end framework that allows the webcam to stream/record directly from a browser. TensorflowJs is the machine learning part that does all the object tracking of people, and it is lightweight and meant for usage in browsers. Firebase is only used during the recording process. When a recording is finished, it is uploaded to Firebase storage, where it can be viewed later by URL.

  2. The alarm system is built from a Raspberry Pi which will provide all the GPIO and audio systems for an alarm. The speaker is connected via an audio jack while the GPIO pin is connected to a relay which can be used to control anything such as a 120v light bulb. The speaker I used was built from my most recent course at OSU called ENGR 202, which is about AC circuits and filter design, and it is a cross-over audio amplifier which takes in an AC audio signal and splits it up into 3 output signals, the low, mid, and high frequencies. In this project, I only output sounds in the mid-range. In regards to software, it is built with node.js and express to act as a server which the webcam and the website can both talk to via HTTP requests. It provides 2 types of endpoints, 1 for enabling/disabling the alarm, and 1 for triggering the alarm. When the alarm is triggered, the speaker will make a loud siren noise while the relay will flicker on and off, to flash something like a light bulb at the intruder.

  3. The website is built with React and Firebase. React is the underlying structure of this web application and provides complex control of the website instead of plain Html and javascript. It is the site that anyone can go to view other neighbors' videos of suspicious activities and/or thievery. The website retrieves all videos uploads from Firebase storage and displays them in an arrayed list, sorted from newest to old. There is also a toggle switch to enable or disable the alarm system as well as live video stream which users can access.

Challenges I ran into

I haven't worked with React and Firebase on websites before, nor have I worked with the Raspberry Pi. However, I had skills with node.js and Firebase in Android apps, that it became fairly straightforward. When I was building the alarm system with the Raspberry Pi, I figured I could utilize some npm packages with some API endpoints I could call so that I don't have to deal with all the interfaces with the audio and GPIO systems onboard. In regards, to Firebase, I'd just learned how to use it inside of an Android app a couple of days earlier, and I figured it might be cool to use it again for this hackathon project. It wasn't very easy especially since I was new to react, but once I understood the pattern of the structure, I was able to understand what the Firebase documentation was saying.

Accomplishments that I'm proud of and What I learned

I'm pretty excited that I learned a lot of new things like React and Firebase on websites. I've played around with React a long time ago, but I'd never applied it towards anything. Now I got to use it for something cool and polish the design with some nice CSS styling. I'm also pretty excited to use Firebase for this project because I'd just learned it a couple of days ago for Android apps, and I figured it'd be a great learning experience to apply it towards this project.

What's next for Neighborhood Watch

I might add Firebase login or Amazon Cognito login so that users can actually be authenticated before viewing content on the public website. Also, I can then associate specific content with the user, and start getting involved with databases. I also could host this whole platform on a public domain so that this project doesn't have to work on a local network either, and can be viewed anywhere in the world.

Share this project: