Project Report Edna Shange
Project Report Edna Shange
I declare that this report and work described in it are my own work, with any contribution from
others expressly acknowledged and/or cited.
I declare that the work in this report was carried out in accordance with the regulations of the
University of Dar es salaam and has not been presented to any other university for examination
either in Tanzania or overseas. Any views expressed in the report are those of the author and in no
way represent those of the University of Dar es salaam.
Signature…………………………………………………….
Date…………………………………………………………
This report may proceed for submission for assessment for the award of BSc. In Electrical
Engineering at the University of Dar es salaam.
Supervisor’ signature…………………………………………
Date……………………………………………………………
i|Page
ACKNOWLEDGMENT
First of all, my profound gratitude goes to our ALMIGHTY GOD who kept me alive, healthy and
for guiding and shielding me throughout my four years of academic journey at the University of
Dar es salaam. To my mother Georgina Achimpota other family members for their prayers,
encouragement and material support to me during at all time of my studies. Also, special thanks
goes to HESLB for their financial support to me that enabled me to sustain life here at the
university.
I would like to extend my appreciation to all my fellow EE fourth year students 2018/2019. To
those who contributed time, concern and efforts that allowed me to gain invaluable knowledge.
On top of that, their support has led me to practice and learn more from them in order to become
an expert in the field of engineering and life in general.
Moreover, my sincerely thanks go to my project supervisor Prof. B.M.M. Mwinyiwiwa for his
intensive guidance, information and motivation that he provided to fulfil the project objectives and
for advices and assistance in accomplishing my project and report writing.
ii | P a g e
ABSTRACT
An automatic electric doorbell with object detection devices, detects when a visitor or an intruder
(burglar or invader) comes to our residential houses. When someone comes to our houses, he or
she knocks at the door or gate or else searches for the doorbell switch and rings it to let us know
his or her presence. However, if the person who comes to the house cannot reach or find or else if
the person is too old, short or disabled to reach the doorbell switch, what can be done? How is it
going to be if we install an automatic electric doorbell at our homes, which rings as soon as a
person arrives at our place? There will be no more troubles. The person who comes to our house
need not to search for the doorbell switch and press it anymore. If the automatic electric doorbell
circuit is installed, the circuit will automatically sense the presence of the person and rings the
doorbell.
The circuit design for this project, will operate using PIR sensor module which is used to detect
the infrared radiations emitted from the human body or any other warm body (with above absolute
zero temperature). If the person is detected, the doorbell will automatically turn ON as the person
is in front of the door.
iii | P a g e
CONTENTS
DECLARATION............................................................................................................................ i
ACKNOWLEDGMENT .............................................................................................................. ii
ABSTRACT .................................................................................................................................. iii
LIST OF ABBREVIATIONS AND ACRONYMS ................................................................... vi
LIST OF TABLES ...................................................................................................................... vii
LIST OF FIGURES ................................................................................................................... viii
CHAPTER ONE ........................................................................................................................... 1
1.1. INTRODUCTION ............................................................................................................................................1
1.2. BACKGROUND ..............................................................................................................................................2
1.3. PROBLEM STATEMENT .................................................................................................................................3
1.4. OBJECTIVES ..................................................................................................................................................3
1.4.1. MAIN OBJECTIVE .................................................................................................................................3
1.4.2. SPECIFIC OBJECTIVES ...........................................................................................................................3
1.5. SIGNIFICANCE OF THE PROJECT ....................................................................................................................4
1.6. METHODOLOGIES ........................................................................................................................................4
iv | P a g e
CHAPTER FOUR ....................................................................................................................... 31
DETAILED SYSTEM DESIGN ................................................................................................ 31
4.0. INTRODUCTION................................................................................................................ 31
4.1. POWER SUPPLY CIRCUIT DESIGN ......................................................................................................................31
4.2. PASSIVE INFRARED SENSOR (PIR) CIRCUIT DESIGN ...........................................................................................31
4.2.2. ALGORITHM SHOWING THE OPERATION OF THE PIR SENSOR .................................................................32
REFERENCES ............................................................................................................................ 41
APPENDICES ............................................................................................................................. 42
PROJECT WORK SCEDULES ................................................................................................ 42
APPENDIX I: SCHEDULE OF WORK PLAN IN THE FIRST SEMESTER 2018/2019 .. 42
APPENDIX II: SCHEDULE OF WORK PLAN IN THE SECOND SEMESTER 2018/2019
....................................................................................................................................................... 43
APPENDIX III: COST ESTIMATION .................................................................................... 44
APPENDIX IV: CODES FOR THE ARDUINO ATMEGA328 ............................................ 45
v|Page
LIST OF ABBREVIATIONS AND ACRONYMS
IR Infrared sensor
RF Radio frequency
DC Direct Current
AC Alternating Current
I/O Input/output
vi | P a g e
LIST OF TABLES
vii | P a g e
LIST OF FIGURES
viii | P a g e
CHAPTER ONE
1.1.INTRODUCTION
The need of someone outside of the door to notify the owner on his or her presence has been
discovered for some centuries. Previously, someone would just knock at the door or gate to let his
presence be known. Then came the evolution of normal electric doorbell and latest is the use of an
automatic electric doorbell.
An electric bell is the mechanical bell that functions by means of an electromagnet. On application
of electric current, it produces repetitive buzzing or ringing sound. Electric bells have been widely
used at schools, in telephones, fire alarms, railroad crossing, industrial plants alarms and doorbells.
A door bell is a signaling device normally placed near the door to a building’s entrance. When a
visitor presses a button at the door or gate, the bell rings inside the building, notifying the occupant
the presence of the visitor.
An automatic doorbell system is an attractive and much useful circuits in our day to day life.
Generally, most house or apartments owners are using the door bells. If the visitor comes our
houses, first he or she searches for the doorbell or knocks at the door or gate. If the owner is using
an automatic doorbell system, then the visitor needs not to search for the doorbell or knock the
door. Automatically, the sensor will sense the person, hence the sound will be produced from the
inside of the house to notify the owner on the presence of a person at the door or gate. This will
enhance more security at our homes and saving of time and electricity.
An automatic electric doorbell involves the installation of an automatic doorbell ringing system or
circuit, which automatically sense the presence of the person at the door or gate and rings the
doorbell. The circuit operates with a PIR sensor which is used to detect the person at the door and
if the person is detected, the doorbell is automatically turned ON when the person is within the
PIR sensor’s sensitivity range in-front of the door or gate. PIR sensor is an electronic motion sensor
that measures infrared light radiating from objects in its field of view, which depends on
temperature and surface characteristics of objects in-front of the sensor.
1|Page
1.2.BACKGROUND
The need of some means by which someone outside of the door or gate could alert someone from
the inside of his existence has been recognized for some centuries. The earliest solution to this
problem consisted of the simple practical of knocking the door with one’s fist. As the human race
grew in more wisdom and technical sophistication, new and delicate methods were developed. The
first of these as the mechanical door knocker, which protected man from pain of bruised knuckles.
Then with the advancement of electronics came the electrical door bell, the evolution of which
over the past two decades has provided the discovery of a number of methods capable of detecting
the approach or presence of a person to the door from a distance and triggering the production of
an appropriate sound from the inside of the door. Unluckily, most methods invented so far suffer
from some disadvantages which have prohibited their widespread application to residential doors.
The methods can be categorized into three on basis of the principle used to sense the approaching
person. The first category includes the use of a mechanical switch, which is triggered when the
person steps on it. The mechanical switch method requires that the mat containing many switches,
to be placed in-front of the door in such a way that anyone approaching the door, must step on it.
Such mats are not only unaesthetic, but also must be connected to the sound producing unit inside
the house, demanding the hole to be drilled through the wall which can only be done by
professionals, increasing the total cost. Therefore, this method is expensive and not of good
appearance.
The second category involves the use of photoelectric sensor and the light source arranged in such
a way that the person casts the shadow on the sensor as he approaches the door. The photoelectric
method requires that a light source and photodetector are to be mounted on either side of the path
leading to the door. Again, the installation must be done by professionals and this may be more
unaesthetic than a mat.
The third category involves the use of some type of capacitance proximity sensor which detects
the change in capacitive coupling between a metal sensor plate and ground or between two plates
mounted on or near the door, that results as the person approaches them. Installation of capacitance
proximity sensor doorbell is somehow simpler than that of mechanical switch or photoelectric
sensor. However, in order to obtain the minimal detection-range of the two feet, metal sensor plates
must be used. While this cannot be seen from the inside, it is obvious painful from the inside.
2|Page
None of the three categories have accomplished wide acceptance in residential applications,
mainly because they are difficult to install. To overcome all these disadvantages, an automatic
electric bell is used.
1.3.PROBLEM STATEMENT
The following are some of the problems experienced in our homes or apartments concerning the
doorbells;
• When a visitor comes to our homes, he or she searches for the doorbell switch and rings it
to let us know his or her presence. If he who comes cannot find the doorbell switch or else
if the person is too short or disabled, that he or she cannot reach the switch, an automatic
doorbell is used, which rings as soon as a person arrives at our place. Therefore, there will
be no more difficulties.
• Also, when an intruder comes at our houses, the doorbell will ring to let us know the
presence of the person at the door/gate and act accordingly.
1.4.OBJECTIVES
The main target of this project is to design an electric doorbell, that will automatically sense the
presence of the visitor or an intruder at the door/gate of our houses or apartments using PIR sensors.
For this project to be successfully accomplished, the following specific objectives have to be taken
into account;
3|Page
1.5. SIGNIFICANCE OF THE PROJECT
Home automation system plays an important role in maintaining the living standards by
providing secure and convenient environment. As per completion of this project;
• The doorbell will automatically turn ON and produce a sound on the presence or the person
around the door or gate, within the PIR sensor’s sensitivity range.
• The automatic doorbell system is helpful for shorter or disabled persons who cannot reach
or press the doorbell switch. Then the circuit will automatically sense the person and
produce the sound.
• The design of this system is significant in enhancing security, saving time for searching for
the doorbell switch or house owner opening the door and saving electricity.
1.6. METHODOLOGIES
Upon the successful completion of this project, the following are the methods I am expecting to
use;
i. Consultation
Consultation with my supervisor, discussing various steps, problems in counted and solving them.
This will be done time to time during the project progress as agreed with my supervisor. Also
consultation with other technical staffs for more clarification, guidance and interpretation will be
done accordingly and whenever necessary in order to make this project successful.
After problem identification and observation which led me to do this project, I will be reading
various books, international journals, literally documents, internet surfing, booklets and other
useful materials concerning the previous, exciting systems and what other scientist and engineers
across the world suggest/ say about the automatic doorbell system.
This includes the selection of circuit components to be used in the system and circuit arrangement
to bring the expected outcomes. The proposed system’s circuit will be designed as required which
4|Page
will overcome the stated problems, taking consideration of the effective cost and benefits that
could be attained after introducing my circuit to the system.
This will be done using PROTEUS software. Using this simulation software, the circuit
arrangement will be tested to see if it would provide the required outcomes.
v. Project implementation
Project prototype building and implementation will be the next step followed after the project
simulation. Materials and equipment which will be needed to build my prototype will be bought
or rent from any recommended institution or laboratory within or outside the University of Dar es
Salaam.
Finally, the built up circuit will be tested if it works as planned or not. The problems in counted
will be analyzed and solved before the final presentation and implementation of this project to my
academic staffs and other participants where necessary.
5|Page
CHAPTER TWO
LITERATURE REVIEW
2.1. INTRODUCTION
This chapter explains and describes the features, operation, advantages, deficiencies and
limitations of the existing system. It also shows different technologies and approach undertaken
by different designers of the existing system with drawbacks of the existing system in relation to
the proposed system. Though, this category provides the prior knowledge and information that will
help during the design and building of the proposed project. Also, review comes from reading of
various books, journals, internet surfing and documentations.
Though there are many doorbell systems, providing security through doorbells is a challenging
job. The present doorbell systems follow traditional approach that is, when a visitor presses the
doorbell switch, the bell rings from the inside the house.
To begin with, the doorbell is a signaling device typically placed near an entry door or gate to a
building. When a visitor presses a button the bell rings inside the building, alerting the occupant
to the presence of the visitor. Today the traditional wired type of doorbells are gradually getting
out-of-date and replaced by the advanced wireless type of doorbells that are easier to install due to
their hassle free set-ups. The electric bells are used in many applications in places like; telephone,
railroad crossing, fire systems, school bells, burglar alarms, doorbells in residential or commercial
buildings and alarms in industrial plants.
The doorbell plays an important role in home security. Therefore, an efficient and consistent
system must be developed for better safety which could be accessed at a lower price. In today’s
world, there are many doorbell systems performing different operations. However, this project will
only focus on design of an automatic doorbell system which is designed to ring the bell
automatically when the visitor approaches the door within the sensitivity range of the available
sensor that is PIR sensor. This system is intended to favor and service old age, short and disabled
people and improving security.
6|Page
2.1.2. HOW AN AUTOMATIC ELECTRIC DOORBELL SYSTEM WORKS
First considering the normal electric doorbell, which is an electromagnetic and a mechanical bell.
An electric bell consists of one or more electromagnets made of a coil on insulated wire around an
iron core, which attract a springy iron armature with a clapper. When a visitor comes and presses
the doorbell switch (push button), an electric current flows through the coils, the electromagnet
creates a magnetic field which pulls the armature towards it, causing the clapper to strike the bell.
Most doorbells have what is called push to make switch outside the door or gate of the building.
When the current is applied to the bell, it produces the continuous sound. Therefore, the owner
will be notified on the presence of the visitor at the door. But this system does not solve security
problem.
An automatic electric doorbell circuit, helps to ring the doorbell automatically if any person
approaches the door or gate. As a result, the person need not to search for the doorbell switch and
ring the bell. Also, in case there is an intruder around the building entrance especially during the
night hours, the doorbell will automatically turn ON and make a ringing sound as the alarm to alert
the owner on the presence of an intruder around the house. Therefore, the automatic electric
7|Page
doorbell systems have been somehow successful in solving security problems in residential,
commercial buildings and so on.
The current existing system of an automatic electric doorbell uses the pair of ultrasonic transmitter
and receiver module (IR sensor) which is the basis of the automation process in the system. The
sensor will detect any object (with above absolute zero temperature) in front of the door or
approaching the door within its field of view. When the person is detected by IR sensor, the
doorbell will automatically turn ON and produce a ringing sound to alert the person from the inside
of the house on the presence of the person outside the door or gate.
The frequency of the ultrasonic transmitter is almost about 40 kHz, this is considered that the
ultrasonic waves can transmit continuously about 40 kHz. The sensitivity range of the transmitter
is about one to two meters with moderate power supply. If the transmitter power is less than one
meter, for instance the person is away from the one meter, there will be a high chance of the person
to be undetected. Also, if the sensitivity range is very high then there will be false triggering. This
is for the case that, if the person is far away from the door, he or she will be considered as a visitor
and produce the sound of the alarm. To prevent this problem, the transmitter power must be kept
at optimum level.
8|Page
2.2.1. BLOCK DIAGRAM OF THE EXISTING SYSTEM
Power supply
IR Sensor LED
IC LM 324
Comparator
Buzzer
Signal Flow
Power Flow
Main Voltage
Transformer Rectifier
supply regulator
9|Page
2.2.2. COMPONENTS IN THE EXISTING SYSTEM
This is an operational amplifier that consists of four channels. It is most commonly used amplifier
due to its low cost factor. It consists of four amplifiers per package and is superior to other
amplifiers for single supply applications. Negative power supply included in common mode input
and output range eliminates the need of external biasing. It has several different applications;
transducer amplifiers, DC gain blocks, conventional amplifier circuits, rectifiers, oscillators and
so on.
LM – 324 has 14 pins having different individual functions linked with them. Op-amps are high
gain electronic voltage amplifier with differential input and usually with a single – intended output.
The output voltage is many times higher than the voltage difference between input terminals of an
op – amp. [1]
LM324
Pin Number Pin Name
1 Output 1
2 Inverting Input 1
3 Non inverting Input 1
4 Power Supply (Vcc)
5 Non inverting Input 2
6 Inverting Input 2
7 Output 2
8 Output 3
9 Inverting Input 3
10 Non inverting input 3
11 Ground (GND)
12 Non inverting Input 4
13 Inverting Input 4
14 Output 4
10 | P a g e
Figure 2, 2.2.2.1 (a): LM-324 IC comparator Figure 3, 2.2.2.1 (b): LM 324 pinout
(kushagra) (kushagra)
So as to power the automatic electric doorbell circuit, the unregulated power supply (AC) is
converted into a constant DC voltage. This is done with the help of a transformer that steps down
the unregulated main power supply for instance 230V into a certain unregulated voltage depending
on the transformer ratings and circuit requirements, rectifier which converts AC supply into DC
voltage and a voltage regulator which is designed to automatically maintain and stabilize the
constant voltage level. The voltage regulator will regulate (converts) the DC voltage obtained from
the rectifier to about 5 to 9 volts DC, according to the comparator and the IR sensor voltage ratings.
Therefore, the regulated DC voltage will be fed to the comparator, IR sensor and the buzzer for
the circuit operation
2.2.2.3. IR sensor
For optical sensing and optical communication, photo optics technologies are used in the near
infrared region (700nm to 1400nm) as light is less complex than RF when implemented as a source
of signal. Optical wireless communication is done with IR data transmission for short range
applications. An infrared sensor is an electronic device, that emits in order to sense infrared
radiations emitted by warm bodies. An IR sensor can measure the heat of an object as well as
11 | P a g e
detects the motion. These types of sensors do both measuring and emitting of infrared radiations.
[2]
The basic concept of an infrared sensor which is used as obstacle detector is to transmit an infrared
signal, this infrared signal bounces from the surface of an object and is received at the infrared
receiver, that is when the shadow of an object casts on the signal emitted by the infrared signal it
will be detected.
12 | P a g e
2.2.3. DRAWBACKS OF THE EXISTING SYSTEM
Although the existing automatic electric doorbells have some advantages, they also have several
disadvantages as follows;
• The IR sensors used are incapable of distinguishing between objects that irradiate similar
thermal energy levels. Therefore, they are unable to distinguish humans from animals.
• Also, since the IR sensor does not have a wide field of view that is only along linear
direction. Thus it has not solved insecurity problem completely since an intruder can escape
from the line of sight of the IR sensor.
The proposed system of an automatic electric doorbell uses the PIR sensor module which is the
basis of the automation process in this system. The sensor will detect any object (with above
absolute zero temperature) in front of the door or approaching the door within its field of view.
When the person is detected by PIR sensor, the doorbell will automatically turn ON and produce
a ringing sound to alert the person from the inside of the house on the presence of the person
outside the door or gate.
This system is operated such that when the visitor approaches the house entrance such that he or
she is within the field of view of the PIR sensor, the sensor will detect the infrared radiation emitted
from the person and sends the signals to the microcontroller (Arduino). The microcontroller also
will send signals to the relay which will open to allow power to the buzzer and the buzzer will
make a ringing sound to alert the owner or anyone from the inside on the presence of the visitor at
the door entrance. The same will happen when an intruder comes to our houses, whereby the owner
will be notified on the presence of the person and act accordingly especially during the night hours.
13 | P a g e
2.3.1. BLOCK DIAGRAM OF THE PROPOSED SYSTEM
DC Voltage
supply Regulator
PIR
Microcontroller Relay
Sensor
LED
Buzzer
Power Flow
Signal Flow
2.3.2.1. DC supply
Direct current is the unidirectional (constant direction) flow of electric charges. A good example
of a DC power supply is a battery which can either be rechargeable or un-rechargeable battery .
Direct current may flow in a conductor such as a wire, but can also flow through semiconductors,
insulators, or even through a vacuum as in electron or ion beams.
A rechargeable battery is an energy storage device that can be charged or discharged into a load.
It can be recharged many times as opposes to a disposable or primary battery, which is usually
fully charged and discarded after use. They are produced in different shapes, sizes and ranging
from button cells to megawatt systems connected to stabilize an electrical distribution network.
14 | P a g e
acid, lithium – ion, lithium- ion polymer, nickel – metal hydride, cadmium and many others.
Devices using rechargeable batteries involves; automobile starters, light vehicles, electric bicycles,
battery storage power stations, uninterruptible power supply and electric vehicles.
For lithium ion batteries both positive (anode) and negative electrode (cathode) serve as host for
lithium ion (Li+). During charging, lithium ions move from cathode to anode and in reverse
direction during discharging. For most commercial lithium ion cells, the voltage range is 3.0V
(discharged) to 4.2V (fully charged).
They are sometimes called maintenance free batteries since do not require regular addition of water
to the cells and vent less gas than flooded (wet) lead – acid batteries. Therefore, can be used in
confined or poorly ventilated spaces.
These batteries consist of nickel hydroxide (NiOH) in the positive electrode and hydrogen storing
metal alloy in the negative electrode as well as potassium hydroxide electrolyte. Also, they have a
higher energy density per volume and weight
These batteries contain nickel hydroxide in the positive electrode and cadmium in the negative
electrode. For the electrolyte, potassium hydroxide is normally used. They supply extremely high
15 | P a g e
current and can be recharged rapidly due to their low internal resistance and very good current
conducting properties.
The DC supply to be used in the proposed system is the rechargeable battery. This battery will be
charged when the main supply from TANESCO is ON and incase of unavailability of power from
the main supply, the system may still be in operation due to the stored charge. This would increase
the system’s reliability. Since the system is also used for security purposes, the availability of
power 24/7 is inevitable.
2.3.2.2.Voltage Regulator
Voltage regulators are one of the most common electronic components, designed to automatically
maintain and stabilize a constant voltage level. When a steady reliable voltage is needed, then
voltage regulator is the favorite device. It generates a fixed output voltage that remains constant
for any changes in an input voltage or load conditions. It acts as a buffer for protecting components
from damages. A voltage regulator is a device with a simple feed- forward design and it uses
negative feedback control loops. There are mainly two types of voltage regulators: Linear (series
and shunt) voltage regulators and switching (step up, step down and inverter) voltage regulators
these are used in broader applications. Linear voltage regulator is the easiest type of voltage
regulators.
The purpose of a voltage regulator is to keep the voltage in a circuit relatively close to a desired
value, since a power supply frequently produces raw current that would otherwise damage one of
the components in the circuit. Voltage regulators have a variety of specific functions, depending
on their particular application. [3]
16 | P a g e
Therefore, in this system the voltage regulator will regulate the input voltage from the DC supply
to about 5V and keep it constant. The regulated voltage will be used to power the microcontroller,
PIR sensor, replay and the buzzer for effective operation of the proposed circuit.
PIR Sensor is pyroelectric device sensitive to moving objects radiating IR. Any changes
in infrared radiation within the field of the sensor result in the creation of temporary
electric potential. The potential generated, however, is very small in amplitude and is,
therefore, necessary to be amplified considerably.
Passive Infrared (PIR) sensor is the footing of the security system. The sensor's
functionality is based on infrared radiations emitted from the human body. It is a useful
tool for detection of human movement as it detects a change in infrared radiations as a
result of moving warm-blooded objects within their range. All objects with above absolute zero
temperature, including human beings, produce electromagnetic radiations. The wavelengths of
these radiations are dependent on the temperature of objects. Human beings emit infrared radiation
with wavelengths ranging between 0.7 and 300 micrometers. On the other hand, the normal body
temperature of human beings radiates IR at wavelengths of 10 to 12 micrometers. PIR sensors,
detect motion by sensing the fluctuations of infrared radiations.
PIR sensor plays a passive role in the detection of infrared radiations that is, it does not
emit any emissions (radiation) itself. Instead, the sensor passively detects infrared radiation
emitted by human or any warm body within its range or field of view.
17 | P a g e
Figure 8, 2.3.2.3.1 (a): PIR Sensor (Tarus, Figure 9, 2.3.2.3.1 (b): PIR Sensor Pin
2017) configuration (Tarus, 2017)
The PIR sensors consist of two slots in it. These slots are made of a special material which is
sensitive to IR. The Fresnel lens is used to see that the two slots of the PIR can see out past some
distance (basically the sensor’s sensitivity). When the sensor is inactive (idle), both slots detect the
same amount of IR, the ambient amount radiated from the outdoors, walls or room.
When a human body or any warm object (with above absolute zero temperature) passes by, then
it intercepts the first slot of the PIR sensor. This causes a positive differential change between the
two bisects. When a human body leaves the sensing area, the sensor generates a negative
differential change between the two bisects. These change pulses are what is detected.
The infrared sensor itself is housed in a hermetically (airtight) sealed metal to improve humidity,
temperature, noise or immunity. There is a window which is made of typically coated silicon
material to protect the sensing element. [4].
18 | P a g e
Figure 10, 2.3.2.3.2: PIR sensor working (elprocus, 2013 - 2019)
2.3.2.4.Microcontroller
A microcontroller's processor will vary by application. Selections, range from the simple 4-bit, 8-
bit or 16-bit processors to more complex 32-bit or 64-bit processors. In terms of memory,
microcontrollers can use random access memory (RAM), flash memory, EPROM or EEPROM.
Generally, microcontrollers are designed to be readily usable without additional computing
components because they are designed with sufficient onboard memory as well as offering pins
for general I/O operations, so they can directly interface with sensors and other components. [5]
19 | P a g e
2.3.2.4.1.Classification of the microcontroller
Microcontroller is classified into four (4) categories based on the semiconductor technology
adapted in their design, instruction set, memory devices and width of data format. The
classifications are as explained below;
• Instruction set
According to instruction set it can be categorized into CISC and RISC. CISC is a Complex
Instruction Set Computer. It allows the programmer to use one instruction in place of many simpler
instructions. Also, RISC stands for Reduced Instruction Set Computer, this instruction sets reduces
the design of microprocessor for industry standards. It allows each instruction to operate on any
register or use any addressing mode and simultaneous access of program and data.
This classification is based on the number of bits; 8 – bits, 16 – bits, 32 – bits. In 8-bit
microcontroller, the point when the internal bus is 8-bit the ALU performs the arithmetic and logic
operations. Examples of 8-bit microcontrollers are intel 8031/805 and Motorola MC68HC11. The
16 – bit microcontroller performs greater precision and performance compared to 8 – bit. 16 – bit
microcontrollers with its 16-bit data width has a range of 0x0000 – 0xFFFF (0-65535) for every
cycle. It can automatically operate on two 16-bits numbers example Intel 8096, Motorola
MC68HC12 families and 8051XA. The 32-bis microcontroller uses the 32-bit instructions to
perform the arithmetic and logic operations. They are automatically controlled devices including
implantable medical devices, engine control systems, office machines and other embedded
systems.
Classification based on memory devices is divided into two types; embedded memory and external
memory microcontroller. Embedded memory microcontroller system has a microcontroller unit
that has all functional blocks available on a chip. For instance, 8051 having a program and data
memory, I/O ports, serial communication, counters, timers and interrupts on the chip. External
memory microcontroller is an embedded system having a microcontroller unit not having all
functional blocks available on chip. For example, 8031 does not have program memory on chip.
20 | P a g e
Figure 11, 2.3.2.4: A Microcontroller Chip
Usually, a microcontroller must have low-power requirements since many devices they control are
battery operated equipment. Thus, these are situated for long lasting battery applications.
Nowadays, dominant part of microcontroller is implanted in other devices.
Microcontrollers take inputs from the device they are controlling and retain control by sending
signals to different parts of the device. These are low power devices with dedicated input devices
and small LED or LCD screen. Taking an example of the Television Microcontroller, it takes input
from a remote control and delivers its output in the Television screen. They run one specific
program and dedicated to the single task.
In this project, the microcontroller will receive signals from the PIR sensor, processes it and sends
signals to the relay, which is acting as a switch to allow powering of the buzzer to produce the
ringing sound.
2.3.2.5. Relay
Relay refers to an electrical operated switch using electrical signal to open and close circuits
electronically or electromechanically. It is also used to control a circuit by a low power signal.
They mostly use an electromagnet to mechanically operate a switch, however other operating
principles are used for instance solid – state relays. They are used when necessary to control the
circuit by separate low power signal.
21 | P a g e
The type of relays that can handle the high power that is required to directly control an electric
motor or other loads is referred to as contactor. Solid state relays control power circuits with no
moving parts, instead of using the semiconductor device to perform switching.
The relays usually have six connections. Whereby, three of them control the state of relay and the
other three connect to the circuit making the circuit to close or open and control the circuit. The
three connections that control the state of relay are as follows;
22 | P a g e
In this project, the relay will only operate when it is triggered IN with the signal from the
microcontroller. This happens when a person is sensed by the PIR sensor and the microcontroller
receives signal sent to it be the sensor and sends to the relay. The relay will open to allow power
to the buzzer.
2.3.2.6. Buzzer
A buzzer also called a beeper is an audio signaling device which may be mechanical,
electromechanical or piezoelectric. Likewise, the buzzer is like an electromagnetic speaker, where
changing of input signal produces sound, rather than producing the tone automatically. The main
types of buzzer are active and passive buzzers, an active buzzer generate a tone of sound using an
internal oscillator, thus all is needed is a DC voltage while passive buzzer requires an AC signal
to make a sound. Therefore, identification of what type of buzzer is by application of either DC or
AC voltage. When AC voltage is applied and it buzzes it is a Passive buzzer or vice versa.
2.3.2.7.LED
Light emitting diode is one of the semiconductor light source that emits light when current flows
through it. This happens when electrons (-ve) recombine with holes (+ve), releasing energy in
form of protons. This outcome is known as electroluminescence. The color of the light emitted can
be determined by the energy required for electrons to cross the band gap of the semiconductor.
The colors available are red, white, blue and green LEDs.
23 | P a g e
LED lights are commonly used as indication lights on devices, traffic lights, small an large lamps,
large video screens, signs and street lighting.
24 | P a g e
CHAPTER THREE
DESIGN SPECIFICATIONS
3.0. INTRODUCTION
This chapter discusses the appropriate system components, detailed designing process and
software specifications to ensure proper functionality of the proposed system.
3.1.1. MICROCONTROLLER
The microcontroller that will be used is Arduino UNO R3 based on the ATmega328 (datasheet).
Arduino is used for building different types of electronic circuits easily using both physical
programmable circuit board usually microcontroller and piece of code running on computer with
USB connection between the computer and Arduino. The programming language used in Arduino
is the simplified version of C++.
25 | P a g e
Why selecting Arduino UNO R3?
The following are some of the features of Arduino UNO R3 which make it suitable for the design;
• Simple and clear programming environment. Arduino programming environment is easy
to use for beginners, flexible enough for advanced users to take advantage of as well.
• It has an easy USB interface
• It has more numbers of hardware features such as PWM pins, timers, internal and external
interrupts and multiple sleep modes
• Inexpensive compared to other microcontrollers platforms
• Has a button to reset the program on the chip
• It is convenient to manage power inside it and has a feature of built in voltage regulation.
• Arduino software runs on windows, Linux operating systems and Macintosh OSX, while
other microcontroller systems are limited to windows
The HC – SR501 PIR sensor is selected. It is a low-cost sensor which can detect the presence of
human beings or animals that are within the sensor range.
26 | P a g e
3. Input Current 65mA
4. Output Signal Analog
5. Cover distance 60ᵒ and 7metres
6. Operating temperature -20ᵒC to +80ᵒC
27 | P a g e
Figure 17; 3.1.3. Relay
3.1.4. ROCKER SWITCH
The type of switch chosen is KCD1 – 101/2P, which in the proposed system is used as the feedback
switch. This switch is pressed by the owner responding to the visitor that he or she is going to open
the door or gate after hearing the bell ringing.
The type of LED used is 5 mm Round blue LED with high luminous power (intensity). LED in
the proposed system is used as an indicator to the visitor at the entrance, on the response of the
owner.
28 | P a g e
Table 7 Technical specifications of the LED
The type of buzzer used in the proposed system is LTE12 – 12 active-buzzer. In the project the
buzzer is used to produce a ringing sound as alarm or alert system to the owner’s residence.
29 | P a g e
7. Storage temperature -30ᵒC to +105ᵒC
The following are some of the software used in the system development.
3.2.1. ARDUINO IDE 1.8.9
The open – source Arduino software for Integrated Development Environment (IDE) is released
under General Public License (GNU). It is used to write source cord, debug and upload it to
Arduino UNO ATmega328 Microcontroller. This can run on Windows, MAC OS X and Linux
operating systems, written in C++ language.
30 | P a g e
CHAPTER FOUR
4.0. INTRODUCTION
This chapter deals with system circuit designing, which will involve circuit designing of different
parts hardware programming that will later then be integrated together to make up the entire
system. Designing in this project is categorized into several groups, basing on the activities and
interference of circuits, the designing can be grouped as follows;
The power supply source that is used in the proposed system is the DC integrated power supply
source, which receives power from the main supply of the utility company (TANESCO). The DC
integrated power supply receives 230V AC and converts it to 5V dc , 8V dc and 12V dc.
A sensor is used to detect the changes in quantities or events and generate the respective output
signals that is electrical or optical output signals. The output signals are sent to the microcontroller
which is used to control the alarm system. The movement of the person (visitor) at the entrance is
detected by the HC – SR501 PIR sensor, by detecting the levels of infrared radiation.
Whenever a human being passes within the field of view of the PIR sensor, then it detects the
infrared radiation emitted by a warm body in motion. Therefore, the infrared radiation detected by
the sensor generates an electrical signal that can be used to activate a buzzer (an alert system or
alarm sound).
HC – SR501 PIR sensor has three (3) pins; power supply pin (VCC), Digital output signal pin and
Ground pin. The power supply pin is connected to the power supply 5V DC to power the sensor,
the digital output pin is connected to the Arduino UNO microcontroller that is sending the digital
signals to the Arduino and the ground pin for earthing.
31 | P a g e
Connection of HC – SR501 PIR sensor to the Arduino UNO;
START
No Yes
Is the person
detected?
END END
32 | P a g e
CHAPTER FIVE
5.0. INTRODUCTION
This chapter deals with software implementation of the system, which comprises of; designing of
the circuit (simulation) model and various simulation results of the system using proteus design
suite 8.6.
The circuit for the proposed system is first simulated before the prototype is built to check whether
it can operate depending on the system performance requirements. In that circumstance, Proteus
Simulation software tool is used to develop the circuit model, examining whether the circuit
performance requirements are met. The Circuit operation of this model is divided into three (3)
main operating conditions. First, when the trigger switch of PIR sensor is HIGH (1) implying the
presence of the person within the PIR sensor field range. Second, when the feedback button is
pressed which will switch off the buzzer and turning the LED indicator ON. Third, when the trigger
switch of the PIR sensor is LOW (0) implying there is absence of the person within the PIR sensor
range.
The circuit below shows the proposed system circuit diagram as it will be simulated in Proteus
design suite 8.6 tool;
33 | P a g e
5.2. SIMULATION RESULTS
These results show various operating conditions that must be fulfilled to make the system work as
designed. Below are the simulation results as designed and simulated by Proteus design suite 8.6
tool;
This is done by pressing the trigger switch of the PIR sensor on the designed circuit.
A visitor
present at
the
entrance
(PIR sensor
HIGH)
This indicates the response of somebody from the inside of the house to the visitor on the outside.
When this switch is pressed, the buzzer will stop ringing and the LED indicator at the entrance
will turn ON.
34 | P a g e
Response
from the I am coming
inside signal at the
entrance
This is when there is no presence of the person at the entrance. Therefore, the system will return
back to normal.
PIR sensor
LOW
35 | P a g e
CHAPTER SIX
6.0 INTRODUCTION
This chapter concentrates on the implementation of different parts in the project to come up with
the single complete system of the proposed project. It is divided into two (2) parts; hardware
prototype implementation and circuit testing.
BUZZER LED
ARDUINO
FEEDBACK
SWITCH
PIR SENSOR
RELAY
The Arduino is implemented as described in the design. It is powered by the external power source
5V DC. Also, the Arduino will operate when the code is uploaded to it using Arduino IDE 1.8.9.
At the input is connected to the PIR sensor which sends signals towards it and the output connected
to LED indicator, feedback switch and buzzer.
36 | P a g e
Figure 22; 6.1.2. Arduino implementation with PIR Sensor
6.1.3. Implementation of the indication unit
This is also done as described in the design. It involves an LED indicator which alerts the visitor
in the response of the owner. The LED will be on when the feedback switch (rocker switch) is
pressed.
LED
Indicator ON
The complete circuit is implemented on the peace of wood where the circuit is attached to it firmly.
Below are different views of the complete circuit of the project prototype.
37 | P a g e
Figure 24; 6.1.4. side view of the system
There are different tests performed on the assembled prototype to ensure that the circuit operates
as intended and the required input and output voltages and currents are obtained. The testing
procedures were as follows;
• The power was switched to supply power the microcontroller (5V DC), Active Buzzer
(12V DC) and PIR sensor (5V DC)
• An object (a person) was placed on the field of view of the PIR sensor to trigger the sensor.
• The buzzer produces the ringing sound as an alert the person from the inside on the
presence of the person at the entrance.
38 | P a g e
• The feedback (rocker) switch was pressed, where the buzzer stopped ringing and the LED
indicator turned ON as an indication to the visitor.
This test method is done to check for continuous flow of current across any metallic path. Using
this test, any unwanted circuit breaks or short circuit connections are determined and can be put
under verification. The test was done using the multimeter. The procedures were as follows;
39 | P a g e
CHAPTER SEVEN
• Determination of the mechanism that would be able to distinguish between a human being
and an animal. Because the PIR sensors available are able detect infrared radiations emitted
by all warm bodies (humans and animals) but unable detect what kind of object is within
its range. Since, there will be some disturbances at the residential area in case animals pass
by, close to the entrance and get detected by the sensor.
7.2. RECOMMENDATIONS
This designed system can further be improved by developing certain means within the system that
will not allow other infrared emitting bodies apart from human being example cows, goats, cats,
dogs and so on from triggering the operation of the doorbell system.
7.3. CONCLUSION
The automatic electric doorbell system has been designed, implemented and constructed. Also, the
prototype of the designed system worked successfully according to the intended design
specifications. The system components used are readily available, relatively affordable and they
operate quite reliably. This system is significant in enhancing security, saving time for searching
for the doorbell switch when visitors come at our home places and saving electricity usage.
In the implementation stage, the system acts as an automatic electric doorbell which automatically
senses the presence of an object (warm body) within the PIR sensor range or field of view. This
system will be more substantial for those visitors who are too short or disabled such that they can
not reach the doorbell switch, because the sensor will see them immediately and sends signal to
the owner as a ringing sound.
40 | P a g e
REFERENCES
[5] Elprocus, "microcontrollers types and applications," 2013 - 2019. [Online]. Available:
https://www.elprocus.com/microcontrollers-types-and-applications/.
[8] Z. Tarus, PIR Sensor-based Security System, Metropolia: Helsinki Metropolia University of Applied
Sciences, 2017.
[10] T. Agarwal, "construction of automatic doorbell system," 1st march 2017. [Online]. Available:
https://www.edgefxkits.com/blog/construction-automatic-doorbell-system-with-object-
detection/.
41 | P a g e
APPENDICES
2 Consultation
(with
supervisor)
3 First oral
presentation
4 Report writing
5 Second oral
presentation
6 Submission of
report.
7 Third oral
presentation
42 | P a g e
APPENDIX II: SCHEDULE OF WORK PLAN IN THE SECOND SEMESTER 2018/2019
Table 10 Time Schedule for semester Two
SN ACTIVITIES WEEKS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1 Gathering of
requirement and
analysis
2
Designing
3
Report writing
4 Submit Progress
report
5 Implementation
and testing
6 Fourth Oral
representation
7 Final Report
Submission
8
Oral presentation
43 | P a g e
APPENDIX III: COST ESTIMATION
Table 11 Cost Estimation
44 | P a g e
APPENDIX IV: CODES FOR THE ARDUINO ATMEGA328
#define PIRpin 4
#define RELAY 12
#define LED 8
#define waitingSeconds 3
int WaitingTime=0;
const int button = 2;
bool resetState =false;
void setup() {
pinMode (PIRpin,INPUT);// PIR Sensor input pin
pinMode (LED,OUTPUT); // LED output pin
pinMode (RELAY,OUTPUT); // Relay pin
pinMode (button,INPUT); // Relay pin
attachInterrupt(digitalPinToInterrupt(button),reset,RISING);
}
void reset(){
if(digitalRead(RELAY)) {
resetState=true;
digitalWrite (RELAY,LOW);
digitalWrite (LED,HIGH);
WaitingTime=0;
}
}
void loop() {
if(resetState){
if(digitalRead (LED)){
delay(1000);
digitalWrite (LED,LOW);
}
45 | P a g e
if(digitalRead(PIRpin)==0)resetState=false;
}
else if (digitalRead(PIRpin) && WaitingTime>=waitingSeconds ) digitalWrite
(RELAY,HIGH);
else {
WaitingTime++;
digitalWrite (RELAY,LOW);
delay(1000);
}
}
46 | P a g e