Have you ever wanted to transform your bathroom lights to a motion or sound-activated light where you will never have to touch the light switch again? Maybe not, but it might sound appealing now that I mention the idea. We have created a project to detect motion or sound and turn on a light for a specific time based on how long you want it to be on. This will make going to the bathroom an effortless experience where you do not have to worry about turning the lights on or off. Having automated lights in your house may be unthinkable, but now it's possible.
SensorsThis project consists of a sound sensor, motion sensor, and a LED light.
Sound sensor: The sound sensor sends a signal to the Particle Photon 2 every time it detects sound. Based on the code that we developed, the sound sensor must detect a certain level of sound, then it will send an event to the particle cloud that other devices can subscribe to. We set this sensor to only detect a high level of noise because we were in a loud enviorment when building the ciruit, this can be changed based on your enviorment.
Motion sensor: The motion sensor works very similarly to the sound sensor. When motion is detected, the motion sensor sends a signal to the Particle Photon 2. The code we have developed will send an event to the particle cloud every time a certain level of motion is detected. We set this sensor to read a very low amount of motion since it will only detect motion within a few feet. This can also be changed based on your enviorment.
LED Light: The LED light is connected light up every time it receives a signal from its Particle Photon 2. The light will then stay on for a specified amount of time based on its code. The code allows the Particle Photon 2 to subscribe to the events that the sound and motion sensor create. After subscribing to the events, the code specifies what the LED light will do after that event is detected. In this case the LED light will stay on for 5 seconds after the sound or motion event is detected. The short time was for demonstration purposes, in reality the LED light could stay on for any amount of time after sound or motion is detected based on the enviorment of the room.
The graphs made in Adafruit simily show each time the respective sensor detected a signal or turned on the light. This is shown simpily in the graph because the sound sensor will go on and stay on for a few seconds at a time, this is due to a constant noise such as someone speaking. The motion sensor graph then only shows motion for a short amount of time, this is because it quickly detects the motion and we were not moving much when the graph was being created. The LED light is on for 5+ seconds each time because the light will stay on for 5 seconds after the last sound or motion was made.
Comments