You are on page 1of 8

Home Security

WINDOWS 10 UWP APP USING IOT

Gagandeep | INT209 | February 25, 2017


Registration no:11502443
Roll No.: A03
Section: K1509
INTRODUCTION
This is a digital home security system with voice feature which
can monitor room temperature, motion, and windows & doors.

The goal of this project is to utilize the after-market parts and


build an integrated home security system. We have also used
Temperature sensor and Ultrasonic sensor. Hence the security
system will sound an alert when there is an attempt of break-in by
using ultrasonic sensor and click the pic of the intruder with the
help of camera or if there is possible fire. The user can also control
all the sensors by Speech recognition or GUI and user will get
voice respond according to that.

PAGE 1
PROBLEM STATEMENT
This report is describing our project in the Ubiquitous Computing
course. It is containing the design process of the project, starting
with brainstorming we had to get the final product idea and
finishing with the prototyping within home a like environment.
The original problem was to design and implement a larger
ubiquitous computing project into a home environment. The
report is describing what kind of design process, hardware and
software have been used to build up the prototype for that
product design that we had chosen as our final goal.

REQUIREMENT ANALYSIS
HARDWARE REQUIREMENTS:
Raspberry Pi 3 Model B
Ultrasonic Sensor
Temperature Sensor(LM35)
Analog to digital Converter
Camera
USB Mic or 3.5 mm jack Mic with generic USB sound card.
Jumper Wires
Relay module

SOFTWARE REQUIREMENTS:
Windows 10
Primary OS from which we will control the Security System.
Visual Studio 2015
Windows 10 IOT Core

PAGE 2
DESIGN
SYSTEM DESIGN:
For our sake we are implementing the project on breadboard
using ultrasonic sensor and camera module.

Ultrasonic sensor maps the distance of the object in every 100


milliseconds and triggers an alarm if object is near than 1m from
the sensor and clicks an image of the intruder simultaneously.

The hardware design is specified below:

Ultrasonic Sensor Circuit

Temperature Sensor Circuit

PAGE 3
DETAILED DESIGN:
Given below image is the GUI of the Home Security System app.
From there we can turn on the speech recognizer to start speech
recognition. After turning on speech recognizer we can turn on
the ultrasonic sensor by saying, Turn on the ultrasonic sensor
also we can manually turn on the ultrasonic sensor by clicking on
the button. After turning on the ultrasonic sensor app will give us
voice feedback as, Ultrasonic sensor is switched on and will start
continuously measuring the distance of object in front of it and if
the object or intruder comes near than 1m it will give an alarm
saying Intruder! Intruder! Intruder!.

PAGE 4
SOURCE CODE
ULTRASONIC SENSOR USAGE:
public async void InitUltrasonicSensor()

var gpio = GpioController.GetDefault();

if (gpio != null)

pinEcho = gpio.OpenPin(ECHO_PIN);

pinTrigger = gpio.OpenPin(TRIGGER_PIN);

pinTrigger.SetDriveMode(GpioPinDriveMode.Output);

pinEcho.SetDriveMode(GpioPinDriveMode.Input);

PAGE 5
pinTrigger.Write(GpioPinValue.Low);

await Task.Delay(100);

timer = new DispatcherTimer();

timer.Interval = TimeSpan.FromMilliseconds(400);

timer.Tick += Timer_Tick;

if (pinEcho != null && pinTrigger != null)

timer.Start();

private async void Timer_Tick(object sender, object e)

pinTrigger.Write(GpioPinValue.High);

await Task.Delay(10);

pinTrigger.Write(GpioPinValue.Low);

sw.Start();

distance.Text = pinEcho.Read().ToString();

while (pinEcho.Read() == GpioPinValue.Low)

while (pinEcho.Read() == GpioPinValue.High)

sw.Stop();

var elapsed = sw.Elapsed.TotalSeconds;

PAGE 6
var distance1 = elapsed * 34000;

distance1 /= 2;

distance.Text = "Distance: " + distance1 + " cm";

SPEECH RECOGNIZER USAGE:


public async void InitSpeechRecognizer()

SpeechRecognizer Rec = new SpeechRecognizer();

//Event Handlers

Rec.ContinuousRecognitionSession.ResultGenerated += Rec_ResultGenerated;

StorageFile Store = await


Package.Current.InstalledLocation.GetFileAsync(@"GrammerFile.xml");

SpeechRecognitionGrammarFileConstraint constraint = new


SpeechRecognitionGrammarFileConstraint(Store);

Rec.Constraints.Add(constraint);

SpeechRecognitionCompilationResult result = await Rec.CompileConstraintsAsync();

if (result.Status == SpeechRecognitionResultStatus.Success)

status.Text = "Speech Recognition started.";

tts(status.Text);

Rec.UIOptions.AudiblePrompt="Speech Recognition started.";

await Rec.ContinuousRecognitionSession.StartAsync();

PAGE 7

You might also like