Watching out for you to protect you: Group 5
Being able to check on the security of your home, family members and belongings while away and in various locations around the world is needed to ensure safety and peace of mind. The camera is an overly used component device used nowadays to capture any abnormalities or intruders, but recently radio signals, voice and also heat has been used to complement or replace the camera. For this project, our group will need to create a simple, low-effective home security system with the camera not being the center of it.
Sensors and also wireless shields will be used to detect movements and the presence of unwanted visitors at a distance through a website or phone app.
26th November
Objective
The aim of the product that we will be working on during a three-week period is a low-effective home security system to ensure the safety of belongings, family or the home. The product will be completed through a variety of functions to detect any unwanted movement and to tell the user in various locations around the world. Furthermore, the primary purpose of the product is to make the user feel safe enough to leave any valuable items alone, with the knowledge that they would be informed if anything was to happen.
Purpose
The purpose of our security system is to ensure our user’s confidence in using our product. The system will need to be effective in detecting any persons through its functionalities. The aim is to create a stress-free security system where users can be away from home but will still be in control of the safety of their home.
Target Audience
The target audience that we decided to focus on were adults of whom own their own home and whom own expensive pieces of art or objects. We chose this audience as they are the most likely target to need a security system to protect these valuable goods. As we aim to make movements detected accessible through a website/app or text, the target audience can be contacted away from home.
Market Research
Before coming up with initial ideas for the project, market research was needed to establish what security systems already exist in today’s market. From research we found that burglar alarms are
Brainstorming Solutions
During the first stages of creating a project, mind maps were used to brainstorm ideas. This enabled us to broadly look into the task at hand and to clarify the objectives of the task. Through this first mind map a better understanding of the project was made, and so the first stage of brainstorming was complete.
A second mind map considering the target audience meant that focusing on a particular audience into their wants and needs allowed us to focus the design on these needs. The purpose of our project would now become clearer and designing the project became easier.
Initial Ideas
After the basic brainstorming of the task at hand, creating initial ideas for the project came second. Through research and from our own ideas, four main ideas were made.
The first idea was to use microphones, to detect any unwanted sound (also associated with movement) around an object needed to be kept safe. This idea would then need a reaction after the detection.
The second idea revolved around the idea of using infra-red sensors. These sensors detect the heat of an object, as well as motion. An advantage of an infra-red sensors is that it detects any small movement, and is highly reliable, however this could also be a disadvantage if used in a home due to animals or post or small movements not unwanted.
The third idea is to use a security alarm with a motion sensor. This idea is old school, and many people already has these implemented into the home, however it is effective.
The last idea was to include light with a sensor to ‘scare’ off unwanted movements. The light would turn on once movement is detected. This is a good idea, however it would let the intruder know it had been detected before the user was made aware.
It had come to the conclusion that we wanted the user to be made aware before the intruder was aware that they’d been detected.
30th November
During the second meeting, the group developed our design using a storyboard. A storyboard is an enabler to show how a product should work in a scenario. The scenario of our project is of the gallerist Mister Ropac. His portrait by the artist Jean-Michel Basquiat,has been left in the Barbican. Mister Ropac has the fear that it may not be safe in this gallery as it is a popular painting. Therefore he installs the Sensor/SMS device made by our group. Mister Ropac can feel calm and collected knowing that the painting is being monitored.
As a group we also used the ‘cake’ method to analyse the target audience further. This method takes a simple design – the cupcake – and transforms it into a perfect idea – the wedding cake.
The initial idea was to have one sensor, using a wireless shield to send an email to the user detecting an intruder. This is good, however the user may be too busy to receive the email and to do anything about it.
The developed idea meant that we wanted to include more than one sensor to monitor a wider view. This way it would make it more difficult for an intruder to enter. The idea to include an alarm was also included in order to scare off thieves, whilst the message would be sent to the police, rather than the user if the user was away on holiday.
The finial idea was to include an accelerometer, attaching it to an object needing protection (a painting) and detecting movement. The accelerometer detects the acceleration of its own body. Therefore if an accelerometer were to be moved by an unwanted person it would detect the movement of itself. The idea would thereby be that once movement is detected, an SMS would be sent rather than an email. This can access the users faster and is more accessible to the majority of our target audience.
4th December
Low-fi prototype
To create our low-fi prototype we first tested the PIR motion sensor with simple coding. The coding meant that the serial monitor would check whether the PIR motion sensor detected any movement, and the serial monitor would thereby output whether an intruder had been detected or not. The code that we used is shown below:
8th December – 12th December
Design Developments
After our low-fi prototype we decided to experiment more with the reaction of the PIR sensor including a LED light. When the motion sensor sensed movement the LED light would light up, and when the movement stopped the LED light would switch off.
After, we introduced more code. We added time to calibrate the sensor, and more interaction with the serial monitor. This meant that when the sensor would sense any movement, it only prints once for when the motion is detected and for when the motion is stopped. Moreover, we added another tweak so if the sensor does not detect motion for longer that 10 seconds it will print “motion ended” and the time at which the motion finished. If there were to be more movement during those ten seconds the motion will not be detected as finished but it will keep counting it as one motion. This is so that with every slight movement there will not be a line printed on the serial monitor.
This is the layout of the project:
This is the code of the project:
For our project we had originally bought the ESP8266 WiFi shield:
https://www.amazon.co.uk/gp/product/B075F3FBH8/ref=oh_aui_detailpage_o05_s00?ie=UTF8&psc=1
We had some problems with it this original shield. Firstly, the voltage supply needed for this shield is 3.3V, secondly, the code given to connect it to arduino was very little, unexplained and complicated to manipulate. Nevertheless, through manipulation we tried to do connect the shield however, the shield did not work. The reason for this is that the shield was directly connected to the arduino board, whereby the arduino supply being 5V and the wifi shield being 3.3V, therefore the pins burned out. Consequently, we had to buy a new shield and we chose a different shield that had more information on it and one that would arrive on time.
13th December – Ordered a new shield
Final design
On Thursday the 13th December, our new wifi shield had arrived. Before the shield had arrived we have previously wrote some code to connect it to the arduino; shown below:
Once again, we were not able to connect it properly in the way that we had intended it to. The reason for this being that without realising, we needed to create an email account. This email account needed to be particular with an authorisation code to make it possible to connect to the arduino, thereby connecting to the email server to send an alert email to the user.
Later, we found a website that explained that we also needed a separate software for this, there are many but we chose Temboo. We created a new email account for it on Gmail and went through the two-step verification to create an authorisation code so that the app could access the Gmail. This code, which is attached below worked, but the problem was that we did not manage to connect it to the arduino ethernet shield, and the only option Temboo offered was arduino yun. If we had more time or looked into this earlier we could have come up with a solution to tackle this situation. However, with the change of shields and the time wasted waiting for the shields to arrive, we had a limited time to solve this issue.
A project task list
Ideation:
- Brainstorm
- Research on existing products
- Initial ideas
- Final idea
- Storyboard
Planning
- Delegating tasks
- Organising meetings
- Create Gantt chart
- View project progress
Development
- Make prototype
- Circuit layout and diagrams
- Buy components
- Test components
- Shortcomings, comments
- Start code
Making
- Finish code
- Adjust any mistakes
- Present project
Documentation
- Design blog
- Pictures/videos
- Maker manual
- Overview
- Tools and supplies
- Layout/circuit diagram
- Build
- Code with comments
- Discussion of testing conducted and known shortcomings
- Create presentation
- Project idea
- Project progression
- Design principles and choices
- Goals of the product, achievements/short comings
Gantt Chart
A maker manual: Instructions on how to make the project
A device that contains a PIR motion sensor to detect movement and alert the owner of the system by email that someone has been in their house.
- Tools and supplies
- Ethernet shield/ Wifi shield (not used at the end)
- PIR motion sensor
- Arduino Uno board
- LED light
- 9v Battery and adaptor
- Layout/circuit diagram
- The build
- Connect the PIR motion sensor to the Arduino Uno board as shown in the sketch above.
- Connect the LED light via the bread board to the Arduino Uno as shown above.
- Run the following code to make sure both the LED light and the PIR motion sensor are working:
//the time we give the sensor to calibrate
int calibrationTime = 30;
//the time when the sensor outputs a low impulse
long unsigned int lowIn;
long unsigned int pause = 5000; //creates a pause for five seconds
boolean lockLow = true;
boolean takeLowTime;
int pirPin = 9; //the digital pin connected to the PIR sensor’s output
int ledPin = 13; //the digital pin connected to the LED light
/////////////////////////////
//SETUP
void setup(){
Serial.begin(9600); //starting the serial monitor
pinMode(pirPin, INPUT); //sensonr = input
pinMode(ledPin, OUTPUT); // LED = output
digitalWrite(pirPin, LOW); // seson = off
//give the sensor some time to calibrate
Serial.print(“calibrating sensor “); //30 seconds to calibrate
for(int i = 0; i < calibrationTime; i++){
Serial.print(“.”);
delay(1000);
}
Serial.println(” done”);
Serial.println(“SENSOR ACTIVE”);
delay(50);
}
////////////////////////////
//LOOP
void loop(){
if(digitalRead(pirPin) == HIGH){
digitalWrite(ledPin, HIGH); //the led lights on if the sensor senses movement
if(lockLow){
//if it is true that the PIR senses movement print motion detected and making sure it only prints it once
lockLow = false;
Serial.println(“—“);
Serial.print(“motion detected at “);
Serial.print(millis()/1000);
Serial.println(” sec”);
delay(50);
}
takeLowTime = true;
}
if(digitalRead(pirPin) == LOW){
digitalWrite(ledPin, LOW); //the led is off if the sensor does not sense movement
if(takeLowTime){
lowIn = millis(); //save the time of the transition from HIGH to LOW
takeLowTime = false; //make sure this is only done at the start of a LOW phase
}
//if the sensor is not sensing motion for more than 5 seconds, print on the serial monitor that the motion ended
if((!lockLow) && (millis() – lowIn > pause)){
//makes sure this block of code is only executed again after
//a new motion sequence has been detected
lockLow = true;
Serial.print(“motion ended at “); //output
Serial.print((millis() – pause)/1000);
Serial.println(” sec”);
delay(50);
}
}
}
- Create a Gmail account to send the emails (name being a company name)
- Once the account has been created do the two step verification for the email (click on the following link to get started) https://www.google.com/landing/2step/
- Receive a code to use as verification for an app by following these steps:
- Once you get the code, save it.
- Create a Temboo account (you will need to insert the app password created on Gmail) on the Temboo website, make it to create a code to send an email from your Gmail to any email account that you choose. Code should look like this:
#include <Bridge.h>
#include <Temboo.h>
#include “TembooAccount.h” // contains Temboo account information
// as described in the footer comment below
/*** SUBSTITUTE YOUR VALUES BELOW: ***/
// Note that for additional security and re-usability, you could
// use #define statements to specify these values in a .h file.
// your Gmail username, formatted as a complete email address, eg “bob.smith@gmail.com”
const String GMAIL_USER_NAME = “xxxxxxxxxx”;
// your application specific password (see instructions above)
const String GMAIL_APP_PASSWORD = “xxxxxxxxxx”;
// the email address you want to send the email to, eg “jane.doe@temboo.com”
const String TO_EMAIL_ADDRESS = “xxxxxxxxxx”;
// a flag to indicate whether we’ve tried to send the email yet or not
boolean attempted = false;
void setup() {
Serial.begin(9600);
// for debugging, wait until a serial console is connected
delay(4000);
while(!Serial);
Bridge.begin();
}
void loop()
{
// only try to send the email if we haven’t already tried
if (!attempted) {
Serial.println(“Running SendAnEmail…”);
TembooChoreo SendEmailChoreo;
// invoke the Temboo client
// NOTE that the client must be reinvoked, and repopulated with
// appropriate arguments, each time its run() method is called.
SendEmailChoreo.begin();
// set Temboo account credentials
SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT);
SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
SendEmailChoreo.setAppKey(TEMBOO_APP_KEY);
// identify the Temboo Library choreo to run (Google > Gmail > SendEmail)
SendEmailChoreo.setChoreo(“/Library/Google/Gmail/SendEmail”);
// set the required choreo inputs
// see https://www.temboo.com/library/Library/Google/Gmail/SendEmail/
// for complete details about the inputs for this Choreo
// the first input is your Gmail email address.
SendEmailChoreo.addInput(“Username”, GMAIL_USER_NAME);
// next is your application specific password
SendEmailChoreo.addInput(“Password”, GMAIL_APP_PASSWORD);
// who to send the email to
SendEmailChoreo.addInput(“ToAddress”, TO_EMAIL_ADDRESS);
// then a subject line
SendEmailChoreo.addInput(“Subject”, “ALERT: Greenhouse Temperature”);
// next comes the message body, the main content of the email
SendEmailChoreo.addInput(“MessageBody”, “Hey! The greenhouse is too cold!”);
// tell the Choreo to run and wait for the results. The
// return code (returnCode) will tell us whether the Temboo client
// was able to send our request to the Temboo servers
unsigned int returnCode = SendEmailChoreo.run();
// a return code of zero (0) means everything worked
if (returnCode == 0) {
Serial.println(“Success! Email sent!”);
} else {
// a non-zero return code means there was an error
// read and print the error message
while (SendEmailChoreo.available()) {
char c = SendEmailChoreo.read();
Serial.print(c);
}
}
SendEmailChoreo.close();
// set the flag showing we’ve tried
attempted = true;
}
}
- Mix the code of both the PIR motion sensor alongside the emails code.
Evaluation
As mentioned throughout the blog, we had some shortcomings such as the fact that the first shield we bought required a 3.3 V supply for which we needed a converter or we needed to create some sort of resistance between the Arduino Uno and the shield. There was also a lack of documentation online about this shield, therefore doing the project at our level of skills was difficult. Secondly, the new shield (Ethernet shield) seemed to work however, since it arrived less than 24h before the project and was only ordered 24h before that, there wasn’t a lot of time to gather information in order to create a good outcome. The sources that were needed such as the Temboo account, were found too late in implement perfectly. Moreover, the project required an STMP account which was again difficult to implement and with the lack of time, it was again not implemented correctly. Overall, if we would have had more time I believe the project would have been completely successful.