Snack security is a modern day solution to an age old problem, snack thieves. We set out to put a stop to these thieves by creating a system that could catch any snack snatcher red-handed.
We all have unwanted visitors trying to raid our snacks. This could range from your children trying to steal a midnight snack to a drunken friend in your apartment trying to satisfy their hunger. Don't be caught unprepared! The general idea is that when you are done in your pantry/cabinet/snack-space ect. you activate the security system using a switch. This switch activates a PIR motion sensor within your snack-space, which will trigger upon intruders breaching the snack stash.
Once the sensor is triggered, a signal is sent to a Raspberry Pi via GPIO pins and is interpreted by a python script in order to take a picture using the installed camera observing your cabinet.
This photo is then sent to you via email using a shell command and the ssmtp package. The system is programmed to send you a picture every 5 seconds until the PIR sensor is no longer picking up movement. Confirmation of the picture has been sent is shown via live updates to a graph in Google Drive which is controlled by an IFTTT recipe:
What you decide to do with this unquestionable evidence is completely up to you, we just want you to be prepared for the worst, and trust us, we know snack thieves are the worst.
Setup instructions:On the Raspberry Pi, install a fresh image of Rasbian Jesse. After initial boot enter terminal and enter the following commands "sudo apt-get update
", "sudo apt-get upgrade
", "apt-get install ssmtp
" and "apt-get install fswebcam
". For setup information about these two tools, two links here should help: https://www.raspberrypi.org/documentation/usage/webcams/ & http://www.raspberry-projects.com/pi/software_utilities/email/ssmtp-to-send-emails
Once these utilities are configured, create a new python 3 sketch in the default directory and add the code provided. In order to run the security system, this program may be executed in terminal or launcher.
On sensor photon, from the patricle.io ide, upload the code listed with your unique publish key. Then configure the circuit as shown. On the receiver/raspberry pi control photon, upload the code provided with the same unique publish key, and then a second unique publish key to communicate with IFTTT.
In order to setup IFTTT to communicate that pictures have been sent and graph them on Google Drive, the recipe should be as follows. This should be set to Particle publish received and that should be set to add workbook entry in Google Drive. The workbook columns containing the date and time and the information about the picture being sent should be plotted against each other in order to produce a live updating graph of when the webcam is being triggered.
Comments