Technical information - dinanjana/CO321-Project-IoT_Project GitHub Wiki
Techincal information
This project aims to provide the bare-minimum security and safety REQUIREMENTS for a household with the help of micro-controllers. At the core of the device sits a Raspberry pi and an Arduino board, both contributing separately towards the functionality of the device.
The device provides two services:
- Household Security
- Household Safety The following flow diagram outlines the functionality of the device.
Household Security[edit] The basic and expected REQUIREMENT from every home security system is to prevent intruders from entering the home environment. Our device’s top priority is intruder detection and this section explains in detail the steps taken to implement this feature.
Design The intruder detection system is built around a standard web camera. Motion detection has been integrated into the system with the help of software programming. Any abnormalities will,
- Activate the web camera to capture a still image
- Upload the captured image to a google drive account
- Trigger the security alerting system. #Hardware and Software
- Raspberry-pi single board computer
- Standard web camera
- Python programming
- OpenCV libraries
- pyDrive library
- Implementation Motion detection:
Capturing the webcam stream - This feature is already integrated into OpenCV. OpenCV offers the possibility of subtracting two images to obtain a differential image. This feature (known as differential imaging) was used to detect motion. The final step was to integrate the differential image function to the script from step 1. If the system identifies the presence of an intruder, the security alerting system (detailed in section 5) is triggered.
Google drive image upload:
The pyDrive wrapper library that simplifies many common Google Drive API tasks was used for this purpose. The upload and authentication process is greatly simplified by pyDrive. The very first google drive access will REQUIRE manual authentication. The device will then store tokens that can be used for future authentications, automating the entire process. Household Safety[edit] A secure home, does not necessarily translate to a safe home environment. Faults from within, could potentially cause severe damage to a household. The safety service provided by this device aims to address this issue, and this section explains in detail the design procedures followed to implement this feature.
Design The household safety system monitor key parameters that could potentially pose a risk to the health of the house. The system has a gas sensor and a temperature sensor built into it. By processing the input received from these sensors, the system determines if the house is at risk. If it is, the security alerting mechanism is immediately called upon.
Hardware and Software Arduino Board MQ2 Gas Sensor - sensitive to flammable and combustible gases LM35 Temperature sensor Arduino programming Implementation The MQ series of gas sensors use a small heater inside with an electro-chemical sensor. They are sensitive to a range of gases and are used indoors at ROOMtemperature. This specific sensor (the MQ2) is sensitive to flammable and combustible gasses.
Both sensors output analog data. The raw data is received by the arduino board and then converted into digital form. The arduino is CONNECTED to the raspberry pi through a serial USB CONNECTION. This allows the sensor readings to be transmitted to the raspberry pi, where all the processing and decision making takes place. If the values read by each sensor exceeds a specified upper-bound, it is classified as a risk and the alerting mechanism is triggered.