Advanced Security System

by LaurensWalraeve in Circuits > Raspberry Pi

301 Views, 5 Favorites, 0 Comments

Advanced Security System

104175273_1015442205541210_5690730564097888160_n.jpg

Have you ever wanted to secure your house completely and make it impossible for intruders to enter your house? If so, this is the solution for you!

I made Advanced Security System, this is a system that will secure ur house from the inside and outside and will scare the intruders away with a loud sirene that turns on when they enter. You can control this system through a website and you will always know when and where an intruder was detected.

This is my first project in my field of study: Multimedia and communication Technology (MCT) at Howest (Kortrijk belgium).

Components and Materials

Raspberry.jpg
LDR.jpg
Wires.jpg
Cobler.jpg
Plexie.jpg
WOod.jpg
PIR.jpg
Sirene.jpg
TIP120.jpg
OLED.jpg
Magnet.jpg
Adapter.jpg
MCP3008.jpg
LEd.jpg
Power.jpg

For my project i used multiple parts that i will be listing below, i'll also add the bill of materials with the correct price and websites from wich i ordered them.

Components:

  • Raspberry Pi 4 Model B / 4GB
  • Assembled Pi T-cobbler plus GPIO Breakout
  • LDR
  • Motion sensor
  • Magnetic contact switch
  • Led strip
  • OLED
  • Sirene
  • MCP3008
  • TIP120
  • Breadboard
  • Power supply
  • Male to male jumper wire
  • Male to female jumper wire

Materials:

  • Led profile
  • MDF wood 18mm
  • Plexie glass
  • Hinges

Tools:

  • Soldering iron
  • Jigsaw
  • Saw
  • Lamello
  • Sandpaper
  • White paint
  • Nailgun
  • Wood glue

Putting the Hardware Together

Hardware.jpg
Breadboard.png
Schematic.png

I have build my circuit by following my Fritzing scheme that I made, I uploaded the scheme below. The circuit has multiple sensors and an actuator that works together as one. I will list which different circuits there are, how you will need to connect these u can find in the scheme.

  1. There are 3 PIR sensors, 2 inside of the house and 1 outside of the house.
  2. LDR to tell the outside sensor if it is dark enough to turn on the light.
  3. Magnetic Switch sensor that know when the door opens.
  4. A OLED screen which displays the stats of my Raspberry Pi including the IP of the website.
  5. Led that indicates if the alarm is on or off
  6. Sirene to alert people that someone is breaking in the house without permission from the owners.

Database

ERD.png

You can see my ERD diagram above, I will also put the dump file in my github so you can import the database for yourself.

With this database you will be able to show multiple things like:

  • When the door opens and closes
  • When and where someone triggers the alarm
  • When someone triggers the lighting outside
  • When someone enters a room without triggering the alarm

If you want to recreate this database you will need to make a new user so you can connect to your Raspberry Pi.

https://github.com/howest-mct/1920-1mct-project1-WalraeveLaurens

Writing the Code

104421189_1141761326222812_202994325140862105_n.jpg
code.png

Now its time to make sure all components do there job. So I wrote some code in python and deployed it on raspberry pi. You can find my code on Github when my teachers make this public.

https://github.com/howest-mct/1920-1mct-project1-W...

For programming the code i used Visual Code. The code is written in html, CSS, JavaScript using Sockets and python.

Design the Responsive Website

Mockup.png
Office.png
Overview.png
Dashboard – 2.png
Dashboard.png
Driveway.png
Front Door.png
Lobby.png
Login – 1.png
Login – 2.png

I was thinking how my responsive website must look like. Before I could do that, I had to look back to the functional analyse that I made and search for inspiration and interesting patterns.


First, I made my design in Adobe XD. The font I used was Robotto. I went for an easy design because i want it to be user friendy and not have to many buttons but just enough so the user could enjoy working with the app.

The design was approved by my teachers, so I could start programming. I wrote the site in HTML - CSS - JavaScript.

Software on the Raspberry Pi

import.png

For my code to work (which I will link below) you'll need to install some packages and libraries. First thing that is needed is for you to update your Pi.


First, update your system's package list by entering the following command: sudo apt-get update

Next, upgrade all your installed packages to their latest versions with the following command: sudo apt-get dist-upgrade

After you have installed the packages you'll need to install some libraries:

  • Threading
  • Time
  • Json
  • spidev
  • flask
  • flask_cors
  • RPI.GPIO
  • datetime
  • subprocess
  • mysql
  • SocketIO

And we have to clone the library below to make the OLED work.

https://github.com/adafruit/Adafruit_Python_SSD130...

Building the Case

103878452_186584582749565_3207933591259749470_n.jpg
104118884_719605068774769_5091890372131862421_n (1).jpg
104282429_268764294336779_1522235880588062560_n (2).jpg
104096713_614990229141746_2870382509529801630_n.jpg
104226386_622111895178247_1544858252287219958_n.jpg
104318243_249760782993419_6770598931201966996_n.jpg
83318774_392998581656179_1184096001945125848_n.jpg

For my case i build a small mansion with a door 2 rooms and a window and a roof from plexie glass. I made a room under the house to hold the electronics and assembled it with lamellos.

I also put pictures where you can see the process of building the case.

For the measurments I'll also uploaded a file below where you can see my schematic of how you could recreate it.