According to a 2016 survey, 8% of college students have reported to have had their drinks spiked and almost 80% of them were female. Las Vegas, my home and community, is a city known for its nightlife and entertainment. There are fun activities, restaurants and bars available and open 24/7, but they can become a breeding ground for illicit activities.
As a solution to this problem, we've come up with a device that will act as a smart lid for the drink and alert the owner if it has been tampered with. We hope that bars and restaurants can provide their customers with this device in order to reduce incidents of spiked drinks.
I managed the software development of this project, and was tasked to program the Arduino and and build the IOS app.
For this project, we wanted to create a minimal viable product that could collect, display, and act on data. We chose to use an Arduino Nano 33 IOT module due to the onboard sensors and Bluetooth® Low Energy capabilities it has to send data to a cellphone.
From a high level, the Cup Protector samples its onboard accelerometer and determines if the acceleration magnitude indicates a spike attempt.
The Cup Protector detects if a lid has been taken off of a cup by analyzing acceleration values in the x, y, and z dimensions. More specifically, the magnitude of all three acceleration vectors was determined and used as the primary detection value.
I used the embedded LED on the module as a spike attempt indicator. Afterwards, Bluetooth was enabled on the Arduino to control the onboard LED via the IOS mobile app I developed. Then after connecting more external modules, additional logic was added to create an actual alarm-like system with buzzers and lights.
One thing we noticed while detecting movement was the amount noise we were collecting. It made it hard to detect whether or not the movement that was detected was a real spike attempt, or just a table bump. In other words, it was hard to isolate false-positives. We plan to characterize this noise and implement a Fourier transform to isolate it. The Arduino Nano IOT has sufficient compute capability for the Fourier transform to run in real-time.
I built an app to act as a simple remote for the Cup Protector as well as a centralized hub for receiving alerts and controlling the device. Initially, I looked into using MIT App Inventor because of how quick and easy it is to design and build an app with declarative programming. Unfortunately, it did not support Bluetooth Low Energy and I had to find another solution. I ended up developing the app with Swift. Using Swift, I was still able to design first and then add all the logic afterwards.
Enabling the connection between the app and the Arduino module proved to be the most difficult part. Understanding how BLE worked was fundamental in the process of making sure all the necessary data was fed through properly and that all connections were working.
The app is able to:
Our app is only available for IOS which is not practical or ideal. In the future, I would like to deploy a web application that would be available to any device. Ideally, it would not have to be installed on the device prior to use, but instead accessed through a QR code and has the same capabilities to control the device.