As an IoT project designed for the MEGR 3171 Instrumentation class, we've chosen to go with the idea of designing a simple home security system using three Particle Photons, an HC-SR04 ultrasonic sensor and the IFTTT app.
This system would operate as follows: The Photon with a sensor attached to it is placed against the wall behind the main door of the home, and is activated along with its components. As the door opens, it would normally swing towards the Photon, enabling the sensor to detect the close proximity of the opened door. Photon one would then publish an event that would be picked up by Photon 2, which would then forward it to Photon 3. Each of the three Photons is linked with the IFTTT app, which sends a notification to the Photon handler's phone when this intrusion is detected.
This project could in theory be made with a single Photon, but a project requirement was to display that every Photon is able to communicate with the other two Photons involved. To achieve this, a white LED was attached to each Photon's breadboard, as it would be activated along with the built in blue D7 LED according to the following order:
Photon 1: published event lights Blue LED on Photon 2 + White LED on Photon 3.
Photon 2: Published event lights Blue LED on Photon 3 + White LED on Photon 1.
Photon 3: Published event lights Blue LED on Photon 1 + White LED on Photon 2.
This would in terms satisfy the requirement of three-way communication across all involved devices. Pictures of the three Photons can be seen below:
The "Response" part of the project was done by utilizing the IFTTT app. Each one of the three handlers (Ayoub, Tim, and I) have connected our Photon's events with the built in IFTTT notification system, so that our phones would tell us whenever an Intrusion was detected.
Google Sheets was also connected using the IFTTT app to Photon 1, so that a row of data displaying the published event and time of publication would be added every time an intrusion was detected to keep track of all times of intrusions. This log can be accessed here:
The configuration the IFTTT applets used in this project are shown below, where each user has his own notifications connected to his Photon's event, in addition to the Google Spreadsheets log being connected to Photon 1.
The code for the project is provided below, as well as schematics, pictures and a video demonstrating the operation of the security system. We hope you enjoy!
Project Demonstration: https://www.youtube.com/watch?v=UW1cnpVj6-E&feature=youtu.be
(Note: Copy and Paste the Youtube link in your browser search bar if the hyperlink isn't working.)