GROUP 2 – REFLECTION PROTECTION

Project Index

Press Buttons to Jump to the section:


Chosen Project Brief: Being able to check on the security of your home, family members and belongings while away and in various locations around the world is of interest to you not only from the security perspective but also to ensure safety and peace of mind. The camera is the most component device that is used nowadays to ensure you capture any abnormalities or intruders but recently radio signals, voice and also heat have been used to complement or replace the camera. For this project, we encourage you to start thinking of a simple, low-effective home security system with the camera not being the centre of it. You could use microphones, infra-red sensors and also wireless shields to be able to detect movements, presence and also changes in the home environment from a distance through a website or phone app. Remember to be creative but also realistic considering the time available and budget.

Project Overview:

Design Direction:

We have chosen to create a Laser Sensor alarm system with a laser beam spanning our prototype. We will use a box to mimic a room/corridor through which the beams will pass. The beam will be pointing at a photoresistor which detects when the beams are broken. Once an object or person obstructs the beams, the system will be triggered, and audio feedback will let the user know. We want the system to be easy and intuitive to use. To do this, we will provide clear and visual instructions for the user. These instructions will include images or graphics for easy understanding.


Features:

  • Red laser beam bouncing from small mirrors to an LDR
  • Security alarm sound when there is a security breach or interference with laser
  • Phone notification SMS when a security breach occurs
  • Remote control of system via phone App

Project Planning:

Research:

Images can be clicked on like hyperlinks to check out reference website.


“The world has changed, particularly in California, where there has been a huge increase in robberies and burglaries”

Mauricio Umansky, founder and CEO of luxury real estate brokerage The Agency

Git Security:


Market Research:

Product 1:
20M Door Single Beam Alarm Photoelectric Infrared Detector Home Security System
Product 2:
Dahszhi Dual Laser Detector Alarm Beam Sensor Indoor 300m Outdoor 60m Infrared Detector

Brain Storming:


Inspiration:

We took most of our inspiration from movies and TV shows featuring laser sensor alarms. For example Kim Possible and Oceans 12.


Gantt Chart:

Preliminary Project Plan over the span of the available weeks.


Project Task List:


Project Phase Blog:

  • Phase One: Project Ideation, Sketching and Lo-fi Prototypes
  • Phase Two: High-fi Prototype and Building
  • Phase Three: Testing and Final Iterations

PHASE ONE: Project Ideation, Sketching and Lo-fi Prototypes

WK9:

Low-fi prototype (Sketch Model and Sketching):

We focused on working through how we wanted our project to look. Using a box would be easier than setting the system up within an actual room, as we felt the performance would be demonstrated best if we could fix each component within a box. The box would act as a prototype for a ‘room’. We played with the idea of a corridor-type room with multiple beams.


WK10:

Main Goals/Week Checklist:

Lo-fi prototype using Laser and Photo-resistor

Component’s Arrive – Preliminary Testing. Since the Wifi shield had not arrived yet we focused on what we could with the laser having arrived. We created a test/preliminary version of our alarm system using a photo resistor and one of our lasers.


Testing Photo Resistor – Laser interaction – We created this test function which detects whether the laser is pointed at the photoresistor or not by testing the light level value which it reads. This then sets off the piezzo noise function below.

Creating Test Alarm Noise – In this session, we created test alarm noises. We want the alarm noise to be annoying so that the intruder who set the alarm off is deterred. We wanted the sound to consist of one high-pitch (high frequency) and low-pitch (low frequency) notes. This is what helped us to achieve a stereotypical alarm sound.


PHASE TWO: High-fi Prototype and Building

Room/Prototype housing planning

Two Housing Options – Front Open Box Vs. Corridor Box

We decided on the corridor box as we felt it would present better and demonstrate our system from all angles. This way, the system could be used from both sides, therefore, mimicking someone walking through the system better.


Maker Space Making:


WK11:

Main Goals/Week Checklist:

Wifi-Shield Arrives: We had to wait till a week to start experimenting and learning how to use/setup our wifi shield. In order to use and test our system using the shield there was a lot of set-up steps.

