Introduction: Advanced Security System

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).

Step 1: Components and Materials

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.


  • 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


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


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

Step 2: Putting the Hardware Together

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.

Step 3: Database

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.

Step 4: Writing the Code

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.

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

Step 5: Design the Responsive Website

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.

Step 6: Software on the Raspberry Pi

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
  • datetime
  • subprocess
  • mysql
  • SocketIO

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

Step 7: Building the Case

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.