A5 Document
A5 Document
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
Mr.K.ASHOK REDDY,
Assistant Professor
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.
B. Pujitha (20UP1A0407)
K.Sandhya (20UP1A0421)
i
ACKNOWLEDGEMENT
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.
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 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
CHAPTER 3
3.2 FLOWCHART 12
CHAPTER 4
v
4.1.3 ARM ARCHITECTURE 20
4.1.4 SD CARD 29
4.1.6 BUZZER 32
MONITOR OR KEYBOARD 45
CHAPTER 6
ADVANTAGES 68
DISADVANTAGES 69
vi
APPLICATIONS 70
CONCLUSION 71
REFERENCES 72
APPENDIX 73
vii
LIST OF FIGURES
viii
FIG NO 4.23 OCR process flow 55
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
xi
CCD Charge Coupled Device 33
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.
▪ 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. 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
(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
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.
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.
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.
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.
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.
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
STOP
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.
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:
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.
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.
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.
1. Raspberry Pi 1 Model A
2. Raspberry Pi 1 Model A+
3. Raspberry Pi 1 Model B
4. Raspberry Pi 1 Model B+
5. Raspberry Pi 2 Model B
6. Raspberry Pi 3 Model B
7. Raspberry Pi Zero
Out of the above versions of Raspberry Pi, more prominently use Raspberry Pi and their features
are as follows
Operating
700 MHz 900 MHz 1.2 GHz 1 GHz
Freq.
512 MB
RAM 512 MB SDRAM 1 GB SDRAM 1 GB SDRAM
SDRAM
Wi-Fi and
Wireless No No No
Bluetooth
Raspberry Pi Zero:
Raspberry Pi 3 Board:
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.
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.
• Branch prediction with return stack Low interrupt latency configuration Internal
coprocessors CP14 and CP15
• 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
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.
• 32-bit registers.
Java Bytecodes
ARM architecture v6 with Jazelle technology executes variable length Java bytecodes.
Java bytecodes fall into two classes:
• Integer core.
• Load-Store Unit (LSU).
• Prefetch unit.
• Memory system.
• AMBA AXI interface.
• Coprocessor interface.
• Debug.
• Instruction cycle summary and interlocks.
• Vector Floating-Point (VFP).
• System control.
• Interrupt handling.
Pipeline Stages
WBex: Write back to data from the multiple or main execution pipelines.
• 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.
• Word, 32-bit.
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
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.
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.
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
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
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.
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:
Function Details:
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.
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
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
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.
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.
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.
• 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
Server Edition (RSEv2.4)', is a stripped version with other software packages bundled as
compared to the usual desktop computer oriented Raspbian.
• 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.
• 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
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.
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.
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:
▪ 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.
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
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.
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
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.
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:
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.
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.”
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.
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
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:
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:
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.
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.
import os
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:
• 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.
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
tasks. Nowadays it is also possible to generate synthetic data with different fonts using
generative adversarial networks and few other generative approaches.
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 - 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.
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.
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.
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.
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 ..
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!
CHAPTER 5
RESULTS
CHAPTER 6
TESTING AND DEBUGGING
6.1. SETUP RASPBERRY PI:
• 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.
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
raspberrypi Login: pi
Password: raspberry
• This is the default user name and password. You can change the password after the first
login.
startx
And we will get Home Screen of Raspberry Pi as shown below:
• 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.
• 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.
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.
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.
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.
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.
CONCLUSION
REFERENCES
1. “Smart bell notification system using IOT” , Journal of network communication and
emerging technology , volume 8 , April 2018.
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.
APPENDIX
import RPi.GPIO as GPIO
import telepot
import time
import datetime
import warnings
import os
import sys
import smtplib
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
btn=23
buz=24
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
msg['To'] = toaddr
msg.attach(MIMEText(body, 'plain'))
filename = "pic.jpg"
part.set_payload((attachment).read())
encoders.encode_base64(part)
msg.attach(part)
server.starttls()
text = msg.as_string()
server.quit()
return
if __name__ == '__main__':
while 1:
button_state = GPIO.input(btn)
if button_state == False:
GPIO.output(buz, True)
time.sleep(1)
GPIO.output(buz, False)
time.sleep(1)
time.sleep(0.5)
camera = PiCamera();
camera.capture(path + '/pic.jpg',resize=(640,480))
time.sleep(2)
camera.close()
time.sleep(0.5)
send_mail()
time.sleep(0.5)
else:
GPIO.output(buz, False)
time.sleep(1)