What it does
Our project idea is a IoT enabled Motion sensor that allows you to see if there was any night activity in the vicinity.
Senses motion with PIR and sends the report back to IoT channel like a home security sensor.
The other sensor will be a light sensor that senses if it's daylight or not. It will not be active during daytime.
See if there was an intruder overnight by checking the wifi channel!
Arduino, PIR, Photoresistor, WIFI library
Sangeun Lee, in charge of PIR sensor
Sophia Ye, in charge of photoresistor sensor
Angela Lin, in charge of IoT
INTRO TO MOTION SENSOR:
DEMO OF MOTION SENSOR:
Final Write Up
A description of what the idea is and why you chose it
Our project is a daylight sensitive motion sensor that lights up when it detects motion in the night. In order for the LED to light up two criteria must be met: the motion sensor must sense motion and the photoresistor must not see light to light up. If it does see light, the motion sensor will not be active. We chose this idea because we were interested in working with a PIR sensor and also exploring other types of sensors. Motion sensor was one of the interesting sensors we decided to explore. We were also interested in creating a smart device that could be impactful in someone’s life. Given the way our two sensors work in tandem, we see our project having applications as an energy-saving smart night-light (only emitting light when necessary, that is, when a person walks by).
Explain how you iterated on the project throughout April
4/09: After an initial discussion and brainstorming session, we proposed the idea on devpost.
4/17: We began to build our project. We first set up on the MKR1000 to use with Blynk as well as the circuits that connected the motion sensor and the photoresistor. We also programmed in the logic we wanted our device to display. The motion sensor worked, but the photoresistor did not. In addition, our motion sensor was not as sensitive to certain motions, having sporadic performances. We checked in with our TA and explained where we were in the process.
4/23: We finished up our project, switching out the MKR1000 for the Arduino Uno WiFi instead because we were more familiar with it. We also fine-tuned the sensitivity of our motion sensor and improved its precision. The motion sensor and the photoresistor both worked. We demoed to our TA and added a demo video to Piazza.
Seperate each subsystem of the project and explain in detail how you implemented it. If it is hardware, please explain the wiring and how components work together. If it is code, please explain how the logic works.
Our project consists of 3 main components: a photoresistor circuit, a PIR sensor circuit, and an LED circuit. Each component circuit is connected to 5V (power) and Ground and has a resistor next to it (connected in series). All the components are also connected to a certain pin in the Arduino board so that we can program certain behavior associated with our inputs and outputs. The PIR sensor input pin was 2. The photoresistor input was an analog input pin A2 and the output pin for the LED was pin 13. Our PIR sensor and photoresistor were inputs and our LED light was our output. In terms of the code, when the the PIR sensor detected HIGH (i.e when there was motion) and when the photoresistor resistance was above a certain threshold, i.e. 1000 (indicating darkness), we programmed output LED to then become HIGH. When the PIR sensor sensed motion and the photoresistor resistance was below a certain threshold (indicating light), we programmed the output to be LOW. Our LED output was a digital output while our PIR sensor was a digital input and our photoresistor was an analog input. In terms of our IoT portion, we connected to a custom channel on ThingSpeak with an API key. Through our API, we were able to visualize the motion sensor data in a time-motion graph, which tells us the frequency of movement sensed by our PIR each time the channel is updated.
How this project could be turned into a real product (if applicable)
This project could be turned into a real product to be used in home security and energy efficiency improvements. Because a light is usually not needed when it is bright outside, the fact that our “lamp” only lights up when the photoresistor light input reaches a certain threshold (meaning that there is not much light in the current environment) means that our project helps to conserve energy and save people the trouble of remembering to turn the light on and off. The IoT component of our project also allows users to track motion throughout the night to verify if there is any suspicious activity or security concerns.
Any possible improvements you could make
For future improvements, we can calibrate the distance and sensitivity of the motion sensor so that the light does not turn on too often (which would happen if the sensor is overly sensitive) or too infrequently (which would happen if the sensor is not sensitive enough). This would also help us pinpoint exactly how long we want the light to stay on after motion is detected, which would help us better conserve energy depending on the size of space the motion sensor is in. In addition, we could use a larger lamp instead of an LED so that the light is brighter and more useful to passersby. We could also use a different motion sensor that provides more precise measurements about proximity to the sensor and how much movement was detected - this would be much more helpful than the current binary output of the PIR sensor. If possible, we could also pair our light and sensor with a security camera so that our product could help people see what is happening when their sensor detects motion in the middle of the night.