0% found this document useful (0 votes)
38 views91 pages

A5 Document

Nothing

Uploaded by

Sruthi Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views91 pages

A5 Document

Nothing

Uploaded by

Sruthi Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 91

A

PROJECT STAGE – II REPORT


On

IOT BASED DOOR BELL CONTROL SYSTEM USING RASPBERRY PI

A dissertation submitted in partial fulfillment of the requirement for the award of the degree of
BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION ENGINEERING

By

KOMMINENI SINDHU (20UP1A0423)


BARLA PUJITHA (20UP1A0407)
KODURU SANDHYA (20UP1A0421)

Under the esteemed guidance of

Mr.K.ASHOK REDDY,
Assistant Professor

DEPARTMENT OF ELECTRONICS ANDCOMMUNICATION ENGINEERING

VIGNAN’S INSTITUTE OF MANAGEMENT AND TECHNOLOGY FOR WOMEN


Kondapur (V), Ghatkesar (M), MedchalDist– 501 301.
(Affiliated to Jawaharlal Nehru Technological University, Hyderabad)
2020-2024
VIGNAN’S INSTITUTE OF MANAGEMENT AND TECHNOLOGY FOR
WOMEN
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
(Approved by AICTE &Affiliated to JNTUH)
Kondapur (V), Ghatkesar (M), Medchal District – 501301
2020-2024

CERTIFICATE

This is to certify that the project report entitled “IOT BASED DOOR BELL CONTROL
SYSTEM USING RASPBERRY PI” that is being submitted by K.Sindhu (20UP1A0423),B.Pujitha
(20UP1A0407), K.Sandhya (20UP1A0421) in partial fulfillment for the award of the Bachelor of
Technology in ELECTRONICS AND COMMUNICATION ENGINEERING to the Jawaharlal Nehru
Technological University, is a record of bonafide work carried by her under my guidance and
supervision. The results embodied in this project report have not been submitted to any other
University or institute for the award of any degree.

Mr. P. Hari Krishna Mr.K.Ashok Reddy


Head of Department Internal Guide
DECLARATION

We K.Sindhu(20UP1A0423), B.Pujitha(20UP1A0409), K.Sandhya(20UP1A0421) hereby


declare that the results embodied in this dissertation entitled “Iot Baesd Door Bell Using
Raspberry Pi” is carried out by us during the year 2023 –2024 in partial fulfillment of the
award of Bachelors of Technology in Electronics and Communication Engineering from
Vignan’s Institute of Management and Technology for Women, Kondapur is an authentic
record of our own work carried under the guidance of Mr K. ASHOK REDDY, ASSISTANT
PROFESSOR Department of Electronics and Communication Engineering. We have not
submitted the same to any other university or organization for the award of any other degree.

Date: Student Name


Place: Kondapur K. Sindhu (20UP1A0423)

B. Pujitha (20UP1A0407)

K.Sandhya (20UP1A0421)

i
ACKNOWLEDGEMENT

We feel highly obliged to my project guide, Mr. K. ASHOK REDDY, Asst.


Professor, Department of Electronics and Communication Engineering, for his constant
encouragement and moral support. He has been a source of valuable guidance, suggestions and
kindness during the course of the project work. We find no words to express our gratitude and
thanks to him.

We would like to thank Mr. P. HARI KRISHNA Head, Department of Electronics


and Communication Engineering, for having provided the freedom to use all the facilities
available in the department, especially the laboratories and the library, at any time.

We express my profound thanks to our Principal, Dr. G. APPARAO NAIDU, for


extending all the college facilities for the completion of the project.

We sincerely thank all the staff of the Department, for their timely suggestions, healthy
criticism and motivation during the course of our study. We would also like to thank our friends
for always being there to provide required help or support. With great respect and affection,
thank our parents who were the backbone behind our deeds.

Finally, we express our immense gratitude with pleasure to one and all who have either
directly or indirectly contributed to our need at right time for the development and execution
of project work.

Yours truly,

K.SINDHU (20UP1A0423)
B.PUJITHA (20UP1A0407)
K.SANDHYA (20UP1A0421)

ii
PREFACE

This record is concerned about our practical Major Project during 8th semester i.e. final
year of B. Tech course. We have taken our practical Major Project in IoT. During this Project
Stage - II, we got to learn many new things about the technology and its practical
implementation.

This Major Project provides to be a milestone in our knowledge of present environment.


Every moment was an experience in itself, an experience which theoretical study can’t provide.

iii
ABSTRACT

This Raspberry Pi, IoT Doorbell is basically a simple smart Door Bell, which takes a photo of
whoever rings it, and emails it to the specified email address, and keeps all the photos in a
folder.

When a person presses the switch or knocks the door, the bell gets rang which is old fashion
but in our project the new thing is when a person presses the switch the bell gets rang and
meanwhile the owner gets notifications through mail with captured image and the message that
somebody knocked the door at particular day and time.

Hardware is solved by Plug of Webcam into the Rasp-pi, along with your selected network
interface. Then, using the images as a guide connect your button and resistors to the pi. With
the breadboard image, the both wires are the wires running the the door bell.

TOOLS: Raspberry Pi, Camera module, Power Supply, Buzzer, Push Button ,SD Card

iv
TABLE OF CONTENTS
CONTENTS PAGE NO.

ABSTRACT iv

LIST OF FIGURES vii

LIST OF TABLES viii

LIST OF ABBREVATIONS ix

CHAPTER 1

1.1 OBJECTIVE 1
1.2 INTRODUCTION 2
1.3 PROBLEM STATEMENT 2
1.4 EXISTING SYSTEM 3
1.5 PROPOSED SYSTEM 3
1.6 SYSTEM ARCHITECTURE 4
1.7 REQUIREMENTS 7

CHAPTER 2

2.1 LITERATURE SURVEY 9

CHAPTER 3

3.1 WORKING PROCEDURE 11

3.2 FLOWCHART 12

CHAPTER 4

4.1 HARDWARE IMPLEMENTATION

4.1.1 RASPBERRY PI POWER SUPPLY 13


4.1.2 INTRODUCTION TO RASPBERRY PI 15

v
4.1.3 ARM ARCHITECTURE 20
4.1.4 SD CARD 29

4.1.5 PUSH BUTTON 31

4.1.6 BUZZER 32

4.1.7 USB CAMERA 33

4.1.8 REGULATED POWER SUPPLY 35

4.2 SOFTWARE IMPLEMENTATION

4.2.1 OPERATING SYSTEM 39

4.2.2 BOOT PROCESS 40

4.2.3 INTRODUCTION TO PYTHON 43

4.2.4 HOW TO SETUP RASPBERRY PI WITHOUT

MONITOR OR KEYBOARD 45

4.2.5 TEXT TO SPEECH WITH PYTHON ESPEAK 52

4.2.6 EMAIL SETUP 55

4.2.7 OPENCV PYTHON 56


CHAPTER 5

5.1 PROJECT OUTPUT RESULTS 60

CHAPTER 6

6.1 TESTING AND DEBUGGING 61

ADVANTAGES 68

DISADVANTAGES 69

vi
APPLICATIONS 70

CONCLUSION 71

REFERENCES 72

APPENDIX 73

vii
LIST OF FIGURES

FIGURE NO: NAME OF THE FIGURE PAGE NO:


FIG NO 1.1 Block Diagram 04

FIG NO 3.1 Flow Chart 12

FIG NO 4.1 Raspberry pi RPS 13

FIG NO 4.2 RPS Schematic Diagram 13

FIG NO 4.3 Voltage converter 15

FIG NO 4.4 Different versions of raspberry pi 16

FIG NO 4.5 Raspberry pi zero 18

FIG NO 4.6 Raspberry pi Board 18

FIG NO 4.7 Raspberry pi 3 on chip Hardware 19

FIG NO 4.8 ARM 11 Processor Architecture 22

FIG NO 4.9 Structure of ARM1176JZF S-Process 26

FIG NO 4.10 ARM1176JZF-S pipeline stages 27

FIG NO 4.11 Push Button 32

FIG NO 4.12 Buzzer 33

FIG NO 4.13 USB Camera 34

FIG NO 4.14 Regulated Power Supply 36

FIG NO 4.15 Components of typical linear Power supply 36

FIG NO 4.16 Full wave Rectifier Bridge 37

FIG NO 4.17 Resultant output waveform 38

FIG NO 4.18 Boot process of Raspberry pi 42

FIG NO 4.19 Features of Python 43

FIG NO 4.20 Raspberry pi development board 45

FIG NO 4.21 Raspberry pi Desktop view 51

FIG NO 4.22 Optical Character Recognition 53

viii
FIG NO 4.23 OCR process flow 55

FIG NO 5.1 Connections of Door Bell using Raspberry pi 60

FIG NO 5.2 Output of software 60

FIG NO 6.1 HDMI Cable 61

FIG NO 6.2 HDMI to VGA Converter 62

FIG NO 6.3 VGA Cable 62

ix
LIST OF TABLES
TABLE NO NAME OF THE TABLE PAGE NO.
TABLE 4.1 Versions of Raspberry Pi and their Features 17

x
LIST OF ABBREVATIONS
TERM ABBREVATION PAGE NO
OCR Optical Character Recognition 05

GPIO General Purpose Input and output pins 05

MQTT Message Queuing Telemetry Transport 06

HTTP Hyper Text Transfer Protocol 06

LBPH Local Binary Pattern Histogram 09

GPS Global Positioning System 09

LDO Low dropout 10

DFN Direct Function 14

GUI Graphical User Interface 14

GPU Graphic Processing Unit 15

ARM Advanced RISC Machine 19

RISC Reduced Instruction Set Computer 19

AMBA Advanced Microcontroller bus Architecture 20

AXI Advanced eXtensible Interface 21

MMU Memory Management Unit 22

ALU Arithmetic Logic Unit 22

DSP Digital Signal Processing 24

ISS Integrated Security System 24

BLX Board Level Testing 26

FIQ Fast Interrupt Request 27

IRQ Interrupt Request 28


USB Universal Serial Bus 32

CMOS Complementary Metal Oxide Semiconductor 33

xi
CCD Charge Coupled Device 33

RSE Relative Standard Error 40

VCOS Video Core Operating System 40

FLOSS Free/Libre Open Source Software 44

SSH Secure Shell 48

TTS Text to Speech 52

CLI Command Line Interface 54

SSMTP Simple Mail Transfer Protocol 55

CUDA Compute Unified Device Architecture 56

HDMI High Definition Multimedia Interface 61

VGA Video Graphics Array 61

xii
Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

CHAPTER 1

INTRODUCTION TO PROJECT

1.1 OBJECTIVE
The main objective is to enhance home security. Convenience by monitoring and
notifications through mobile applications. The door bell is designed to send instant alerts to users
when someone rings the doorbell. These notifications can include video footage or images
captured by the integrated camera, providing the valuable visual information about who is at the
door.
▪ Remote Monitoring: Enable homeowners to monitor their front door remotely from
anywhere using a smartphone or computer connected to the internet. This allows them to
see who is at the door even when they are not at home.
▪ Notifications: Provide instant notifications to homeowners when someone rings the
doorbell. Notifications can be sent via mobile apps, emails, or text messages, ensuring
that homeowners are always aware of visitors.
▪ Integration with Smart Home Systems: Integrate the doorbell with existing smart home
systems, allowing users to automate actions based on doorbell events. For example,
turning on lights when the doorbell is pressed at night.
▪ Recording and Playback: Record video or capture images when the doorbell is pressed,
providing a record of visitors for security purposes. Homeowners can review these
recordings later if needed.
▪ Customization: Allow homeowners to customize the doorbell's behaviour and settings
according to their preferences. This could include adjusting notification preferences,
setting up custom alerts, or integrating with third-party services.
▪ Enhanced Security: Improve home security by deterring potential intruders and
providing homeowners with valuable information about who is at their door before they
open it.
▪ Low-Cost Solution: Provide a cost-effective alternative to commercial smart doorbell
systems by leveraging affordable hardware like the Raspberry Pi and open-source
software.

