This project was completed for our MEGR 3171 class and we had to use two Particle Photons to solve an instrumentation related task. These Photons communicate with one another via Publish and Subscribe.
OverviewWhen people decide to leave their house, it is very common to leave a light on inside, so it appears that someone may be home. This project reduces the number of steps to turn the main lights in a room off, turn your TV off, and turn on a small light so your house isn't completely dark. A photoresistor in our circuit monitors the amount of light in the room, and uses this reading to know when to send a signal. As soon as the main lights are turned off, a signal is sent through two Particle Photons to power off a TV in use (or another device if chosen to wire differently), and turn on a small light in the room, all by one flip of a switch.
A photoresistor reading is the variable in our project and this value determines when the first photon will send a high or low signal. Our photoresistor is monitoring the light in the room, and as this reading from the photoresistor drops below our set threshold value in the Particle.io code, a signal is sent from the first of two Particle Photons to complete the circuit via relay in order to power on the small light. Using the publish and subscribe functions in Particle.io, when a signal is sent from the first Photon, the second Photon reads that signal, sends a signal to break the circuit via relay (in a 2 second delay), and then powers off our TV that was presumably in use. When the main lights are turned back on in the room, this system works the other way as well. The small light turns off and the TV is powered back on in a 2 second delay for the reading to be made and the Particles to complete the publish and subscribe functions.
VideoDetailsThe first circuit using Photon #1 is constructed using a Particle Photon and components from their Photon Kit including the Photon, mini breadboard, 221 ohm resistor, and photoresistor. A basic relay ordered separately is also required to connect with the small lamp cord for power. 3 wires from relay pins are connected to GND, 3V3, and D0 pins from the Photon, while the photoresistor is connected to A0 and A4, and the resistor is connected to A0 and GND. The pin connection layout can be found in Photon 1 Diagram.
The second circuit using Photon #2 is a little simpler and only utilizes a Particle Photon and basic relay. The two particles communicate via Publish and Subscribe which can be seen in the code below. 3 wires are used from the relay pins and connected again to GND, 3V3, and D0. The pin layout for this circuit can also be seen in Photon 2 Diagram.
Comments