During our enrollment in a measurement and instrumentation course at UNC Charlotte, we were required to create an IOT project which would be developed throughout the semester. The criteria for the project was the number of group members must be equal to the number of particle photons used in the project. Also, for every group member a line of cloud communication between one photon and another had to be established. These lines of communication were to be integrated into the functionality of the project. Our group consisted of three members which meant we were required to have three photons communicating with one another. We spent weeks bouncing ideas around while tinkering with the photons and sensors included in our makers kit's we had bought at the beginning of the semester. We developed an array of tentative project ideas, however, the project we ended up creating seemed to arise in very organic way.
As the end of the semester was approaching Keaton and I had created multiple single function systems including; a light sensor using a photo resistor, a motion detection system using a PIR sensor, an alert screen using an OLED display, a servo controller app, and multiple bits of code which allowed photons to communicate through the particle cloud.
During this time a particle relay board became part of the tools at our disposal. The project solidified itself as an expandable smart relay board which for demonstration purposes, would be configured as an automated night light and low tech home security system. This was achieved by allowing a single photon to be designated as the "master" controller of the relay board. Subscribing this photon to published events, uploaded by the other two devices, we were able to automate and control the channels of the relay using three way communication between all of our devices. One photon determined the light intensity within a room and the other motion. The LED light wired to the relay board was then triggered on an off without the need for a manual switch, using conditional loops which compared the light and motion sensory data published by the other two photons.
The conditional loop which controls the relay switch are based on events published to the particle cloud by the photon's connected to the photo resistor and PIR sensor. The photon connected to the relay board is subscribed to these published events and uses the conditions listed below to determine what state the relay should be set to.
For the relay to be activated, "LED lights are on"
Condition 1 - The light intensity value measured by the photo resistor connected to photon 1 must less than 55, " This value of 55 indicates that the current lighting condition of the space reflect a dark room"
Condition 2 - A sufficient amount of infrared (IR) light radiating from objects in the PIR sensor its field of view, connected to photon two, must be achieved indicating that there is motion in the room.
If both of thee conditions are met then the photon controlling the relay board will send a digital signal of "HIGH" to the D5 pin, which will close the relay and supply power to the connected LED lighting strip.
For the relay to be deactivated "LED lights are off"
If either one of the conditions above are not met, ie: the room already has enough natural lighting, from windows or other appliances, or if there is no motion detected in the room for a duration of time when the room is dark. The photon connected to the relay board will send a digital signal value of "LOW" to the D5 pin, effectively closing the relay and the LED strip connected to it.
The photon connected to the PIR sensor for this project is also set up to function as a low tech security solution. Published events from this photon, indicating whether a space is occupied or not, were configured using a web-hook and ThingSpeak.com. This web-hook provides a live stream of events which generate a daily log of events indicating what times during the day a given room was occupied.
The biggest issue we ran into while creating this project was developing the code and determining the best method of passing data from one photon to another to achieve hands free control of the relay board. We hope our page provides a foundation of resources for others who wish to create cheap, customizable, and adaptable home automation systems.
Comments
Please log in or sign up to comment.