DEPARTMENT OF ECE 1 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

By achieving these objectives, an IoT-based doorbell using a Raspberry Pi can significantly


enhance the functionality and security of a home
1.2 INTRODUCTION
Over the world, IOT (Internet of Things), technologies which were developed for smart
home system are becoming well known. The system is developed by using Supported Mobile
Communication and Safety Powered Functional Smart Door System. Video camera system (the
photo of visitors will be sent to the owner of the house), instant message notification and SMS
notification process will be provided. In addition, cloud storage of image data with a high
resolution will be provided using the system. With increasing safety and security is-sues, the use
of smart door system increased consistently with the advent of security related electronics, such
as digital door locks, and wire-less home security networks. There are many smart systems
proposed to provide safety and security at home and offices. The system is integrated to the gate
for recognition people.
This project is about a smart doorbell notification so that when a guest clicks on the
button/bell, it makes a ring, a camera takes a picture and the admin get the notification on his E-
mail with the picture of Guest.
An IoT-based smart doorbell using Raspberry Pi involves integrating the Raspberry Pi with
sensors, a camera module, and networking capabilities to create a connected and intelligent
doorbell system. The Internet of Things (IoT) aspect allows users to remotely monitor and
interact with the doorbell using smartphones or other devices. Here's a basic introduction to
creating an IoT-based smart doorbell with a Raspberry Pi.

1.3 PROBLEM STATEMENT:


Common issues include the inability to verify visitors without physically opening the door.
Here we are facing a big challenge that we can’t see the visitors whenever they stand left or right
side of the door hole. we can see only when they are infront of the hole.
▪ Limited Security Features: Doorbells provide minimal security, leaving homes
vulnerable to unauthorized access or intruders. The lack of surveillance capabilities and
remote monitoring exacerbates security concerns.

DEPARTMENT OF ECE 2 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

▪ Lack of Remote Access: Conventional doorbells offer no means for homeowners to


remotely monitor or interact with visitors. In an increasingly connected world, the
inability to receive notifications or view live streams remotely hampers convenience and
security.

▪ Integration with Smart Home Systems: Many homeowners seek to integrate their
doorbell system with other smart home devices and platforms for enhanced automation
and functionality. However, traditional doorbells lack the necessary connectivity and
compatibility for seamless integration.
▪ Complexity of Installation: Installing a traditional doorbell often requires extensive
wiring and may necessitate professional assistance. Simplifying the installation process
while ensuring reliability and functionality poses a significant challenge.
1.4 EXISTING SYSTEM:
The IoT-based doorbell system utilizes Raspberry Pi, a credit-card sized computer, as its
central processing unit. This system integrates alert message and camera modules to create a
smart doorbell capable of notifying homeowners of visitors remotely via their smartphones or
other devices connected to the internet. When a visitor presses the doorbell button or triggers the
motion sensor, the Raspberry Pi captures a snapshot or video clip of the visitor using the camera
module. It then sends a notification to the homeowner's smartphone or designated device via a
Wi-Fi or internet connection.

1.5 PROPOSED SYSTEM:


The proposed IoT-based doorbell system aims to provide enhanced security and convenience
for homeowners by integrating Raspberry Pi technology with camera module and alert message
through email. This system will allow users to remotely monitor their door, receive notifications
of visitors. When a visitor presses the doorbell button or triggers the motion sensor, the
Raspberry Pi will activate the camera module to capture a snapshot or video clip of the visitor. It
will then send a notification to the homeowner's smartphone or designated device via Wi-Fi or
internet connection. The user will have the option to view the live video feed and also user can
see the visitor in monitor which is fix inside the house.

DEPARTMENT OF ECE 3 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

1.6 SYSTEM ARCHITECTURE:

Fig 1.1 Block diagram

1. Raspberry Pi 3B+:

The Raspberry Pi 3B+ is the cornerstone of this project, serving as the central computing
platform. It boasts a quad-core ARM Cortex-A53 processor running at 1.4 GHz and 1 GB of
LPDDR2 SDRAM, providing ample processing power for various tasks. This includes image
processing, text recognition, language translation, and audio synthesis, all essential for the
functionality of the reading aid and translator. Additionally, the Raspberry Pi 3B+ features built-
in connectivity options, such as Wi-Fi (802.11b/g/n/ac) and Bluetooth 4.2/BLE, enabling
wireless communication for accessing online translation services and software updates. Its GPIO

DEPARTMENT OF ECE 4 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

(General Purpose Input/Output) pins allow for interfacing with external hardware components
like the webcam and push buttons for user interaction. Moreover, its compatibility with different
operating systems, including Raspbian, Ubuntu, and Windows 10 IoT Core, offers flexibility in
software development and customization to meet the project's requirements. With its compact
form factor and low power consumption, the Raspberry Pi 3B+ is well-suited for embedded
applications, making it an ideal choice for the reading aid and translator project.

2. Webcam:

The webcam serves as the primary input device for capturing images of printed text, enabling the
system to recognize and convert it into machine-readable text. It typically consists of an image
sensor, lens, and microphone. The image sensor captures high-resolution images of text
documents, ensuring clarity and legibility for accurate text recognition. The lens focuses light
onto the image sensor, determining factors such as field of view, focal length, and aperture size.
Autofocus and manual focus options allow for adjusting the camera's focus to capture sharp
images of text at different distances. Some webcams also feature built-in microphones for
capturing audio alongside video, facilitating interactive communication in applications like video
conferencing or online tutoring. Depending on the project's requirements, the webcam can be
connected to the Raspberry Pi via USB or utilizing a camera module specifically designed for
Raspberry Pi boards. Mounting options such as flexible stands or tripods enable adjusting the
camera's angle and distance for optimal image capture. Overall, the webcam plays a crucial role
in the reading aid and translator project by providing the visual input necessary for text
recognition and translation.

3. SD Card:

The SD card serves as the storage medium for the Raspberry Pi's operating system, software
applications, and data, ensuring reliable and efficient operation of the reading aid and translator
system. It stores the operating system, such as Raspbian, along with necessary software libraries
for image processing, OCR (Optical Character Recognition), language translation, and
accessibility features. With high-capacity options available, such as 16GB or higher, the SD card
provides ample storage space for storing captured images, translated text, and other temporary or

DEPARTMENT OF ECE 5 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

permanent data generated during the system's operation. Its compatibility with the Raspberry Pi's
SD card slot ensures easy installation and removal, facilitating software updates and data transfer
between devices. Furthermore, its durability and reliability make it suitable for prolonged use in
portable and embedded applications, ensuring the seamless operation of the reading aid and
translator system in various environments.

4. Power Supply:

The power supply provides electrical power to the Raspberry Pi and other connected
components, ensuring stable and uninterrupted operation of the reading aid and translator system.
With a voltage rating of 5V and current rating of 2.5A or higher, the power supply delivers
sufficient power to power the Raspberry Pi, webcam, and other peripherals simultaneously.
Equipped with a micro USB connector compatible with the Raspberry Pi's power input port, the
power supply ensures a secure and reliable connection, minimizing the risk of power fluctuations
or disconnections. Built-in protection features such as overvoltage protection, overcurrent
protection, and short circuit protection ensure the safety and longevity of the reading aid and
translator system, protecting it from potential damage caused by electrical faults or power surges.
Its compact and lightweight design makes it suitable for portable applications, allowing for
convenient power supply solutions in various environments.

5. Button :

To incorporate a push button into an IoT-based doorbell system using Raspberry Pi, you'll need
to connect the button to one of the GPIO (General Purpose Input/Output) pins on the Raspberry
Pi. Select a GPIO pin on the Raspberry Pi to which you'll connect the push button. You can refer
to the GPIO pinout diagram specific to your Raspberry Pi model to identify available pins.
Connect one leg of the push button to the chosen GPIO pin and connect the other leg to a ground
(GND) pin on the Raspberry Pi. When the button is pressed, it will create a connection between
the GPIO pin and ground, signaling a button press. Write a Python script to detect button presses
and trigger corresponding actions. You can use libraries like GPIO Zero to simplify GPIO
interactions in your Python code.

DEPARTMENT OF ECE 6 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

6. Buzzer :

To include a buzzer in your IoT-based doorbell system using Raspberry Pi, you'll need to
connect the buzzer to one of the GPIO pins on the Raspberry Pi. Select a GPIO pin on the
Raspberry Pi to which you'll connect the buzzer. Refer to the GPIO pinout diagram for your
Raspberry Pi model to identify available pins. Connect the positive (longer) leg of the buzzer to
the chosen GPIO pin and the negative (shorter) leg to a ground (GND) pin on the Raspberry Pi.
When the GPIO pin sends a signal, the buzzer will produce sound. Write a Python script to
control the buzzer and trigger sound output when necessary. You can use libraries like GPIO
Zero to simplify GPIO interactions in your Python code. Once you have the buzzer connected
and the script running on your Raspberry Pi, it will produce sound output through the buzzer
whenever the corresponding GPIO pin is activated. Adjust the duration and timing of the buzzer
activation as needed for your doorbell system.

1.7 REQUIREMENTS :
The requirements for an IoT-based doorbell using Raspberry Pi encompass both hardware
and software components.
Hardware Requirements:
▪ Raspberry Pi Board: Choose a suitable Raspberry Pi model (e.g., Raspberry Pi 3 or 4)
with sufficient processing power and connectivity options.
▪ Camera Module: Select a compatible camera module (e.g., Raspberry Pi Camera
Module) for capturing images or videos of visitors.
▪ Doorbell Button: Install a physical doorbell button that triggers the doorbell when
pressed by a visitor.
▪ Internet Connectivity: Ensure the Raspberry Pi has access to the internet via Wi-Fi or
Ethernet for remote access and communication.
▪ Power Supply: Provide a stable power source for the Raspberry Pi and connected
peripherals to ensure continuous operation.
Software Requirements:
▪ Operating System: Install a compatible operating system (e.g., Raspbian, Raspberry Pi
OS) on the Raspberry Pi to serve as the foundation for software development.

DEPARTMENT OF ECE 7 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

▪ Python Programming: Develop Python scripts to control the doorbell's functionalities,


interact with hardware components, and handle communication.
▪ Camera Interface: Utilize libraries such as pi camera for interfacing with the camera
module, capturing images/videos, and processing media data.
▪ GPIO Control: Use GPIO (General Purpose Input/Output) libraries like GPIO Zero to
manage interactions with the doorbell button and other peripherals connected to the
Raspberry Pi.
▪ Networking Protocols: Implement networking protocols (e.g., MQTT, HTTP) for
communication between the Raspberry Pi and remote devices (e.g., smartphones, cloud
services).

DEPARTMENT OF ECE 8 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

CHAPTER 2
LITERATURE SURVEY
In paper [1] presents how the face is recognized using algorithms such as Eigen face and
independent component analysis (ICA). Independent component analysis is written using Matlab
R2012bface recognition. This system is based on criteria of low power consumption. Hardware
components are used such as Doorbell, camera, Raspberry pi. This project uses Eigen face
algorithm using OpenCV library to perform face recognition. The script can capture the image
and convert it to gray scale image and apply Eigen face approach. To decrease the number of
images, face pictures are regenerated into twodimensional array with eight bit intensity values.