Concerns/Issues:

Wifi-Shield: One problem with the wifi shield was that once one group member had set it up on their laptop, it was difficult to make sure another member had all the relevant downloads and accounts for testing to be done by multiple members. This raised some issues as updates were not as clear to recognise as we had thought. Another issue we had was with the connection from the shield to our phones, and we had some technical difficulties with this.

Photo-Resistor Threshold: Our main concern was that the photoresist threshold was too high; therefore, the alarm was not triggered in light spaces. We discovered this issue after working in a room with large windows and finding our alarm was only being set off when we covered it with our hands.


We created and adapted our old detection function to add our new notification feature. This feature means that we get a text notification when a security breach is detected.

This was the hardest part of our project, which was connecting the board to our phones on an external app and sending an SMS.


Adding Mirrors:

We used mirrored acrylic to create the mirrors. Mirrored acrylic is easier to work with than real glass mirrors and safer – we could cut it to size on the bandsaw and did not have to worry about sharp edges. We wanted the laser to span the entire corridor length; therefore, we decided to use 5 mirrors. Initially, we were only going to do 3, but we needed more because we wanted the mirrors to sit flush to the sides instead of tilted. Instead of tilting the mirrors, we tilted the laser to reach the end of the corridor where the photoresistor would go. Pictured on the left, we are trying out the mirror positions to cut the hole for the photoresistor.


Adding decoration:

We wanted to make the corridor look more realistic so that one could imagine this being in real scale. We used random recycled materials such as foil bottle caps and yoghurt lids to make the mirrors look like picture frames. We also added a carpet to the bottom.

Lining up the Laser:

This proved to be difficult as with all five mirrors, each micro-movement of the laser effecting its reaching the LDR at the final point.


PHASE THREE: Testing and Final Iterations

During the final testing and iteration group session, we discovered some issues with the alarm’s sensitivity and therefore began testing the dark. We found that either testing in the dark or adding a ‘roof’ to the setup made the system much more effective.

At the beginning of our testing session, we realised we wanted to have the alarm continuously ringing after it is triggered. This was difficult because using external libraries meant we couldn’t call certain functions as we struggled to have the recursive functions. We struggled with having these functions running simultaneously so that the alarm would remain ringing once the beam had been triggered until turned off on the app.


Testing: Ginger Bread Man

We made a gingerbread man for our demonstration and for testing purposes. This allowed us to test the reactiveness. We debated on whether to keep the alarm on or off after the initial trigger for a more realistic alarm system.

Project Evaluation:

Known Shortcomings:

  • Possible Transportation Issue: One known issue is that the laser position is very sensitive. Therefore any slight movement in the laser will affect the position at which the laser hits the LDR. This could affect the LDR sensitivity and, therefore, the reactiveness of the alarm trigger.
  • Predictable Laser beam line: Because the laser beam line is pretty regular (bouncing from just one mirror to another with a relatively even distance and angle), intruders could avoid the laser in order to overcome the security system.

Future Considerations:

  • Allow to laser to be deactivated when alarm is not in use
  • Add more complex laser layout.
  • Connect the circuit to an external power source
  • Use a laser receiver instead of an LDR for greater accuracy

Working as a Team: As a group we managed our responsobilities fairly and made sure all members had full understanding of the project and project code. We communicated via WhatsApp and met numerous times during the duration of the project.

Time management: Our time management was fair on this project but due to the unforeseen circumstance of our wifi shield only arriving during week 11 we were unable to work on the most difficult part of our project. This stunted our progression through the project as up to that point we were restricted in what we could implement.

Overall evaluation of final project: Overall we were very happy with the way our final outcome looks. We felt that over the process we learnt a lot and that we worked well as a team of four.

User and Builder Guides:

In this section you will find:

  • Component inventory
  • Wifi-setup guide
  • Builder Guide
  • User Guide

Component Inventory:

Wifi Set-up:

Builder Guide:

User Guide:

Code and Implimentation:

//Use blynk app to switch alarm On and off 
//sends a text message to given number

