Inspiration
With a large number of mass shootings occurring in the US every year and an increased outcry against the lack of gun legislation, our team was inspired to create a more bipartisan solution to the gun issue. While considering how to tackle this issue, we realized that stolen guns contribute massively to this issue since most gun crime is not committed by the owner of the gun itself. Another interesting statistic we found was that a large percentage of shootings go unreported to authorities, making it harder to narrow down criminals and collect evidence on the crime scenes. To address these issues, we wanted to create a smart gun that passively verifies that the owner is holding the gun, alerting the authorities if the verification does not match, and reports gunshots to the authorities with a precise location, allowing for faster response times. An add-on like this has multiple purposes, ranging from tracking illegal gun crime to giving fast and easy alerts to authorities in times of self-defense.
What it does
The ShotAlert device uses a combination of various sensors such as a fingerprint and pressure sensor to verify the identity of the gun holder. On first use, the owner can enroll their fingerprint with the sensor on the gun. Every other use, if the pressure sensor detects someone is holding the gun, it will give a limited amount of time for them to put the right fingerprint on the sensor. If the identity is not verified in time, the owner will be notified by SMS that someone is holding their gun and has not verified their identity. The owner then has the choice to deactivate the alert function to the authorities on the website if they are aware someone is using their gun. If not, the gun will be reported stolen to authorities with the exact longitude and latitude pulled from the GPS sensor on the gun. Additionally, the sound sensor on the gun is used to detect a spike in the decibel level to determine when the gun is shot. This gunshot is reported to authorities with a precise location.
On the front-end, the user can view the gunshots near their region. They can also choose to log in as a gun owner or part of the authority. If the user logs in as a gun owner, they can add a gun and track its last known location and any activity with it. They also provide personal information such as their name and phone number so that they can stay notified about any activity. Additionally, the owner can deactivate the alert function for the gun on the website if they are aware someone else will be using it. On the authority's side, the user can view a written log and a map of all gunshots and stolen guns, with different color markers indicating different types of activity. They can also click on each marker to get more information about the activity such as owner and phone number.
How we built it
In order to execute our idea effectively, our group delegated the hardware and software portions of the project to ensure that every aspect of the process worked seamlessly with each other and contributed to the quality of the program as a whole. We wired a pressure sensor, GPS sensor, fingerprint sensor and acoustic sensor to an Arduino Uno. After ensuring that the sensors were processing the data correctly, we programmed an algorithm in C++ for gunshot detection based on the acoustic sensor, sending other sensor data as well. We then mounted the Arduino onto a model handgun, positioning each sensor so that the user could correctly interact with it upon holding the gun.
In order to most efficiently funnel the data to the client-side code, we created a Python application that read the data from the Arduino via the serial port. Depending on what type of incident was detected (gunshot or stolen gun), data such as the current time, location of the incident, and information about the gun owner are sent to different branches of the Firebase database. We then created the client-side code using HTML, CSS, and Javascript, programming an authentication page that would redirect the user to a public view, gun owner view, or authority view depending on what type of user they are registered as. The information would be received by the front-end through the Firebase, and an interactive map built through the Google Maps API as well as a log of recent incidents would be live updated.
Challenges we ran into
There were certain obstacles encountered during both the hardware and software phase of project creation. In many instances, the wiring of the hardware presented issues, often disconnecting from the Arduino due to a lack of permanent wire connections. The acoustic sensor, in particular, was unreliable, often reading incorrect or inconsistent values even when presented with an environment with an unchanging noise-level. In addition, we found that interfacing the Python with the Arduino code was inefficient and often lagged behind the raw data being streamed in from the Arduino itself.
Accomplishments that we're proud of
Our team is proud of the combination of hardware used in the project and how simple and informative the front-end for the project looks. We are also extremely happy that we were able to complete the project in the time given.
What we learned
We gained a more in-depth knowledge of how to efficiently and effectively interface the hardware with the client-side program. Our group also learned more about live-updating functionalities and various user-interface display options that could best represent the information being fed to the program. We also learned about optimizing programs for efficiency and updating the database so that the least time could be wasted.
What's next for ShotAlert
We plan to make the hardware attachments on the gun more seamless with better wiring and a custom grip. Using PCBs or smaller microcontrollers such as an Arduino Nano, we also want to make the attachment smaller as a whole so it can be used for more realistic purposes. Also, we want to add more functionality to the front-end such as tracking crime data in different areas based on the frequency of stolen guns and gunshots.
Built With
- adafruit
- arduino
- c++
- css
- firebasedb
- google-maps
- html
- javascript
- pyserial
- python
- tinygps
- twilio
Log in or sign up for Devpost to join the conversation.