Smart Home

This project is submitted to Deakin University, School of IT, for Unit SIT210 鈥 Embedded Systems Development.

Problem Statement:

Even though there are a lot of security systems that are present in the market but most involve the use of motion sensors and CCTV camera separately in the premises which incurs extra cost on the user and time wastage in case of checking CCTV feed if any unwanted motion is detected inside the premises.

This project also touches a bit on integration of home security and home automation into a single working system.


1) Raspberry Pi 4


路 Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz


路 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE

路 Gigabit Ethernet

路 2 USB 3.0 ports; 2 USB 2.0 ports.

路 Raspberry Pi standard 40 pin GPIO header

路 2 脳 micro-HDMI ports

路 2-lane MIPI DSI display port

路 2-lane MIPI CSI camera port

路 4-pole stereo audio and composite video port

路 H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode)

路 OpenGL ES 3.0 graphics

路 Micro-SD card slot for loading operating system and data storage

路 5V DC via USB-C connector (minimum 3A*)

路 5V DC via GPIO header (minimum 3A*)

路 Power over Ethernet (PoE) enabled (requires separate PoE HAT)

路 Operating temperature: 0 鈥 50 degrees C ambient

2) Raspberry Pi Camera


路 5MP Omnivision 5647 Camera Module

路 Still Picture Resolution: 2592 x 1944

路 Video: Supports 1080p @ 30fps, 720p @ 60fps and 640x480p 60/90 Recording

路 15-pin MIPI Camera Serial Interface 鈥 Plugs Directly into the Raspberry Pi Board

路 Size: 20 x 25 x 9mm

路 Weight 3g



路 Working voltage range: DC 5-20V

路 Static current: 65uA

路 Level output Voltage: High 3 V / low 0V

路 Delay time: 0.3-18s

路 Dimensions: 32mm*24mm *25mm

4) Arduino UNO


路 Microcontroller: ATmega328

路 Operating Voltage: 5V

路 Input Voltage (recommended): 7-12V

路 Input Voltage (limits): 6-20V

路 Digital I/O Pins: 14 (of which 6 provide PWM output)

路 Analog Input Pins: 6

路 DC Current per I/O Pin: 40 mA

路 DC Current for 3.3V Pin: 50 mA

路 Flash Memory: 32 KB (ATmega328) of which 0.5 KB used by bootloader

路 SRAM: 2 KB (ATmega328)

路 EEPROM: 1 KB (ATmega328)

路 Clock Speed: 16 MHz

路 Length: 68.6 mm

路 Width: 53.4 mm

路 Weight: 25 g

5) Particle Argon


路 On-board additional 4MB SPI flash

路 Micro USB 2.0 full speed (12 Mbps)

路 Integrated Li-Po charging and battery connector

路 JTAG (SWD) Connector

路 RGB status LED

路 Reset and Mode buttons

路 On-board 2.4GHz PCB antenna for Bluetooth (does not support Wi-Fi)

路 Two U.FL connectors for external antennas (one for Bluetooth, another for Wi-Fi)

路 Meets the聽Feather specification聽in dimensions and pinout

路 FCC, CE and IC certified

路 RoHS compliant

6) Breadboard

7) LED Lights

8) Jumper Wire: Male to Female.

9) OpenCV on Raspberry Pi

10) Python IDE on Raspberry Pi

11) MQTT connection between Raspberry Pi and Argon



The system detects the motion in the premises and the video is captured inside the premises concurrently.

路 When the motion is detected, a signal is sent to the Particle Argon using MQTT which triggers an email to the user using IFTTT and LED turns on few secs in the prototype, this is the component to address one of the drawbacks of the system, that is capturing video in dark, so if motion is detected, the lights inside the premises turn on, thus enabling the functioning of the camera, and after few seconds led turns off in the prototype.

路 The camera captures the video of any activity in the premises.

路 If there is a person in the premises, the machine learning algorithm first detects the face and the recognizer i.e., trained model with dataset recognizes the face of the person.

路 If the face is known, the led turns on permanently, this is done to welcome user home.

路 If the face is of unknown person, the emails are sent to the user using SMTP library.


1) Download and Install Raspbian OS on Raspberry Pi using the link:聽

2) Setup the Particle Argon device using the steps provided on Particle website:聽

3) Download and install Arduino IDE to work with Arduino聽

Components of the Project:

1) Motion Detection:

The PIR motion sensor is connected to GPIO of raspberry pi and any motion detected is read by raspberry pi.

Connection between Motion Sensor and Raspberry Pi:



Output- GPIO 26


This code reads the activity of the PIR motion sensor and any detected motion is recorded and ALARM function is called as the course of action.

2) Face Detection and Recognition:

路 Install OpenCV environment on Raspberry Pi. Recommended Link:聽

路 OpenCV can take a lot of space on the memory card, so make sure the card is big enough.

路 What is Haar Cascade? It is a machine learning object detection algorithm used to identify objects in an image or video and based on the concept of聽鈥嬧聽features proposed by Paul Viola and Michael Jones in their paper 鈥淩apid Object Detection using a Boosted Cascade of Simple Features鈥 in 2001.聽It is a machine learning based approach where a cascade function is trained from a lot of positive and negative images.聽It is then used to detect objects in other images.

In the project the numerous images of front face are stored in form of XML file and while detection, the classifier is test upon this file, the file is provided in the Github link.

路 Code to detect faces using OpenCV:

Numpy is used to convert the image into form of matrix.

路 faseCascade is trained function to detect faces as it contains xml file of frontal faces.

路 faceCascade.detectMultiScale() function is used to detect faces in the live video stream and聽scaleFactor聽specifies how much the image size is reduced with each scale.聽minNeighbours聽specifies how many neighbours each candidate rectangle should have to retain it.

路 Imshow() function shows the video of the camera along with border around the face.

路 Prepare the dataset of images of the user, in this case would be myself using the code given, what it does is it detects the face and captures 30 images of the face and saves it into the specified folder.

images of the face and saves it into the specified folder.

Train Face Recognizer:

路 In this step the face recognizer is created and trained by feeding all the images in the dataset of the user鈥檚 image, when trained this model can be used in any project but needs to be imported properly.

Train Face Recognizer

3) MQTT between Argon and Raspberry PI:

MQTT is a machine-to-machine (M2M)/鈥滻nternet of Things鈥 connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium. For example, it has been used in sensors communicating to a broker via satellite link, over occasional dial-up connections with healthcare providers, and in a range of home automation and small device scenarios.

Publishing with Raspberry Pi:

Publishing with Raspberry Pi:

Subscribing this event with Argon:


Source: Smart Home

About The Author

Muhammad Bilal

I am highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top