//import statements
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPLQL0hNolE"
#define BLYNK_DEVICE_NAME "alarm"
#define BLYNK_AUTH_TOKEN "7iJcLyZf42H38Co9xcOe05FWA4pf89lB"

#include <SPI.h>
#include <WiFiNINA.h>
#include "arduino_secrets.h" 
#include <BlynkSimpleWiFiNINA.h>

//connection for SMS system
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
String ifttt_webhook_key = SECRET_IFTTT_WEBHOOK_KEY;

//connection for alarmOn and alarmOff
char auth[] = "7iJcLyZf42H38Co9xcOe05FWA4pf89lB";
int status = WL_IDLE_STATUS;
const char* host = "maker.ifttt.com";
WiFiSSLClient sslClient;

//global variables dictating pin locations
int buzzPin = A2;
int sensorPin = A1;

//globals for storage of information
int sensorVal = 0;
int alarmOn= 0;

//pin value is changed using Blynk App
int pinValue;


void setup() {
  Serial.begin(9600);

  pinMode(buzzPin, OUTPUT);
  pinMode(laserPin, OUTPUT);

  wifiSetup();

  Blynk.begin(auth, ssid, pass);
}

void loop() {
  //statement checks for pinValue state and on change runs BLYNK_WRITE(V0) method
  Blynk.run();

  //conditional logic structure checking whether the alarm is on and whether the alarm has gone off
  if(pinValue == 1 && alarmOn == 0){
    breachDetection();
    Serial.println("alarm is checking for breach");
  }
  else if(pinValue == 1 && alarmOn == 1){
    alarm();
  }
  else if(pinValue == 0){
    alarmOn = 0;
  }
}

BLYNK_WRITE(V0){
   pinValue = param.asInt();
}

void breachDetection(){
  //reading sensor value and checking if beam has been disturbed
  sensorVal = analogRead(A1);
  if (sensorVal < 1000) {
    //triggered once, sends notification once and changes the alarm state to on
    alarmOn = 1;
    sendNotification();
    Serial.println("notification sent!");
    return;
  } 
  else {
    noTone(buzzPin);
  }
}

//mthod sotring alarm frequency controls
//will be called continuously until alarm is turned off if  a breach has occured 
void alarm() {
  tone(buzzPin,520);
  delay(400);
  noTone(buzzPin);
  tone(buzzPin,3000);
  delay(400);
  noTone(buzzPin);
}

//method to send an SMS to given number attatched to webhook account
void sendNotification(){
  // connect to web server on port 443:
  if(sslClient.connectSSL(host, 443)) {
    // if connected:
    Serial.println("Connected to server");

    // make a HTTP request:
    sslClient.println("GET /trigger/alarmOn/with/key/" + ifttt_webhook_key + " HTTP/1.1");
    sslClient.println("Host: maker.ifttt.com");
    sslClient.println("Connection: close");
    sslClient.println();
    Serial.println("IFTTT request Sucessful");
  }
   else {
    Serial.println("IFTTT request failed");
  }

  // if there are incoming bytes available 
  // from the server, read them and print them
  while(sslClient.connected()) {
    if(sslClient.available()) {
      char c = sslClient.read();
      Serial.write(c);
    }
  }

  Serial.println();
  Serial.println("disconnecting from server.");
  sslClient.stop();
}

//connects to the wifi network on the setup function
//network name and password are stored in arduino_secrets.h tab
void wifiSetup() {
  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  }
  // you're connected now, so print out the status
  printWifiStatus();                        
}

//used for debugging wifi connection
void printWifiStatus() {
  // print the SSID of the network:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());
 
  // print WiFi IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
 
  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}
#define SECRET_SSID "Galaxy Note20 Ultra 5G"
#define SECRET_PASS "plzdonthackme"
#define SECRET_IFTTT_WEBHOOK_KEY "cXsYrTYZN21y4FGCu38Rw5"

//this tab stores the wifi network name, password and webhook key
//webhook key is found on you webhook device account
tab storing the wifi network name, password and webhook key //webhook key is found on you webhook device account