In paper [2] it is based on real time smart doorbell notification system for home security. It
enables the user to monitor visitors in real time via the IOT based doorbell installed near the
entrance doors to home. When a visitor rings the doorbell, SMS will be sent to registered mobile
number of the house member and response in the form of SMS will be displayed on LCD screen
placed beside the door so that visitor can read the SMS and act accordingly. The visitor can leave
the voice message that will be sent to house member. The Doorbell will be installed with
Arduino chip to transport and receive messages. The system uses main components like
Doorbell, wireless transmitter receiver module and LCD response. Arduino and webcam is used
to build doorbell and send SMS notification to owner with the picture of the person at door.

In paper [3], involves building a security system using HaarCascade classifier and LBPH
face recognizer available in open source computer vision (OpenCv) library. OpenCv uses
Haarcascade algorithm to detect facial features of human face. To implement the algorithm lot of
positive and negative images are used to train cascade function. Trained cascade function is used
to detect human facial features. Hardware modules used are Raspberry, camera module. Haar
feature-based cascade classifier is used to detect human faces at real time. Camera detects eyes,
nose etc which are used by Haar cascade face detection algorithm. Feed the face data to
recognizer so that it can learn. The result will be saved in .yml file. LBPH face recognizer is
used.

DEPARTMENT OF ECE 9 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

In paper [4], is based on IOT which uses raspberry pi, Pi camera module and wearable
device for the user to know about the person who is standing near the door. Notification will be
delivered by vibration from wearable device. It uses facial recognition software which takes the
captured face of the person standing near door. Wearable device is used to alert the user about
the person on the door by notifying viavibration. Captured Images are processed for feature
extraction and face detection process. It finds the match in database then Raspberry pi sends the
data which contains name of the matched face to ESP8266 using MQTT protocol. If the face
does not match with any face present in database, then raspberry pi will send the data as
UNKNOWN to ESP8266.

In paper [5], uses hardware components like camera, Speaker, Fingerprint sensors, scanner
which provides features like capturing images of unknown people taking videos, announcing
their names after scanning their fingerprints through scanner. Owner will store all the data like
fingerprint, message beside the name and other details. Fingerprint of the visitor will be scanned
by finger print sensor which will be located on button of the doorbell. The fingerprint will be
scanned and sent to raspberry pi. Raspberry pi will extract all known fingerprints stored in
database of the system. Fingerprints will be checked for the match of fingerprint scanned with
extracted fingerprint stored in database. If match found, then raspberry pi will announce the
message through speaker which is stored in database beside visitor’s name. If the match is not
found, then the default message will be announced through speakerUsing a various tools and
technologies, the authors have proposed safety applications for android and other platform users.
They suggested a various approach to assist in women's safety In this paper, they developed an
application that comes with all the unique features like real-time location tracking and integrate
all the features offered by the prevailing system like GPS tracking, SOS. the app requires an
initial registration alongside emergency contacts and therefore the user is asked to update the
emergency contacts from time to time. When the user is travelling from one place to a different
place.

DEPARTMENT OF ECE 10 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

CHAPTER 3
PROJECT METHODOLOGY AND ANALYSIS

a.WORKING PROCEDURE
The working of an IoT-based doorbell using Raspberry Pi involves a combination of hardware
setup, software implementation. Here's a step-by-step explanation of how it works:
Hardware Setup:
Connect the Raspberry Pi to the necessary components, including a camera module,
microphone, speaker, and doorbell button.Ensure all components are securely attached and
powered properly. Configure GPIO pins on the Raspberry Pi to interface with the doorbell button
and other peripherals.
Software Implementation:
Install and set up the operating system (e.g., Raspbian) on the Raspberry Pi. Develop
Python scripts to handle the doorbell's functionality, including capturing images/videos,
processing inputs from the doorbell button, and managing communication. Utilize camera
libraries (e.g., picamera) to interact with the camera module and capture media data. Implement
GPIO control using libraries like GPIO Zero to detect button presses and trigger corresponding
actions. Set up networking protocols (e.g., MQTT, HTTP) for communication between the
Raspberry Pi and remote devices. Design a user interface (mobile app, web interface) for
homeowners to interact with the doorbell system remotely.
Operation:
When a visitor presses the doorbell button, the Raspberry Pi detects the button press
through GPIO pins. The doorbell system sends instant notifications to the homeowner's devices,
alerting them of the visitor's arrival. Live video streaming is activated from the camera module,
allowing homeowners to view real-time footage of their doorstep. Optionally, the system can
record video clips or snapshots of visitors for security purposes. Homeowners can access the
doorbell system remotely via the mobile app or web interface, allowing them to monitor and
interact with visitors from anywhere.

DEPARTMENT OF ECE 11 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

b. FLOWCHART:

START

Boot-up Raspberry pi

If button is
pressed

Capture image by
camera,buzzer
sound,send
notification through
gmail

NO
If person is
authenticated Door not opened

YES

Open the door

STOP

Fig 3.1 Flowchart

DEPARTMENT OF ECE 12 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

CHAPTER 4
HARDWARE AND SOFTWARE DESCRIPTIONS
4.1 HARDWARE IMPLEMENTATION
4.1.1 Raspberry Pi Power Supply:

To make the B+ more reliable and actually reduce the current draw, the power supply is
completely redesigned.

Fig. 4.1 Raspberry Pi RPS

Fig. 4.2 RPS Schematic Diagram

DEPARTMENT OF ECE 13 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

On the left side, there is as yet a small scale USB connector and circuit 1A has been
moved up to a 2A intertwine. There is additionally a DMG2305UX P-Channel MOSFET. These
go about as an extremity assurance switch yet are significantly more "out of date" than a diode. It
just has 52mW of protection, so @ 2A is a voltage drop of around 0.1V. Most diodes would be
no less than 0.5V. Watch this great video on this system here: on the right, there is a TVS diode
projector (part D5 # SMBJ5) that ensures against the pinnacles. These lines, it has not changed
much here (notwithstanding putting a FET assurance). There is a blending coordinating PNP
around the FET extremity, yet its 3 AM and I'm not 100% beyond any doubt. Hold up to rest
before making any examination. How about we take a gander at the 3.3V and 1.8V supplies:

Fig. 4.3 Voltage Converter


Rather than the LDO controllers that emanate warm, we now have twofold dollar
converters. These are high-effectiveness converters that can take 5V up to 3.3V or 1.8V with no
warmth misfortune. They are more costly than LDO, however not awfully. The twofold buck
passage is 5V (VIN1 and VIN2), for reasons unknown, there is no part number checked yet has
12 legs, it is a DFN molded part (I involve DFN throughout the day to have the capacity to
distinguish them) and has the code of brand C2 = CGU0G. With some searching for a twofold
12, DFN Buck with 1.8V and 3.3V settled yields.

A regulated power supply is an embedded circuit; it converts unregulated AC into a


constant DC. With the help of a rectifier it converts AC supply into DC. Its function is to supply

DEPARTMENT OF ECE 14 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

a stable voltage (or less often current), to a circuit or device that must be operated within certain
power supply limits. The output from the regulated power supply may be alternating or
unidirectional, but is nearly always DC.

4.1.2 Introduction To Raspberry Pi:


Raspberry Pi is a small single board computer. By connecting peripherals like Keyboard,
mouse, display to the Raspberry Pi, it will act as a mini personal computer. Raspberry Pi is
popularly used for real time Image/Video Processing; IoT based applications and Robotics
applications.

Raspberry Pi is slower than laptop or desktop but is still a computer which can provide all
the expected features or abilities, at low power consumption. Raspberry Pi Foundation officially
provides Debian based Raspbian OS. Also, they provide NOOBS OS for Raspberry Pi. We can
install several Third-Party versions of OS like Ubuntu, Archlinux, RISC OS, Windows 10 IOT
Core, etc.Raspbian OS is official Operating System available for free to use. This OS is
efficiently optimized to use with Raspberry Pi. Raspbian have GUI which includes tools for
Browsing, Python programming, office, games, etc.

We should use SD card (minimum 8 GB recommended) to store the OS (operating


System). Raspberry Pi is more than computer as it provides access to the on-chip hardware i.e.
GPIOs for developing an application. By accessing GPIO, we can connect devices like LED,
motors, sensors, etc and can control them too.

It has ARM based Broadcom Processor SoC along with on-chip GPU (Graphics
Processing Unit). The CPU speed of Raspberry Pi varies from 700 MHz to 1.2 GHz. Also, it has
on-board SDRAM that ranges from 256 MB to 1 GB. Raspberry Pi also provides on-chip SPI,
I2C, I2S and UART modules.

There are different versions of raspberry pi available as listed below:

1. Raspberry Pi 1 Model A
2. Raspberry Pi 1 Model A+
3. Raspberry Pi 1 Model B

DEPARTMENT OF ECE 15 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

4. Raspberry Pi 1 Model B+
5. Raspberry Pi 2 Model B
6. Raspberry Pi 3 Model B
7. Raspberry Pi Zero

Fig 4.4. Different versions of raspberry pi

DEPARTMENT OF ECE 16 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Out of the above versions of Raspberry Pi, more prominently use Raspberry Pi and their features

are as follows

Raspberry Pi Raspberry Pi 2 Raspberry Pi 3 Raspberry Pi


Features
Model B+ Model B Model B Zero

SoC BCM2835 BCM2836 BCM2837 BCM2835

CPU ARM11 Quad Cortex A7 Quad Cortex A53 ARM11

Operating
700 MHz 900 MHz 1.2 GHz 1 GHz
Freq.

512 MB
RAM 512 MB SDRAM 1 GB SDRAM 1 GB SDRAM
SDRAM

250 MHz 250MHz 400 MHz 250MHz


GPU
Videocore IV Videocore IV Videocore IV Videocore IV

Storage micro-SD Micro-SD micro-SD micro-SD

Ethernet Yes Yes Yes No

Wi-Fi and
Wireless No No No
Bluetooth

Table 4.1. Versions of Raspberry Pi and their Features

DEPARTMENT OF ECE 17 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Raspberry Pi Zero:

Fig 4.5. Raspberry Pi Zero

Raspberry Pi 3 Board:

Fig 4.6. Raspberry Pi 3 Board

Raspberry Pi 3 On-chip Hardware :


The On-chip hardware of Raspberry Pi 3 (here) is as shown in below figure

DEPARTMENT OF ECE 18 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Fig 4.7. Raspberry Pi 3 On-chip Hardware

Raspberry Pi 3 Model B Hardware


Some Hardware Components shown above are mention below:

1. HDMI (High-Definition Multimedia Interface): It is used for transmitting


uncompressed video or digital audio data to the Computer Monitor, Digital TV, etc.
Generally, this HDMI port helps to connect Raspberry Pi to the Digital television.
2. CSI Camera Interface: CSI (Camera Serial Interface) interface provides a connection in
between Broadcom Processor and Pi camera. This interface provides electrical
connections between two devices.
3. DSI Display Interface: DSI (Display Serial Interface) Display Interface is used for
connecting LCD to the Raspberry Pi using 15-pin ribbon cable. DSI provides fast High-
resolution display interface specifically used for sending video data directly from GPU to
the LCD display.
4. Composite Video and Audio Output: The composite Video and Audio output port
carries video along with audio signal to the Audio/Video systems.
5. Power LED: It is a RED colored LED which is used for Power indication. This LED will
turn ON when Power is connected to the Raspberry Pi. It is connected to 5V directly and
will start blinking whenever the supply voltage drops below 4.63V.
6. ACT PWR: ACT PWR is Green LED which shows the SD card activity.

DEPARTMENT OF ECE 19 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

4.1.3 Arm Architecture:

The ARM is a 32-bit RISC design created by ARM Organization. ARM processors have
a remarkable blend of highlights that make ARM the most well known coordinated engineering
today. To begin with, ARM bodies are extremely basic contrasted with most other universally
useful processors, which implies they can be made utilizing a generally modest number of
transistors, leaving space on the application-particular macrocells chip.

A run of the mill ARM chip can contain a few fringe controllers, a computerized flag
processor, and a specific measure of memory on the chip, alongside an ARM center. Besides,
both ISA ARM and pipeline configuration are intended to limit vitality utilization, a basic
prerequisite in portable incorporated frameworks. Thirdly, ARM engineering is exceedingly
measured: the main necessary part of an ARM processor is the whole pipe; Every other segment,
including store, MMU, drifting point, and other co-processors, are discretionary, giving you a lot
of adaptabilities to make application-based ARM-based processors. At long last, being little and
low power, ARM processors offer elite for coordinated applications. For instance, the PXA255
XScale processor that keeps running at 400 MHz gives practically identical execution to Pentium
2 at 300 MHz

ARM vs RISC:
In many regards, the ARM is the RISC design. Like all RISC designs, the ISA ARM is a
heap chronicle, that is, directions that handle information just in registers and are separate from
the guidelines that entrance memory. All ARM directions are 32-bits in length and the greater
part of them have a standard coding of three operands. In conclusion, ARM engineering has a
substantial log record with 16 general utility logs. All the above highlights encourage the
diverting of the ARM design. In any case, ARM design has veered off from RISC engineering in
a few viewpoints to enhance its execution. The ARM did exclude registry windows that utilized
the first RISC models to lessen many-sided quality. ARM engineering has presented a
programmed ordering mode where the estimation of a list record is expanded or diminished
while a heap or file is in advance. ARM underpins various record exchange directions that enable
you to load or amass to 16 records at once.

DEPARTMENT OF ECE 20 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Thumb instruction set:

The Thumb direction set was presented in the fourth form of the ARM design to get a
higher code thickness for incorporated applications. Thumb gives a subset of the most widely
recognized 32-bit ARM directions that have been packed in 16-bit working codes. At the run,
these 16-bit guidelines can be decompressed to every one of the 32-bit ARM guidelines or
executed straightforwardly utilizing a thumb deciphering unit. In spite of the fact that the thumb
code utilizes 40% a bigger number of guidelines than the ARM code identical to 32 bits, it, for
the most part, requires 30% less space. Thumb code is 40% slower than ARM code; in this way,
the thumb is for the most part just utilized as a part of basic schedules that are not an elite to
diminish memory and power utilization of the framework.

ARM1176JZF-S PROCESSOR:
It bolsters ARM and Thumb guideline sets, Jazelle innovation to permit coordinate
execution of Java bytecodes and a scope of SIMD DSP directions that work in 16 bits or 8 bits.
The ARM1176JZF-S processor consolidates a whole center that actualizes the ARM11 ARM
design information esteems in 32-bit registers.

DEPARTMENT OF ECE 21 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Fig. 4.8 ARM11 Processor Architecture

THE Arm1176jzf-S Processor Features:


• TrustZone™ security extensions

• Provision for Intelligent Energy Management (IEM™)

• High-speed Advanced Microprocessor Bus Architecture (AMBA) Advanced Extensible


Interface (AXI) level two interfaces supporting prioritized multiprocessor
implementations.

• An integer core with integral EmbeddedICE-RT logic An eight-stage pipeline

DEPARTMENT OF ECE 22 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

• Branch prediction with return stack Low interrupt latency configuration Internal
coprocessors CP14 and CP15

• Vector Floating-Point (VFP) coprocessor support External coprocessor interface

• Instruction and Data Memory Management Units (MMUs), managed using MicroTLB
structures backed by a unified Main TLB

• Instruction and data caches, including a non-blocking data cache with Hit-Under-Miss
(HUM)

• Virtually indexed and physically addressed caches 64-bit interface to both caches.

• Level one Tightly-Coupled Memory (TCM) that you can use as a local RAM with

• DMA

• Trace support

• JTAG-based debug.

Extensions to ARMv6
A genuine altering guideline and execution directions. Structural recuperation. Limiting
the store estimate utilizing the CP15 articulations by byte, half words and twofold words, and
another Unmistakable Restrictive c1 explanation. You can restrain the reserve size to 16 KB for
unsupported working frameworks (OSs). The ARM1176JZF-S processor offers help for ARMv6
expansions.

Updated utilization of TEX changes bits. The ARMv6 MMU page table descriptors
utilize countless to depict all catch alternatives for both inner and outer. Actually, it is trusted
that no application requires these choices in the meantime. Thus, you can arrange the
ARM1176JZF-S processor to help just a few alternatives utilizing the TAP remap system. This
suggests an aberrant level in the page table assignments. The TEX CB encoding table gives two-
page table bits oversaw by the working framework. For double similarity with existing ARMv6

DEPARTMENT OF ECE 23 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

working frameworks ports, this gives a particular method of operation of the MMU. This is
called TEX remap design and is controlled by bit [28] TR in CP15 Enlist 1.

On the ARM1176JZF-S processor, the AP111 and AP [1: 0] b111 coding are perused
just benefits or client mode get to. AP [0] shows a sort of intrude on, the Bit get to mistake when
CP15 c1 is 1.

ARM1176JZF-S Architecture With Jazelle Technology:

The ARM1176JZF-S processor has three instruction sets:


• The 32-bit ARM instruction set used in ARM state, with media instructions.
• The 16-bit Thumb instruction set used in Thumb state.
• The 8-bit Java bytecodes used in Jazelle state
Instruction Compression:
A regular 32-bit engineering can deal with 32-bit whole numbers with straightforward
directions and address a considerably more effective address space than a 16-bit design. When
preparing 32-bit information, a 16-bit design requires no less than two guidelines to play out an
indistinguishable undertaking from a solitary piece 32-bit proclamation. At the point when a 16-
bit design has just 16-bit directions and a 32-bit engineering has just 32-bit guidelines, 16-bit
engineering, for the most part, has a higher code thickness and the greater part of the design's
execution. 32 bit. Thumb executes a 16-bit direction set in a 32-bit engineering that offers better
execution than a 16-bit design, with a higher code thickness than a 32-bit design. The
ARM1176JZ-S processor can without much of a stretch switch between running in ARM status
and running in Thumb state. This enables you to improve both code thickness and execution to
better suit your application needs.

Thumb Instruction Set:


The Thumb direction set is a subset of the most widely recognized 32-bit ARM
guidelines. Thumb directions are 16 bits in length and have a relating 32-bit ARM guideline that
has a similar impact on the processor's model. Thumb guidelines work with the standard ARM
log design, empowering magnificent interoperability amongst ARM and Thumb.

DEPARTMENT OF ECE 24 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Thumb has every one of the benefits of a 32-bit center:

• 32-bit address space.

• 32-bit registers.

• 32-bit shifter and Number-crunching Rationale Unit (ALU).

• 32-bit memory exchange.


Thumb, in this manner, offers a Long Branch go, intense math operations, and an
extensive address space. The accessibility of ARM Thumb and 32-bit ARM guideline sets offers
the adaptability to stress execution or code estimate at subroutine level, as indicated by
application necessities. For instance, you can encode basic cycles for applications, for example,
quick intrusions and DSP calculations utilizing the ARM guideline set finished and connected to
Thumb code.

Java Bytecodes

ARM architecture v6 with Jazelle technology executes variable length Java bytecodes.
Java bytecodes fall into two classes:

Hardware execution: Bytecodes that perform stack-based operations.


Software execution: Bytecodes that are too complex to execute directly in hardware are
executed in software. An ARM register is used to access a table of exception handlers to handle
these particular bytecodes.

Components Of The Processor:


The main components of the ARM1176JZF-S processor are:

• Integer core.
• Load-Store Unit (LSU).
• Prefetch unit.
• Memory system.
• AMBA AXI interface.
• Coprocessor interface.

DEPARTMENT OF ECE 25 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

• Debug.
• Instruction cycle summary and interlocks.
• Vector Floating-Point (VFP).
• System control.
• Interrupt handling.

Fig. 4.9 the structure of the ARM1176JZF-S-process

Pipeline Stages

• The two Fetch stages


• A Decode stage
• An Issue stage
• The four stages of the ARM1176JZF-S integer execution pipeline. These eight stages
make up the processor pipeline.

DEPARTMENT OF ECE 26 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Fig 4.10 ARM1176JZF-S pipeline stages


The pipeline operations are:
Fe1: First stage of instruction fetch where address is issued to memory and data returns from
memory

Fe2: Second stage of instruction fetches and branch prediction.

De: Instruction decodes.

Iss: Register read and instruction issue.

Sh: Shifter stage.

ALU: Main integer operation calculation.

Sat: Pipeline stage to enable saturation of integer results.

WBex: Write back to data from the multiple or main execution pipelines.

MAC1: First stage of the multiply-accumulate pipeline.

MAC2: Second stage of the multiply-accumulate pipeline.

MAC3: Third stage of the multiply-accumulate pipeline.

ADD: Address generation stage.

DC1: First stage of data cache access.

DC2: Second stage of data cache access.

DEPARTMENT OF ECE 27 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

WBls: Write back to data from the Load Store Unit.

By overlapping the various stages of operation, the ARM1176JZF-S processor


maximizes the clock rate achievable to execute each instruction. It delivers a throughput
approaching one instruction for each cycle.

Processor Operating States


The processor has these operating states:

• ARM state 32-bit, word-aligned ARM instructions are executed in this state.
• Thumb state 16-bit, half word-aligned Thumb instructions.
• Jazelle state Variable length, byte-aligned Java instructions.
In Thumb state, the Program Counter (PC) uses bit 1 to select between alternate half
words. In Jazelle state, all instruction fetches are in words.

Switching state:You can switch the operating state of the processor between ARM state and
Thumb state using the BX and BLX instructions, and loads to the PC. The ARM Architecture
Reference Manual describes the switching state.

ARM state and Jazelle state using the BXJ instruction. All exceptions are entered,
handled, and exited in ARM state. If an exception occurs in Thumb state or Jazelle state, the
processor reverts to ARM state. Exception return instructions restore the SPSR to the CPSR that
can also cause a transition back to Thumb state or Jazelle state.

Interworking ARM and Thumb state:


The processor enables you to mix ARM and Thumb code. For details see the chapter
about interworking ARM and Thumb in the Real View Compilation Tools Developer Guide.

Instruction length: Instructions are one of


• 32 bits long, in ARM state. 16 bits long, in Thumb state.
• Variable length, multiples of 8 bits, in Jazelle state.
Data types: The processor supports the following data types:

• Word, 32-bit.

DEPARTMENT OF ECE 28 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

• Halfword, 16-bit. Byte, 8-bit.


For best performance you must align these as follows:

• Word quantities must be aligned to four-byte boundaries.


• Halfword quantities must be aligned to two-byte boundaries. Byte quantities can be placed on
any byte boundary.
Operating Modes: In all states there are eight modes of operation:
User mode is the usual ARM program execution state and is used for executing most
application programs.

• Fast interrupt (FIQ) mode is used for handling fast interrupts.


• Interrupt (IRQ) mode is used for general-purpose interrupt handling. Supervisor mode is
a protected mode for the OS.
• Abort mode is entered after a data abort or prefetch abort. System mode is a privileged
user mode for the OS.
• The undefined mode is entered when an undefined instruction exception occurs.
• Secure Monitor mode is a secure mode for the Trust Zone Secure Monitor code.
Registers:

The processor has a total of 40 registers

• 33 general-purpose 32-bit registers.


• Seven 32-bit status registers.

4.1.4 SD Card :
Secure Digital, officially abbreviated as SD, is a non-volatile memory card format
developed by the SD Card Association (SDA) for use in portable devices.The standard was
introduced in August 1999 by joint efforts between SanDisk, Panasonic (Matsushita Electric)
and Toshiba as an improvement over Multimedia Cards (MMC),[1] and has become the industry
standard. The three companies formed SD-3C, LLC, a company that licenses and enforces
intellectual property rights associated with SD memory cards and SD host and ancillary
products.[2]The companies also formed the SD Association (SDA), a non-profit organization, in

DEPARTMENT OF ECE 29 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

January 2000 to promote and create SD Card standards.[3] SDA today has about 1,000 member
companies. The SDA uses several trademarked logos owned and licensed by SD-3C to enforce
compliance with its specifications and assure users of compatibility.

History:
In 1999, SanDisk, Matsushita, and Toshiba agreed to develop and market the Secure
Digital (SD) Memory Card. The card was derived from the Multimedia Card (MMC) and
provided digital rights management based on the Secure Digital Music Initiative (SDMI)
standard and for the time, a high memory density. It was designed to compete with the Memory
Stick, a DRM product that Sony had released the year before. Developers predicted that DRM
would induce wide use by music suppliers concerned about piracy.[6]
The trademarked logo was originally developed for the Super Density Disc, which was
the unsuccessful Toshiba entry in the DVD format war. For this reason the D within the logo
resembles an optical disc. At the 2000 Consumer Electronics Show (CES) trade show, the three
companies announced the creation of the SD Association (SDA) to promote SD cards. The SD
Association, headquartered in San Ramon, California, United States, started with about 30
companies and today consists of about 1,000 product manufacturers that make interoperable
memory cards and devices. Early samples of the SD Card became available in the first quarter of
2000, with production quantities of 32 and 64 MB cards available three months later.
Mini-cards:

Since 2008, miniSD cards were no longer produced.The miniSD form was introduced at
March 2003 CeBIT by SanDisk Corporation which announced and demonstrated it. The SDA [7]

adopted the miniSD card in 2003 as a small form factor extension to the SD card standard. While
the new cards were designed especially for mobile phones, they are usually packaged with a
miniSD adapter that provides compatibility with a standard SD memory card slot.In September
2006, SanDisk announced the 4 GB miniSDHC. Like the SD and SDHC, the miniSDHC card
[8]

has the same form factor as the older miniSD card but the HC card requires HC support built into
the host device. Devices that support miniSDHC work with miniSD and miniSDHC, but devices
without specific support for miniSDHC work only with the older miniSD.

DEPARTMENT OF ECE 30 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Micro SD cards:
The microSD removable miniaturized Secure Digital flash memory cards were originally
named T-Flash or TF, abbreviations of TransFlash. TransFlash and microSD cards are
functionally identical allowing either to operate in devices made for the other. SanDisk had
[9]

conceived microSD when its chief technology officer and the chief technology officer
of Motorola concluded that current memory cards were too large for mobile phones. The card
was originally called T-Flash, but just before product launch, T-Mobile sent a cease-and-
desist letter to SanDisk claiming that T-Mobile owned the trademark on T-(anything), and the
name was changed to TransFlash. At CTIA Wireless 2005, the SDA announced the
small microSD form factor along with SDHC secure digital high capacity formatting in excess
of 2 GB with a minimum sustained read and write speed of 17.6 Mbit/s. SanDisk induced the
SDA to administer the microSD standard. The SDA approved the final microSD specification on
July 13, 2005. Initially, microSD cards were available in capacities of 32, 64, and 128 MB. The
Motorola E398 was the first mobile phone to contain a TransFlash (later microSD) card. A few
years later, their competitors began using microSD cards.

4.1.5 Push-Button:
A push-button (also spelled pushbutton) or simply button is a simple switch mechanism
for controlling some aspect of a machine or a process. Buttons are typically made out of hard
material, usually plastic or metal. The surface is usually flat or shaped to accommodate the
human finger or hand, so as to be easily depressed or pushed. Buttons are most often biased
switches, although many un-biased buttons (due to their physical nature) still require a spring to
return to their un-pushed state. Different people use different terms for the "pushing" of the
button, such as press, depress, mash, hit, and punch.

The "push-button" has been utilized in calculators, push-button telephones, kitchen


appliances, and various other mechanical and electronic devices, home and commercial. In
industrial and commercial applications, push buttons can be connected together by a mechanical
linkage so that the act of pushing one button causes the other button to be released. In this way, a
stop button can "force" a start button to be released. This method of linkage is used in simple
manual operations in which the machine or process has no electrical circuits for control.

DEPARTMENT OF ECE 31 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Fig 4.11: Push Button


To avoid the operator from pushing the wrong button in error, pushbuttons are
often color-coded to associate them with their function. Commonly used colors are red for
stopping the machine or process and green for starting the machine or process.

Red pushbuttons can also have large heads (called mushroom heads) for easy operation
and to facilitate the stopping of a machine. These pushbuttons are called emergency stop buttons
and for increased safety are mandated by the electrical code in many jurisdictions. This large
mushroom shape can also be found in buttons for use with operators who need to wear gloves for
their work and could not actuate a regular flush-mounted push button. As an aid for operators
and users in industrial or commercial applications, a pilot light is commonly added to draw the
attention of the user and to provide feedback if the button is pushed. Typically this light is
included into the center of the pushbutton and a lens replaces the pushbutton hard center disk.
The source of the energy to illuminate the light is not directly tied to the contacts on the back of
the pushbutton but to the action the pushbutton controls. In this way a start button when pushed
will cause the process or machine operation to be started and a secondary contact designed into
the operation or process will close to turn on the pilot light and signify the action of pushing the
button caused the resultant process or action to start.

In popular culture, the phrase "the button" (sometimes capitalized) refers to a (usually
fictional) button that a military or government leader could press to launch nuclear weapons.

4.1.6 Buzzer:

The piezo buzzer produces sound based on reverse of the piezoelectric effect. The
generation of pressure variation or strain by the application of electric potential across a
piezoelectric material is the underlying principle. These buzzers can be used alert a user of an

DEPARTMENT OF ECE 32 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

event corresponding to a switching action, counter signal or sensor input. They are also used in
alarm circuits.
The buzzer produces a same noisy sound irrespective of the voltage variation applied to
it. It consists of piezo crystals between two conductors. When a potential is applied across these
crystals, they push on one conductor and pull on the other. This, push and pull action, results in a
sound wave. Most buzzers produce sound in the range of 2 to 4 kHz.

Fig.4.12: Buzzer

4.1.7 USB Camera:

USB Cameras are imaging cameras that use USB 2.0 or USB 3.0 technology to transfer
image data. USB Cameras are designed to easily interface with dedicated computer systems by
using the same USB technology that is found on most computers. The accessibility of USB
technology in computer systems as well as the 480 Mb/s transfer rate of USB 2.0 makes USB
Cameras ideal for many imaging applications. An increasing selection of USB 3.0 Cameras is
also available with data transfer rates of up to 5 Gb/s.

DEPARTMENT OF ECE 33 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Fig 4.13 USB Camera

Edmund Optics offers a variety of USB Cameras suited to meet many imaging needs. EO
USB Cameras are available in both CMOS as well as CCD sensor types making them suitable
across a larger range of applications. USB Cameras contain out-of-the-box functionality for
quick setup. USB Cameras using low power USB ports, such as on a laptop, may require a
separate power supply for operation.

Specifications:

• Built-in mic with noise reduction


• Interpolated to 25 Mega Pixels
• 10 Level Zoom on live Motion Picture
• Special Visual Effects
• True Motion Picture
• Night Vision
6 Bright light switch ON through switch and potentiometer
• Inbuilt Sensitive Microphone
• Background Changeable of Live Motion Picture
• UP TO 30% Better Exposure To Give better Picture Even in dark
• Auto Exposure
• Special Face Effects
• USB 2.0

DEPARTMENT OF ECE 34 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Function Details:

• 10 Level Zoom: on live Motion Picture


• Background Changeable: of Live Motion Picture
• UP TO 30% Better Exposure: To Give better Picture Even in dark
• Special Face Effects
• Resolution Hardware : 500K pixels
• Image Quality: RGB24 or I420
• Exposure : Auto or manual, Angle of View 58 o
• Interface : USB2.0
• Frame Rate: 30 fps (MAX)
• Lens f=6.0 F=2.0
• Focus Range 4cm to infinity
• Colour Option: Black
• Supports: Windows Vista®, Windows® 7, Linux or Windows® 8
• Basic requirements: 1 Ghz, 512 MB RAM or more, 200 MB hard drive space, Internet
connection
• USB 1.1 port (2.0 recommended)
• DIMENSIONS: 5.8 x 7.8 x 5.5 cm (Camera)
• Weight: 175g

4.1.8 Regulator Power Supply

A regulated power supply is an embedded circuit; it converts unregulated AC into a


constant DC. With the help of a rectifier it converts AC supply into DC. Its function is to supply
a stable voltage (or less often current), to a circuit or device that must be operated within certain
power supply limits. The output from the regulated power supply may be alternating or
unidirectional, but is nearly always DC.

DEPARTMENT OF ECE 35 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Fig 4.14 Regulated Power Supply


A regulated DC power supply is also called as a linear power supply; it is an embedded
circuit and consists of various blocks.
The regulated power supply will accept an AC input and give a constant DC output.
Figure below shows the block diagram of a typical regulated DC power supply.

Fig 4.15 Components of typical linear power supply

The basic building blocks of a regulated DC power supply are as follows:

1. A step down transformer


2. A rectifier
3. A DC filter
4. A regulator

DEPARTMENT OF ECE 36 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Operation of Regulated Power Supply:


Step Down Transformer:

A step down transformer will step down the voltage from the ac mains to the required
voltage level. The turn’s ratio of the transformer is so adjusted such as to obtain the required
voltage value. The output of the transformer is given as an input to the rectifier circuit.
Rectification:

Rectifier is an electronic circuit consisting of diodes which carries out the rectification
process. Rectification is the process of converting an alternating voltage or current into
corresponding direct (DC) quantity. The input to a rectifier is ac whereas its output is
unidirectional pulsating DC. Usually a full wave rectifier or a bridge rectifier is used to rectify
both the half cycles of the ac supply (full wave rectification). Figure below shows a full wave
bridge rectifier.

Fig 4.16. Full wave Rectifier Bridge

A bridge rectifier consists of four p-n junction diodes connected in the above shown
manner. In the positive half cycle of the supply the voltage induced across the secondary of the
electrical transformer i.e. VMN is positive. Therefore point E is positive with respect to F.
Hence, diodes D and D are reversed biased and diodes D and D are forward biased. The diode
3 2 1 4

D and D will act as open switches (practically there is some voltage drop) and diodes D andD
3 2 1 4

will act as closed switches and will start conducting. Hence a rectified waveform appears at the

DEPARTMENT OF ECE 37 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

output of the rectifier as shown in the first figure. When voltage induced in secondary i.e. VMN
is negative than D and D are forward biased with the other two reversed biased and a positive
3 2

voltage appears at the input of the filter.


DC Filtration:

The rectified voltage from the rectifier is a pulsating DC voltage having very high ripple
content. But this is not we want, we want a pure ripple free DC waveform. Hence a filter is used.
Different types of filters are used such as capacitor filter, LC filter, Choke input filter, π type
filter. Figure below shows a capacitor filter connected along the output of the rectifier and the
resultant output waveform.

Fig 4.17 Resultant Output Waveform

As the instantaneous voltage starts increasing the capacitor charges, it charges till the
waveform reaches its peak value. When the instantaneous value starts reducing the capacitor
starts discharging exponentially and slowly through the load (input of the regulator in this case).
Hence, an almost constant DC value having very less ripple content is obtained.

DEPARTMENT OF ECE 38 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Regulation:

This is the last block in a regulated DC power supply. The output voltage or current will
change or fluctuate when there is change in the input from ac mains or due to change in load
current at the output of the regulated power supply or due to other factors like temperature
changes. This problem can be eliminated by using a regulator. A regulator will maintain the
output constant even when changes at the input or any other changes occur. Transistor series
regulator, Fixed and variable IC regulators or a Zener diode operated in the zener region can be
used depending on their applications. IC’s like 78XX and 79XX are used to obtained fixed
values of voltages at the output.

4.2 SOFTWARE IMPLEMENTATION


4.2.1 Operating System
The Raspberry Pi primarily uses Linux kernel-based operating systems. The ARM11 is based
on version 6 of the ARM which is no longer supported by several popular versions of Linux,
including Ubuntu. The install manager for Raspberry Pi is NOOBS. The OSs included with
NOOBS are:

• Archlinux ARM
• OpenELEC
• Pidora (Fedora Remix)
• Raspbmc and the XBMC open source digital media center
• RISC OS – The operating system of the first ARM-based computer
• Raspbian (recommended) – Maintained independently of the Foundation; based on ARM
hard-float (armhf)-Debian 7 'Wheezy' architecture port, that was designed for a newer
ARMv7 processor whose binaries would not work on the Rapberry Pi, but Raspbian is
compiled for the ARMv6 instruction set of the Raspberry Pi making it work but with
slower performance. It provides some available deb software packages, pre-compiled
software bundles. A minimum size of 2 GB SD card is required, but a 4 GB SD card or
above is recommended. There is a Pi Store for exchanging programs. The 'Raspbian

DEPARTMENT OF ECE 39 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Server Edition (RSEv2.4)', is a stripped version with other software packages bundled as
compared to the usual desktop computer oriented Raspbian.

4.2.2 Boot Process:


The Raspberry Pi does not boot as a traditional computer. The VideoCore i.e. the
Graphics processor actually boots before the ARM CPU.

The boot process of the Raspberry Pi can be explained as follows:

• When the power is turned on, the first bits of code to run is stored in a ROM chip in the
SoC and is built into the Pi during manufacture. This is the called the first-stage
bootloader.
• The SoC is hardwired to run this code on startup on a small RISC Core (Reduced
Instruction Set Computer). It is used to mount the FAT32 boot partition in theSDCard so
that the second-stage bootloader can be accessed. So what is this ‘second-stage
bootloader’ stored in the SD Card? It’s ‘bootcode.bin’. This file can be seen while mount
process of an operating system on the SD Card in windows.
• Now here’s something tricky. The first-stage bootloader has not yet initialized the ARM
CPU (meaning CPU is in reset) or the RAM. So, the second-stage bootloader also has to
run on the GPU. The bootloader.bin file is loaded into the 128K 4 way set associative L2
cache of the GPU and then executed. This enables the RAM and loads start.elf which is
also in the SD Card. This is the third-stage bootloader and is also the most important.
It is the firmware for the GPU, meaning it contains the settings or in our case, has
instructions to load the settings from config.txt which is also in the SD Card. We can
think of the config.txt as the ‘BIOS settings’.
• The start.elfalso splits the RAM between the GPU and the ARM CPU. The ARM only
has access the to the address space left over by the GPU address space. For example, if
the GPU was allocated addresses from 0x000F000 – 0x0000FFFF, the ARM has access
to addresses from 0x00000000 – 0x0000EFFF.
• The physical addresses perceived by the ARM core is actually mapped to another address
in the VideoCore (0xC0000000 and beyond) by the MMU (Memory Management Unit)
of the VideoCore.

DEPARTMENT OF ECE 40 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

• The config.txt is loaded afterthe split is done so the splitting amounts cannot be specified
in the config.txt. However, different .elf files having different splits exist in the SD Card.
So, depending on the requirement, the file can be renamed to start.elf and boot the Pi. In
the Pi, the GPU is King!
• Other than loading config.txt and splitting RAM, the start.elfalso loads cmdline.txt if it
exists. It contains the command line parameters for whatever kernel that is to be loaded.
This brings us to the final stage of the boot process. The start.elf finally
loads kernel.img which is the binary file containing the OS kernel and releases the
reset on the CPU. The ARM CPU then executes whatever instructions in the
kernel.img thereby loading the operating system.
• After starting the operating system, the GPU code is not unloaded. In fact, start.elf is not
just firmware for the GPU, It is a proprietary operating system called VideoCore OS
(VCOS). When the normal OS (Linux) requires an element not directly accessible to it,
Linux communicates with VCOS using the mailbox messaging system

DEPARTMENT OF ECE 41 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Fig 4.18 : Boot process of Raspberry Pi

The Noobs Installer

The Raspberry Pi package only comes with the main board and nothing else. It
does not come shipped with an operating system. Operating systems are loaded on a SD card
from a computer and then the SD card is inserted in the Pi which becomes the primary boot
device.

Installing operating system can be easy for some enthusiasts, but for some beginners
working with image files of operating systems can be difficult. So the Raspberry Pi foundation
made a software called NOOBS – New Out Of Box Software which eases the process of
installing an operating system on the Pi.

DEPARTMENT OF ECE 42 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

The NOOBS installer can be downloaded from the official website. A user only needs to
connect a SD card with the computer and just run the setup file to install NOOBS on the SD
card. Next, insert the card on the Raspberry Pi. On booting the first time, the NOOBS interface is
loaded and the user can select from a list of operating systems to install. It is much convenient to
install the operating system this way. Also once the operating system is installed on the card with
the NOOBS installer, every time the Pi boots, a recovery mode provided by the NOOBS can be
accessed by holding the shift key during boot. It also allows editing of the config.txt file for the
operating system.

4.2.3. Introduction To Python:

Python is developed by Guido van Rossum. Guido van Rossum started implementing
Python in 1989. Python is a very simple programming language so even if you are new to
programming, you can learn python without facing any issues.Interesting fact: Python is named
after the comedy television show Monty Python’s Flying Circus. It is not named after the Python
snake.
Features of Python programming language:

Fig 4.19. Features of Python


▪ Readable: Python is a very readable language.
▪ Easy to Learn: Learning python is easy as this is a expressive and high level
programming language, which means it is easy to understand the language and thus easy
to learn.

DEPARTMENT OF ECE 43 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

▪ Cross platform: Python is available and can run on various operating systems such as
Mac, Windows, Linux, Unix etc. This makes it a cross platform and portable language.
▪ Open Source: Python is a open source programming language.
▪ Large standard library: Python comes with a large standard library that has some
handy codes and functions which we can use while writing code in Python.
▪ Free: Python is free to download and use. This means you can download it for free and
use it in your application. See: Open Source Python License. Python is an example of a
FLOSS (Free/Libre Open Source Software), which means you can freely distribute copies
of this software, read its source code and modify it.
▪ Supports exception handling: If you are new, you may wonder what is an exception?
An exception is an event that can occur during program exception and can disrupt the
normal flow of program. Python supports exception handling which means we can write
less error prone code and can test various scenarios that can cause an exception later on.
▪ Advanced features: Supports generators and list comprehensions. We will cover these
features later.
▪ Automatic memory management: Python supports automatic memory management
which means the memory is cleared and freed automatically. You do not have to bother
clearing the memory.

What Can You Do with Python?

You may be wondering what all are the applications of Python. There are so many
applications of Python; here are some of the them.

Web development – Web framework like Django and Flask are based on Python. They help you
write server side code which helps you manage database, write backend programming logic,
mapping urls etc.

Machine learning – There are many machine learning applications written in Python. Machine
learning is a way to write a logic so that a machine can learn and solve a particular problem on
its own. For example, products recommendation in websites like Amazon, Flipkart, eBay etc. is a

DEPARTMENT OF ECE 44 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

machine learning algorithm that recognises user’s interest. Face recognition and Voice
recognition in your phone is another example of machine learning.

Data Analysis – Data analysis and data visualization in form of charts can also be developed
using Python.
Scripting – Scripting is writing small programs to automate simple tasks such as sending
automated response emails etc. Such type of applications can also be written in Python
programming language.
Game development – You can develop games using Python.
You can develop embedded applications in Python.
Desktop applications – You can develop desktop application in Python using library like
TKinter or QT.

4.2.4 How To Setup A Raspberry Pi Without A Monitor Or Keyboard:

Fig. 4.20. Raspberry Pi Development Board

The Raspberry Pi is loads of amusing to try different things with and will show you a
considerable measure about PCs. I think anybody inspired by finding out about PCs or the web

DEPARTMENT OF ECE 45 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

ought to have one. The main impediment with the Raspberry Pi is that it doesn't accompany a
screen or console. You can interface an outer screen to it, however many individuals run it
"headless". Headless means we can work it without the console and screen us are accustomed to
having on generic PCs. This is all simple to do, regardless of the possibility that you have never
booted your Raspberry Pi. You needn't bother with a screen and console to utilize your
Raspberry Pi. All you require is another PC with web get to and an SD card per user, an Ethernet
link, and access to your switch to connect to the Ethernet link.

I will disclose how to set up your Raspberry Pi out of the blue without a screen and
console. We will utilize a remote SSH association with getting to the summon incite of the Pi to
do the underlying setup and introduce the bundles for a desktop interface (GUI). After we boot
up the Pi out of the blue, we will have the capacity to design it to keep running from the summon
provoke or the desktop by means of a remote desktop application.

Gather All The Pieces:


The first step is to download Raspbian, the operating system which I will be using in this
tutorial.

Just download the ZIP file, and Extract it to a new folder on your Mac or PC. You will
now have a single .img image file containing the Raspbian operating system:

DEPARTMENT OF ECE 46 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Next, we will require a program that can compose the Raspbian working framework
picture document onto an SD or microSD card. Win32DiskImager will do this, so download and
introduce it to your Macintosh or PC.
Presently, we will require an approach to get to the summon incite of our Raspberry Pi
over our home web association. We can do this with a remote SSH customer called PuTTY.
PuTTY sets up an SSH association from our home PC to our Raspberry Pi. PuTTY will show the
order incite of the Raspberry Pi on the PC in which it is introduced. We should simply to give it
the neighborhood IP address of the Raspberry Pi. Download and introduce PuTTY to your PC. In
the event that you are utilizing a Macintosh, you can simply utilize Terminal.

Write the Raspbian Operating System to the SD/microSD Card

Presently we are prepared to compose the Raspbian OS to our SD/microSD card. Open
Win32DiskImager, and select the Raspbian picture record that was extricated before by tapping
on the little document symbol to one side of the expansive content field:

Next, select the drive letter that the SD/microSD card is inserted into from the drop-down
list below “Device.”

DEPARTMENT OF ECE 47 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Now click “Write” on the bottom of the window. The writing process will take from 1 to
15 minutes depending on your computer and the size of your SD/microSD card:

Wait for the process to complete, then eject the SD/microSD card from your computer
and insert it into the Raspberry Pi.

Now you are ready to power up the Raspberry Pi. Plug the power cord into the Raspberry
Pi, and connect the Pi to your router via the Ethernet cable.

Establish an SSH Connection to your Raspberry Pi:

Keeping in mind the end goal to get to the Raspberry Pi by means of remote SSH, we
have to know the nearby IP address your switch has given to it. On the off chance that you can
get to this data from your switch's arrangement menu, simply ahead and do it. If not, utilize
Propelled IP Scanner to check your home system and create a rundown of every single

DEPARTMENT OF ECE 48 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

associated gadget and their neighborhood IP addresses. Simply click "Sweep" in the upper left-
hand zone of the window, and a rundown of every single associated gadget will be created with
their related neighborhood IP addresses:

Record the IP address of the gadget that says Raspberry Pi Establishment in the
"Producer" section. For my situation, it is 10.0.0.105. We will require the nearby IP deliver to set
up an SSH association from our home PC to the Raspberry Pi.
Presently we can set up our SSH association with the Raspberry Pi with our SSH
customer, PuTTY. Open up PuTTY, and enter the neighborhood IP address of the Raspberry Pi
into the "Host Name (or IP address)" field. Try not to stress over the port, for the time being,
keep it as seems to be:

After you have entered the local IP address of your Raspberry Pi, click “Open” to initiate
the connection. On the first connection attempt, an error message will appear, but press yes
anyway since you are connecting to your own Raspberry Pi so the security risk is minimal here:

DEPARTMENT OF ECE 49 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

If the SSH connection is successful you will now be greeted with the login prompt of
your Raspberry Pi:

If this is your first login, and you have not changed the username or password,
type pi here, then press Enter. Next, enter raspberry as the password. You are now logged in to
your Raspberry Pi’s command prompt via an SSH connection:

DEPARTMENT OF ECE 50 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

At this point, it’s a good idea to configure your Raspberry Pi by entering raspi-config to
enter the configuration settings menu:

This is the place you can change the majority of the default settings for Raspbian, and do
other helpful undertakings like extend the record framework and overclock the processor. I
clarify the greater part of the diverse arrangement settings in a different post, however, for the
time being, we should keep setting up your Raspberry Pi with the goal that you can work it
recklessly by means of a remote desktop application.

Fig. 4.21. Raspberry Pi Desktop view

DEPARTMENT OF ECE 51 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

4.2.5 Text-To-Speech With Python Espeak:

Text To Speech (TTS) with Espeak:

A computer system used to create artificial speech is called a speech synthesizer, and can
be implemented in software or hardware products.

A text-to-speech (TTS) system converts normal language text into speech. How can we
use speech synthesis in Python?

Espeak:

eSpeak is a compact open source software speech synthesizer for English and other langu
ages, for Linux and Windows.

We can install using:

sudo apt-get install espeak

Create the code speech2.py:

import os

os.system("espeak 'The quick brown fox'")

It is very easy to use, but like pyttsx it sounds very robotic.

Optical Character Recognition:

OCR = Optical Character Recognition. In other words, OCR systems transform a two-
dimensional image of text, that could contain machine printed or handwritten text from its image
representation into machine-readable text. OCR as a process generally consists of several sub-
processes to perform as accurately as possible. The subprocesses are:

• Preprocessing of the Image.

DEPARTMENT OF ECE 52 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

• Text Localization.
• Character Segmentation.
• Character Recognition.
• Post Processing

The sub-processes in the list above of course can differ, but these are roughly steps
needed to approach automatic character recognition. In OCR software, it’s main aim to identify
and capture all the unique words using different languages from written text characters.

For almost two decades, optical character recognition systems have been widely used to
provide automated text entry into computerized systems. Yet in all this time, conventional OCR
systems have never overcome their inability to read more than a handful of type fonts and page
formats. Proportionally spaced type (which includes virtually all typeset copy), laser printer
fonts, and even many non-proportional typewriter fonts, have remained beyond the reach of
these systems. And as a result, conventional OCR has never achieved more than a marginal
impact on the total number of documents needing conversion into digital form.

Fig 4.22 Optical Character Recognition process (Courtesy)

Next-generation OCR engines deal with these problems mentioned above really good by
utilizing the latest research in the area of deep learning. By leveraging the combination of deep
models and huge datasets publicly available, models achieve state-of-the-art accuracies on given

DEPARTMENT OF ECE 53 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

tasks. Nowadays it is also possible to generate synthetic data with different fonts using
generative adversarial networks and few other generative approaches.

Optical Character Recognition remains a challenging problem when text occurs in


unconstrained environments, like natural scenes, due to geometrical distortions, complex
backgrounds, and diverse fonts. The technology still holds an immense potential due to the
various use-cases of deep learning based OCR like.

• building license plate readers


• digitizing invoices
• digitizing menus
• digitizing ID cards

In this blog post, we will try to explain the technology behind the most used Tesseract
Engine, which was upgraded with the latest knowledge researched in optical character
recognition. This article will also serve as a how-to guide/ tutorial on how to implement OCR in
python using the Tesseract engine. We will be walking through the following modules:

• Tesseract OCR Features


• Preprocessing for OCR using OpenCV
• Running Tesseract with CLI and Python
• Limitations of Tesseract engine

Open Source OCR Tools:

Tesseract - an open-source OCR engine that has gained popularity among OCR developers.
Even though it can be painful to implement and modify sometimes, there weren’t too many free
and powerful OCR alternatives on the market for the longest time. Tesseract began as a Ph.D.
research project in HP Labs, Bristol. It gained popularity and was developed by HP between
1984 and 1994. In 2005 HP released Tesseract as open-source software. Since 2006 it is
developed by Google.

DEPARTMENT OF ECE 54 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

TesseractOCR - Tesseract is open source text recognition (OCR) Engine, available under the
Apache 2.0 license. It can be used directly, or (for programmers) using an API to extract printed
text from images. It supports a wide variety of languages. Tesseract doesn't have a built-in GUI,
but there are several available from the 3rdParty page. Tesseract is compatible with many
programming languages and frameworks through wrappers that can be found here.
It can be used with the existing layout analysis to recognize text within a large document,
or it can be used in conjunction with an external text detector to recognize text from an image of
a single text line.

Fig 4.23. OCR Process Flow

4.2.6 Email Setup


For this program to work, you will have to make a EMAIL account (or use a spare one
(that Gmail) to send the emails to Your Email. Throughout the next steps, I will call this GMAIL
account:
After both software and Hardware
1. Installing and configuring SSMTP.
2. Make sure your repositories are up-to-date.
3. Install SSMTP and mail utilities.
4. Edit the SSMTP configuration file for Gmail.
5. Allow less secure apps to access your account.
6. Two ways to send an text Email.
7. Send an attached file.

DEPARTMENT OF ECE 55 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

8. Capture the image.


9. Inside the python program using the mail command and system function you can send the
mail.
10.The email arrives.

4.2.7 Opencv-Python:

OpenCV was started at Intel in 1999 by Gary Bradsky and the first release came out in
2000. Vadim Pisarevsky joined Gary Bradsky to manage Intel’s Russian software OpenCV team.
In 2005, OpenCV was used on Stanley, the vehicle who won 2005 DARPA Grand Challenge.
Later its active development continued under the support of Willow Garage, with Gary Bradsky
and Vadim Pisarevsky leading the project. Right now, OpenCV supports a lot of algorithms
related to Computer Vision and Machine Learning and it is expanding day-by-day.

Currently OpenCV supports a wide variety of programming languages like C++, Python,
Java etc and is available on different platforms including Windows, Linux, OS X, Android, iOS
etc. Also, interfaces based on CUDA and OpenCL are also under active development for high-
speed GPU operations.

Python is a general purpose programming language started by Guido van Rossum, which
became very popular in short time mainly because of its simplicity and code readability. It
enables the programmer to express his ideas in fewer lines of code without reducing any
readability.

Compared to other languages like C/C++, Python is slower. But another important
feature of Python is that it can be easily extended with C/C++. This feature helps us to write
computationally intensive codes in C/C++ and create a Python wrapper for it so that we can use
these wrappers as Python modules. This gives us two advantages: first, our code is as fast as
original C/C++ code (since it is the actual C++ code working in background) and second, it is
very easy to code in Python. This is how OpenCV-Python works, it is a Python wrapper around
original C++ implementation.

DEPARTMENT OF ECE 56 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

And the support of Numpy makes the task easier. Numpy is a highly optimized library for
numerical operations. It gives MATLAB-style syntax. All the OpenCV array structures are
converted to-and-from Numpy arrays. So whatever operations you can do in Numpy, you can
combine it with OpenCV, which increases number of weapons in your arsenal. Besides that,
several other libraries like SciPy, Matplotlib which supports Numpy can be used with this.

So OpenCV-Python is an appropriate tool for fast prototyping of computer vision


problems.

Installing OpenCV on the Raspberry Pi


Anyone who has dealt with image processing in relation to the Raspberry Pi will sooner
or later come across theOpenCV library. It provides many very useful features such as face
recognition, the creation of depth maps (stereo vision, optical flow), text recognition or even for
machine learning. In addition, OpenCV (Open Source Computer Vision) can be integrated into
both its C ++ files and its Python scripts.
Especially in terms of feature recognition in images taken by the Raspberry Pi, OpenCV
is very helpful.
This advanced tutorial shows how to install OpenCV on the Raspberry Pi and how to
integrate it into Python.
For the time being, I would like to recommend everyone a Raspberry Pi Model B* to use,
because this is a lot more powerful than its predecessor. Even on a Raspberry Pi B + compiling
takes about 6 times as long, with a Pi 2 in total “only” takes about an hour.

First of all, we update the package lists:


sudo apt-get update && sudo apt-get upgrade && sudo rpi-update
A reboot is necessary if it has been updated.
sudo reboot
Then you can install all the important tools and libraries needed for OpenCV (installation takes a
few minutes).

DEPARTMENT OF ECE 57 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

sudo apt-get install build-essential git cmake pkg-config libjpeg8-dev libtiff4-dev libjasper-dev
libpng12-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libgtk2.0-dev libatlas-
base-dev gfortran
If everything worked, we could clone OpenCV from git. This step also takes a few minutes.
git clone https://github.com/Itseez/opencv.git && cd opencv &&git checkout 3.0.0
Whether version 3.0 or 2.4 of OpenCV is taken is up to you. Depending on the application, one
of the versions may be better suited.
Afterwards, OpenCV can be compiled. You can either use Python 2.7 or Python 3+.
There are some differences between the versions, especially as some libraries are not (yet)
executable with Python 3+. However, this mainly affects smaller libraries, as common libraries
(NumPy, SciPy, etc.) usually provide the respective files for both versions.
In this tutorial, I use Python 2.7. If you already have Python installed and want to know
which version is installed, you can simply enter python into the console and get the exact version
at the beginning (the command for Python 3+ is python3). If you do not have a Python installed,
you can install it by following the steps below:
sudo apt-get install python2.7-dev
We also need the package management tool pip, which installs NumPy right away:
cd ~ && wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
Now we can simply install via pip NumPy. NumPy is a library that makes it very easy to perform
array operations in Python.
pip install numpy
But now to compile OpenCV. For this purpose, a build folder must be created in which the
compiled files land:
cd ~/opencv && mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D INSTALL_PYTHON_EXAMPLES=ON
-D INSTALL_C_EXAMPLES=ON
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules
-D BUILD_EXAMPLES=ON ..

DEPARTMENT OF ECE 58 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Now you can finally compile. This step takes (depending on Raspberry Pi model) quite a
long time (on my Pi 2 about an hour). To use all four cores to compile on the Raspberry Pi 2,
type in the following:
make -j4
If the compilation has worked without problems, we can install OpenCV:
sudo make install && sudo ldconfig
Done!

DEPARTMENT OF ECE 59 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

CHAPTER 5
RESULTS

Fig NO 5.1: Connections Of Door bell Using Raspberry Pi

Fig No 5.2:Output Of Software

DEPARTMENT OF ECE 60 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

CHAPTER 6
TESTING AND DEBUGGING
6.1. SETUP RASPBERRY PI:

• To get started with Raspberry Pi, we have to store required OS on SD card.


• Now to store OS on SD card we need to install OS on SD card. If you want to know how
to install/store OS on SD card you can refer Installing Operating System Image on SD
card.
• Here, we installed the Raspbian OS on SD card.
• Now, we have an SD card with installed OS and Raspberry Pi Board.
• Initially to use raspberry Pi we need computer monitor or Digital Display.
• We can directly connect Raspberry Pi to the Digital Display using HDMI cable.

Fig 6.1. HDMI Cable

• But, if we have a computer monitor (VGA Display), then we need an HDMI to VGA
converter along with a VGA cable for connecting Raspberry Pi with monitors. HDMI to
VGA converter and VGA cable is shown below.

DEPARTMENT OF ECE 61 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Fig 6.2. HDMI to VGA Converter

Fig 6.3.VGA Cable

Now, connect the Raspberry Pi to the Display/monitor and Power-On Raspberry Pi. We
will get a Black command window asking for Login and Password as shown below

DEPARTMENT OF ECE 62 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

• Then, use the following login name and password

raspberrypi Login: pi
Password: raspberry

DEPARTMENT OF ECE 63 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

• This is the default user name and password. You can change the password after the first
login.

The above command window can be used to operate Raspberry Pi.

• To get GUI environment on Raspberry Pi, use below command,

startx
And we will get Home Screen of Raspberry Pi as shown below:

On display, there is a symbol of raspberry to the top-left corner of display. After


clicking on it, we will get menu as shown below.

DEPARTMENT OF ECE 64 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

• As we can see, the Raspbian OS has installed Python 2 & 3. It also has different
programming IDE like Geany, BlueJ Java IDE, etc. As raspberry pi 3 has On-chip Wi-Fi,
we can connect it to the network and will get access over Internet.

• We can also change password of “Pi” user.

• To change password, click on preferences and then select Raspberry Pi


Configuration which will provide a pop-up window.

DEPARTMENT OF ECE 65 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

• Then, click on change password option shown below.

DEPARTMENT OF ECE 66 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

Now, we are quite familiar with Raspberry Pi OS.


How to write C program on Raspbian OS

• So, let’s write our First C code on Raspbian and execute it.
• First Create Empty file and label it with .c extension.
• Now write a small program to print “Hello World”

Program

#include<stdio.h>
int main(){
printf(“Hello World”);
return 0;
}

After writing the code, open terminal (ctrl+alt+t) to execute it. Then, type following
commands for compiling and execution.

DEPARTMENT OF ECE 67 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

CHAPTER 7
ADVANTAGES

Remote Access: Users can access the doorbell remotely from anywhere with an internet
connection, allowing them to see and communicate with visitors even when they're not at home.

Integration with Smart Home Systems: It can be integrated with other smart home devices and
systems, enabling seamless automation and control of various functions such as unlocking doors,
turning on lights, or receiving notifications on smartphones.

Customization: Users can customize the functionality and features of the doorbell to suit their
specific needs, such as adding facial recognition, motion detection, or recording capabilities.

Enhanced Security: The doorbell can serve as a security tool by providing real-time video
surveillance of the entrance, deterring potential intruders, and recording footage for future
reference.

Scalability: The system can be easily scaled to accommodate additional sensors, cameras, or
modules to enhance its capabilities over time.

Cost-Effective: Raspberry Pi is an affordable and versatile platform, making it a cost-effective


solution compared to proprietary smart doorbell systems available on the market.

Open-Source Community Support: Raspberry Pi has a large and active community of


developers and enthusiasts who contribute to the development of software, applications, and
tutorials, providing ongoing support and resources for users.

DEPARTMENT OF ECE 68 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

DISADVANTAGES

Technical Complexity: Setting up and configuring the system may require technical knowledge
and expertise, which could be challenging for users with limited technical skills.

Reliability: The reliability of the system depends on factors such as network connectivity, power
supply, and software stability, which can sometimes be prone to issues or failures.

Security Risks: IoT devices, including Raspberry Pi-based systems, are susceptible to security
vulnerabilities such as hacking, malware, or unauthorized access, especially if proper security
measures are not implemented.

Dependence on Internet Connectivity: The system relies on internet connectivity to function


properly, so interruptions or outages in internet service could disrupt its functionality.

Power Consumption: Raspberry Pi devices consume more power compared to traditional


doorbell systems, which may lead to higher electricity bills or require additional power
management solutions.

Maintenance and Updates: Regular maintenance and updates are necessary to ensure the
system's performance, security, and Compatibility with new software releases or technologies.

Limited Support: While Raspberry Pi has a vibrant community, official technical support
options may be limited compared to commercial products, which could pose challenges for
troubleshooting complex issues.

Privacy Concerns: Continuous video surveillance and recording raise privacy concerns,
especially if the data is not adequately secured or handled according to privacy regulations.

Despite these disadvantages, many users find the benefits of an IoT-based doorbell using
Raspberry Pi outweigh the drawbacks, particularly in terms of customization, flexibility, and
integration with smart home systems.

DEPARTMENT OF ECE 69 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

APPLICATIONS

Home Security: The doorbell can serve as a primary component of a home security system,
providing real-time monitoring of the entrance and enabling users to remotely monitor and
interact with visitors.

Remote Access Control: Users can remotely grant access to trusted individuals, such as family
members, friends, or delivery personnel, by unlocking the door or activating electronic locks
through the doorbell interface.

Visitor Management: It can be used for visitor management in residential complexes, hotels, or
office buildings, allowing residents or staff to verify the identity of visitors before granting them
access.

Package Delivery Monitoring: With the rise of online shopping, the doorbell can be used to
monitor package deliveries, alerting homeowners when packages are delivered and providing
video evidence of the delivery process.

Elderly Care: In eldercare applications, the doorbell can be equipped with features such as
emergency buttons or motion sensors to monitor the well-being of elderly residents and provide
assistance in case of emergencies.

Smart Home Integration: Integration with other smart home devices and systems allows users
to create customized automation scenarios, such as turning on lights or adjusting the thermostat
when the doorbell is activated.

Visitor Analytics: The doorbell system can collect data on visitor traffic, such as the frequency
and duration of visits, which can be useful for analyzing patterns and trends over time.

Business Applications: In commercial settings, the doorbell can be used for customer service
purposes, enabling businesses to greet and assist visitors remotely or manage entry access for
employees.

DEPARTMENT OF ECE 70 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

CONCLUSION

In conclusion, the IoT-based smart doorbell system implemented with Raspberry Pi


represents a significant leap forward in home automation and security. Leveraging the power of
Internet of Things technology, this smart doorbell not only allows users to remotely monitor their
doorstep but also provides real-time notifications and seamless integration with other smart home
devices. The Raspberry Pi serves as the brain of the system, between the doorbell,
buzzer,camera, and the user's smartphone. With features such as video streaming, motion
detection this solution enhances the overall safety and convenience of residential spaces. The
cost-effective nature of the Raspberry Pi, coupled with its versatility, makes it an ideal platform
for creating innovative and accessible smart home solutions. Overall, the IoT-based smart
doorbell with Raspberry Pi exemplifies the potential of technology to enhance our daily lives by
combining connectivity, intelligence, and practical functionality.

DEPARTMENT OF ECE 71 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

REFERENCES

1. “Smart bell notification system using IOT” , Journal of network communication and
emerging technology , volume 8 , April 2018.

2. “Smart Doorbell system based on Face Recognition”, Jaychand Upadhyay, International


Research Journal of Engineering and Technology(IRJET) Volume:04 Issue:03 , March 2017. 3.
“Door Surveillance with Smart Bell”, Manaswi Shimpi, International Journal of Research in
Engineering, Science and Management , Volume 2,Issue-2, February 2019.

4. “Smart Surveillance with Smart Doorbell”, R.V.S.Lalitha, International Journal of Innovative


Technology and Exploring Engineering (IJITEE), Volume-8 , Issue -8 , June 2019. 5. “Smart
Security System with Face Recognition using IOT”, Prajali Dandekar , Shweta kakade,
International Research journal of modernization in Engineering Technology and Science ,
Volume 2,Issue:03,March-2019.

6. “Face recognition system using IOT”, International Journal of Advanced Research in


Computer Engineering and Technology, Volume 6 , Issue-11 , November 2017.

7. “Design and Implementation of Smart bell notification system using IOT”, DeviReddy
Pravallika, Invention Journal of Research Technology in Engineering and Management
(IJRTEM) , Volume 2, Issue-5 , May 2018.

8. “Face Recognition using Opencv based on IOT for Smart Door”, A.D.Deshmukh,
International conference on sustainable computers in science, Technology and Management (
SUSCOM) 2019.

9. “Smart Doorbell System with Facial Recognition for people with Hearing Impairment”,
R.Subash ,Yash Kumawad, International Journal of Advanced Science and Technology, Volume
29, November 2020.

10. “IOT smart doorbell Surveillance”, Carolin EI Fiorenza, IJARIE-ISSN(0),Volume-4,Issue 2,


2018.

DEPARTMENT OF ECE 72 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

APPENDIX
import RPi.GPIO as GPIO

import telepot

import time

import datetime

import warnings

import os

from picamera import PiCamera

import sys

import smtplib

from email.mime.multipart import MIMEMultipart

from email.mime.base import MIMEBase

from email.mime.text import MIMEText

from email import encoders

GPIO.setmode(GPIO.BCM)

GPIO.setwarnings(False)

btn=23

buz=24

DEPARTMENT OF ECE 73 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

GPIO.setup(btn, GPIO.IN, pull_up_down=GPIO.PUD_UP)

GPIO.setup(buz, GPIO.OUT)

GPIO.output(buz, True)

time.sleep(1)

GPIO.output(buz, False)

HIGH=1

LOW=0

chat_listen = {}

path=os.getenv("HOME")

key = 1738908720

bot = telepot.Bot('7089973489:AAGGVxgTTxz8qeqDC-twQd2IVWMgQqBJXnM');

time.sleep(1)

bot.sendMessage(key, text="IoT based Door Bell Control System using Raspberry Pi")

flag=0

def send_mail():

fromaddr = "[email protected]"

toaddr = "[email protected]"

msg = MIMEMultipart()

msg['From'] = fromaddr

DEPARTMENT OF ECE 74 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

msg['To'] = toaddr

msg['Subject'] = "Door Security Alert"

body = "Alert Message from Raspberry Door Security Alert..."

msg.attach(MIMEText(body, 'plain'))

filename = "pic.jpg"

attachment = open("/home/pi/pic.jpg", "rb")

part = MIMEBase('application', 'octet-stream')

part.set_payload((attachment).read())

encoders.encode_base64(part)

part.add_header('Content-Disposition', "attachment; filename= %s" % filename)

msg.attach(part)

server = smtplib.SMTP('smtp.gmail.com', 587)

server.starttls()

server.login(fromaddr, "vbwe qmoc pwij uiva")

text = msg.as_string()

server.sendmail(fromaddr, toaddr, text)

print("Mail has sent")

server.quit()

return

DEPARTMENT OF ECE 75 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

if __name__ == '__main__':

print("Welcomes You ")

while 1:

button_state = GPIO.input(btn)

if button_state == False:

print('Button Pressed... ')

GPIO.output(buz, True)

time.sleep(1)

GPIO.output(buz, False)

time.sleep(1)

bot.sendMessage(key, text="Someone Waiting infront of the Door...")

time.sleep(0.5)

print (" -- Taking picture -- ")

camera = PiCamera();

camera.capture(path + '/pic.jpg',resize=(640,480))

time.sleep(2)

camera.close()

bot.sendPhoto(key, open(path + '/pic.jpg', 'rb'))

print ("Telegram Alert Sent...")

time.sleep(0.5)

send_mail()

time.sleep(0.5)

DEPARTMENT OF ECE 76 VMTW


Iot Based Door Bell Control System Using Raspberry Pi MJ20-A5

else:

print(" -- No Button Pressed -- ")

GPIO.output(buz, False)

time.sleep(1)

DEPARTMENT OF ECE 77 VMTW

You might also like