design and construction of a person counter with voice alarm

63
DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING, AHMADU BELLO UNIVERSITY, ZARIA DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM BY DANBURAM AYUBA KWASAKO UO7EE1064 A PROJECT SUBMITED TO THE DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING, AHMADU BELLO UNIVERSITY ZARIA IN PARTIAL FULFILMENT FOR THE AWARD OF (B.Eng.) DEGREE in ELECTRICAL AND COMPUTER ENGINEERING i

Upload: ayuba-kwasako-danburam

Post on 18-Aug-2015

92 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING,

AHMADU BELLO UNIVERSITY, ZARIA

DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH

VOICE ALARM

BY

DANBURAM AYUBA KWASAKO

UO7EE1064

A PROJECT SUBMITED TO THE DEPARTMENT OF ELECTRICAL

AND COMPUTER ENGINEERING, AHMADU BELLO UNIVERSITY

ZARIA

IN PARTIAL FULFILMENT FOR THE AWARD OF (B.Eng.) DEGREE in

ELECTRICAL AND COMPUTER ENGINEERING

SEPTEMBER, 2012

i

Page 2: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

JANUARY 2012

CERTIFICATION

This is to certify that DANBURAM AYUBA KWASAKOwith reg. no U07EE1064, actually had his six month Industrial training and has documented this as his report.

………………………….. ……………………………..

Mal. KABIRU AHMED Date

(IT Supervisor)

………………………… ……………………………..

Mal. KABIRU AHMED Date

(SIWES Coordinator)

………………………… …………………………..

Dr. M.B MUA’ZUDate

(Head of Department)

ii

Page 3: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

DEDICATION

I hereby dedicate this report to my parent and siblings.

iii

Page 4: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

ACKNOWLEDGEMENT

I thank the almighty God who gave me the inspiration and divine enablement for the

writing of this work, to you alone is honor and glory due forever and ever.

My appreciation also goes to my parents, siblings and Hannah Zarma Bhamah for their

valuable suggestions and strong encouragements.

I would also live to acknowledge the immerse contributions of my SIWES coordinator and

supervisor Mal Kabiru Ahmed and the effort of Engr.Abubakar .A. Sadiq Technical Engineer

PHCN Gombe Business Unit

Finally I also appreciate the efforts of my friends, Yusuf Ibrahim,CeaserAntiya,

BognetJushua, Benedict Barnabas, and many more that have contributed to the success of this

report.

iv

Page 5: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

ABSTRACT

This is a report on my Student Industrial Work Experience Scheme (SIWES) with

the Power Holding Company of Nigeria Gombe Business Unit, Gombe state.

During this period I learnt both administrative and technical aspect of power

distribution and maintenance. The experience was all practical during which I

participated in the installation of transformers, mounting of poles. I was also

enlightened on the need for safety in dealing with electricity.

I shall attempt to use this five chapter piece of work to explain the experience

gained during my six months training.

v

Page 6: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

TABLE OF CONTENT

Title Page………………………………………………………………………………………….i

Certification ………………………………………………………………………………………ii

Dedication ………………………………………………………………………………………..iii

Acknowledgement …………………………………………………………………………….....iv

Abstract……………………………………………………………………………………………v

Table of content

………………………………………………………………………………….viList of

Figures……………………………………………………………………vii

List of Tables……………………………………………………………………..viii

CHAPTER ONE: GENERAL INTRODUCTION

1.1 Introduction to SIWES

1.2 Brief Overview of the IndustrialTraining (IT)…...…………………………………………1

1.3 Brief History of Industrial Training Program….……………………………………………2

1.4 Aims and Objectives of SIWES …………………………………………………………….3

1.5Motivation for Selecting PHCN Gombe Business Unit……………………………………..4

1.6 Training Methodology in PHCN Gombe Business Unit.................................................…...5

1.7 Report Outline……………………………………………………………………………….6

CHAPTER TWO: HISTORICAL BACKGROUND OF PHCN

2.1.0Brief History of Power Holding Company of Nigeria (PHCN) …………………………..7

2.2.0 Various Sections of PHCN …...…………………………………………………………...8

2.3.1 Generation Systems …………………….………………………………………………….9

2.3.2 Transmission System……….……………………………………………………………...10

vi

Page 7: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

2.3.3 Distribution System ………………….……………………………………………………11 2.4.0 Organizational Chart/Structure ……………………………………………………………12 2.5.0 Problem Faced by PHCN ………………………………………………………………….13

CHAPTER THREE: DETAILS OF TRAINING

3.1.0 Introduction to Details of Training ……….………………………………………………14

3.2.0 Industrial Safety ……………………………………………………………………..........15 3.2.1 Safety Rules ……………………………………………………………………………….16

3.3. Prevention Control and Metering …..……………………………………………………….17

3.3.1 Transformer Secondary Substation Comprehensive Test Result…………………………..18

3.3.2Insulation Resistance Test (Meggering) …………………………………………………..19

3.3.3 Transformation Test …………………………………………………………………….....20

3.3.4 Excitation test (Flux Test) ….……………………………………………………………...21

3.3.5 Earth Resistance Test (Ohms) ……………………………………………………………..22

3.4.0 Maintenance of Distribution Line………………………………………………………….23

3.4.1 Gang Isolator …..…………………………………………………………………………..24

3.4.2 Amending of Cut Wire …….……………………………………………………………....25

3.4.3 Trimming of Tress ………………………………………… ……………………………..26

3.4.4 Patrolling of The Distribution Lines……………………………………………………….27 3.5.0 Main Service Supply……………………………………………………………………….28 3.6.0 Marketing Section………………………………………………………………………….29 3.7.0 Maintenance of Transformer……………………………………………………………….30

CHAPTER FOUR

4.1.0 Experience Gained and its Application in the Future Carrier………………………….......31

4.1.1 Experience Gained….......…………………………………………………………….........32

4.2.0 Application in Future Carrier …………………………………..………………………….33

CHAPTER FIVE

5.0 Limitations, Difficulties, Suggestion to Future SIWES Student and Conclusion………......34

vii

Page 8: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

5.1 Limitation and Difficulties ………………………………………………………………….35

5.2Conclusion……………………………………………………………………………………

365.3 Suggestion and Recommendation ………………...…………………………………………

37Reference

………………………………………………………………………..38

List of figures

Fig 3.1: transformer Data………………………………………………………….39

Fig3.2:Gang insulator…………………………………………………………...40

Fig3.3: Cross Arm………………………………………………………………..41

Fig 3.4: Secondary Winding of a Transformer…………………………………42

Fig 3.5: Hole for Transformer Earthen…………………………………………...43

Fig 3.6: Ground Level Mounted Transformer…………………………………….44

Fig 3.7: Pole Mounted Transformer…………………………………………….45

Fig 3.8: Up Riser Cable…………………………………………………………..46

Fig 3.9 Feeder Pillar………………………………………………………………47

List of tables

Table 3.1 Insulation Resistance Test of Transformer (HV-E)…………………….49

Table3.2 Insulation Resistance Test of Transformer (HV-LV)…………………...50

viii

Page 9: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

Table 3.3Insulation Resistance Test of Transformer (LV-E)…………………….51

Table 3.4Insulation Resistance Test of Transformer LV Cables…………………52

Table 3.54Insulation Resistance Test of Transformer LV Cables-50mm*4core...53

Table 3.6 Insulation Resistance Test of Transformer Feeder Pillar Bars…………54

Table 3.7 Ratio Test…………………………………………………………….55

Table 3.8 Flux Test………………………………………………………………..56

Table 3.9 Earth Resistance Test………………………………………………......57

REFERENCE……………………………………………………………………58

ix

Page 10: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

CHAPTER ONE1.1 INTRODUCTION

This Project person counter with voice alarm using Microcontroller is a reliable circuit that takes over the counting number of persons/ visitors in the room very accurately. When somebody enters into the room the counter is incremented by one and when any one leaves the room then the counter is decremented by one. The voice alarm will indicate when all the persons in the room go out. The total number of persons inside the room is also displayed on the seven segment displays.

The microcontroller does the above job. It receives the signals from the sensors, and this signal is operated under the control of software which is stored in ROM. Microcontroller ATmega8 continuously monitor the Infrared Receivers, When any object pass through the IR transmitter's then the IR Rays emitted by the transmitter is being reflected on the receivers are, this obstruction is sensed by the Microcontroller through the relievers.

DISCRIPTION

i. TRANSMITTER: This module will be implemented using two transmitter and two receivers. The

infrared beams will be used because they not visible to human eye.

ii. RECEIVER: Infrared receivers will be used because is an active low device which means it gives

low output when it receives the infrared rays.

iii. MICROCONTROLLER: This is the CPU of this project it functions include; reading digital input

from the infrared receivers and calculate the number of person from them, sending this data to

the seven segment display so that it should be read.

iv. SEVEN SEGMENT DISPLAY: displays the output from microcontroller.

v. VOICE ALARM: indicates when room is empty.

Also, there are other supporting circuits that enable this project to operate successfully. These circuits include a driver circuit for the infrared transmitter, sound driver circuit connected to speaker and power supply circuit to power up the whole system.

LITERATURE REVIEW

Technological advancement occurring on all fronts of electronics and software engineering has in many ways simplified the design and construction of various counting systems. Historically, the first attempt at inventing a system capable of counting based on human movement was made in the early 1800s however use was made of various component including valves and pumps which were the only readily

x

Page 11: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

available component at that period. These components have major limitations which include their large and cumbersome nature thereby making their mass production, a near impossibility. Despite the limitations, this experiment presents a breakthrough in electronic engineering [D.A smith, 2003].

In 1907, a Russian scientist, Marko Ivanovo successfully designed and constructed an alarm circuit which he nicknamed, “Ivanovo’s Bells”. In his design, he made use of a photodiode as source of infrared radiation and a phototransistor to dictate the incoming radiation. He also incorporated a relay in his design. Once there was an obstruction in the path of infrared rays, a bell which was connected electrically to the relay would sound. This work to a large extends, represent a quantum leap in area of semiconductor use and application but still had a drawback in that, the bell used wore out with time [W.H Dennis 1982].

In a historical experiment which was conducted by a group of American Engineers namely, Alexander Graham Bell, Scott Stone and Peter Reid, at Bells Laboratory in the year 1935, use was made of very powerful infrared sensor which could detect infrared radiation coming from distance of as long as 100meters away. A very powerful infrared diode was used as source of infrared radiation and it was to work efficiently within limits of experiment accuracy. This design represent a turning point in area of sensor technology, although this design had a drawback in that it depend solely on power from an AC mains supply and hence could not operate without mains supply [W.A John, 1994]

The transistor to battery powered infrared alarms occurred in early 1940s. In 1945, an infrared security system was design and constructed by a group of 4th year electronic engineering student at the Department of Electrical and Electronic Engineering Laboratory of the prestigious Princeton institute of technology. In this historical experiment, use was made of purely discrete components including transistors, resistors and capacitors and a 9V dc battery as power supply source [Paul Horowitz and Winfield Hill, 1995]

The first infrared system which made use of an integrated circuit in its operation was designed and constructed by Prof. Winfield of the department of Electrical Engineering at Cambridge University in the late 1930s. In his design, he made use of the 555 timer, which was one of the earliest integrated circuits. This project was by far superior work to previous works done in the past in that it was very efficient, portable and use of lesser number of discrete components [Bluestein I, 1995].

The advent of the microcontroller and software programing in late 1970s further brought advancement to the area of electronics engineering and was widely used for various applications [McKenzie I. Smith, 1995].

In 1995, Ayuba I.S of the department of electrical engineering, Ahmadu Bello University, designed an electro industrial counter using a light dependent resistor and infrared emitter which generate signals whenever a product cut across the infrared radiation.

In 2001, Vaachi T.B Designed and constructed a photosensitive up- down counter using infrared emitter and photodiode which a clock pulse whenever there is interruption of light beam from the object sensor and the output of the counter is displayed using the common-anode seven-segment display.

xi

Page 12: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

In 2008, Abdulrahmam Kamal. Kof the department of electrical engineering, Ahmadu Bello University, Designed and construct a remote monitoring system to operate upon an interruption of light beam object sensor.

In 2010, Umar Y.EKof the department of electrical engineering, Ahmadu Bello Universit,y Designed and constructed a 4 digit decimal counter using a CMOS dual-BCD counter to generate pulses.

In 2011, Salawudeen. A. JKof the department of electrical engineering, Ahmadu Bello University, Designed and construct a digital visitors counter with security alarm system which uses BCD to generate pulses.

This project is different from the above literatures with the use of microcontroller and the inclusion of voice alarm.

1.3 PROBLEM DEFINATION AND METHODOLOGY

The major problem in this project is to design an ATMEGA8 microcontroller-based infrared person counter controlled by a program which will be written with the aid of interface software and a programme on an ATmega8, which will control the operations of all other part of the project. This project is based on the simple principle of reflection. In the course of design and construction, this project is divided into five blocks as shown in fig 1.1

Figs 1.1 Block diagram of person counter with voice alarm.

The invisible infrared wavelength is transmitted by the infrared diode at a particular frequency and when obstructed by an object, it is reflected to an infrared sensor (receiver). The operation of the infrared diode is controlled by a 555 timer (astablemultivibrator) the diode is connected to the 555 timer at pin 3 through a resistor and driver (transistor). The infrared sensor is connected to pin 2 of another 555 timer (monostablemultivibrator) through resistor and driver (transistor), the pin 3 of the 555 timer (monostablemultivibrator) is in turn connected to pin 5 of the ATMEGA8microcontroller, and this set up is for entry. The same thing goes for exit, just that for exit the pin 3 of 555 timer (monostablemultivibrator) is connected to pin 4 of the ATMEGA8 microcontroller. Pin 10,9,19,18,17,16 and 15 are connected to the seven segment display, also pin 23 and 24 are connected to the seven segment display this time through resistor and input driver each. The output display on the seven segment display is controlled by the ATMEGA8.

xii

TRANSMITTER RECIEVER MICROCONTROLLER

SEVEN SEGMENT DISPLAY

SPEAKER

Page 13: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

An ISD2560 (voice cheap IC) is connected to the ATMEGA8 microcontroller as follows; pin 27 to pin27, pin 24 to pin 26, pin 23 to pin 25. The ISD2560 (voice chip IC) is also controlled by the instructions generated by the ATMEGA8 microcontroller.

The output stage (speaker) is connected to pin 14 and pin 15 of the ISD2560 (voice cheap IC).

When the system is powered up by means of a switch connected to power supply, a POWER LED lights up, the seven segment display which is controlled by the ATMEGA8 microcontroller sets to 00, and the voice alarm chip also controlled by ATMEGA8 microcontroller also indicate that room is empty, indicating that there is no reflection on both exit and entry sensors from their respective transmitter.

When an object crosses or interrupts the path of the infrared rays, it is reflected to the sensor. If the rays are reflected to the entry sensor from the entry transmitter the seven segment display will be incremented by one, on the other hand if rays from the exit transmitter are reflected to the exit sensor the seven segment display is decremented by one. When value on seven segment display is 00 and rays are reflected from the exit transmitter to the exit sensor, the ISD2560 (voice chip IC) indicate that room is empty.

1.4 PROJECT OUTLINE

This project is divided into five chapters; chapter one gives a general introduction to the project; chapter two gives a theoretical background of the project including a brief description of various component used; chapter three contains a description and explanation of the hardware and software design of the project; In chapter four can be found an outline of the construction, development and testing of hardware and software of the project work and last chapter, chapter five contains the conclusion, problems encountered in the design and recommendations for future work.

1.5 SCOPE OF THE PROJECT

The areas covered by the project include infrared signal generation and it application to electronic systems, transistor operation in switching and amplification, Oscillator operations (both high and low frequency oscillators) 555 timers, integrated circuit technology and programing using an ATMEGA8 microcontroller [Paul Horowitz and Winfield Hill, 1995].

xiii

Page 14: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

CHAPTER TWO

THEORITCAL BACKGROUND

2.1 INTRODUCTION

In this chapter, a theoretical background of the project is presented and a summary discussion is

outlined on each of the main components and associated software packages used in the design and

construction of the system.

2.2 COMPONENTS’ DESCRIPTION

The following components were used in the design and construction of this project.

i. Diode

ii. Light emitting diode (LED)

iii. Infrared sensor

iv. Switch

v. Transistors

vi. Capacitors

vii. 555 timers (integrated circuit)

viii. Transformer

ix. Voltage regulator

x. Rectifier

xi. Speaker

xii. Voice alarm chip

xiii. ATMEGA8 microcontroller

xiv. Seven segment display

xiv

Page 15: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

2.2.1 DIODE

Diode is a device that allows current to flow in only one direction. It can therefore be used as a simple solid state switch in AC circuits when it is conducting.

The I-V characteristics of a p-n diode is shown in fig 2.1

Fig 2.1: I –V characteristics of diode

2.2.2 LED (LIGHT EMMITING DIODE)

The LED is a device that emits visible and/or invisible wavelength of light spectrum when a forward biasing current is passed through it. Most LEDS are constructed of gallium arsenide phosphide [M.D Abdullah, 2005].

For the purpose of this project a power LED was used. While a suitable efficiency of a LED can be obtain for as low as a current of 2mA passing through it, the usual design goal is in vicinity of 10-20mA. During conduction there is a voltage drop of 2V across the LEDs.

2.2.3 INFRARED EMITTING DIODE (INFRARED DIODE)

The infrared emits a narrow band of radiation peaking at a wavelength of about 940nm. It is a super high output power device and emits an infrared wavelength of suitable intensity. Summarily the infrared diode has the following properties.

xv

Page 16: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

i. Wide beam angleii. High output power

iii. Low costiv. Pulse are sent at a fixed frequency

The type of infrared diode used in designing this project is the IE-05030HP, because of it availability and reliability. [W .F John 1994]

The circuit symbol for the infrared diode is shown in fig 2.4

Fig 2.4: symbol of infrared diode.

2.2.4 INFRARED SENSOR

The sensor is a device that receives or senses signals coming from the infrared diode and converts these signals into a form suitable for interpretation by the ATMEGA8 microcontroller.

An infrared sensor, 042-BVI is used in the construction of this project. The sensor is a 3 pin device and each pin is connected to a separate part of the circuit [Bluestein I, 1999]

The circuit symbol for infrared sensor is shown in fig 2.5

Fig 2.5: symbol of infrared sensor.

2.2.5 SWITCH

xvi

Page 17: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

A switch is a device used to power a circuit, “ON” or “OFF”. When the switch is closed (“ON”), current will flow from power supply to the parts of the circuit. This is because the resistance between the switch contacts is very small. However, when the switch is opened (“OFF”), current does not flow through it due to the very high resistance between the switch contacts. [A. Wilson, 2001].

A single throw (SPST) switch is used in this project which when closed permits the flow of current from the power source (PHCN AC mains), through the transformer, rectifier and voltage regulator and into the ATMEGA8 microcontroller via it input pin.

The circuit symbol for switch is shown in Fig 2.6

Fig 2.6: symbol of switch

2.2.6 TRANSISTOR

A transistor is a device that is used in amplifying, switching and driver application in electronics circuits and systems. [W.H Dennis, 1982].

A BJT (bipolar junction transistor) has three terminals namely; Collector terminal(C), Base terminal (B), Emitter terminal(E) and two junctions namely Emitter- Base and Collector-Base junctions. The I-V characteristics of BJT is shown in Fig 2.7 indicating the saturation and cut-off regions of operation of operations of the transistor

2.2.7 CAPACITOR

A capacitor is a device that stores electrical energy in the form electrostatic field. It consists essentially of two conducting surface separated by layer of insulating material (or medium) called dielectric. The conducting surface may be in the form of either circular or rectangular plates or may be spherical or cylindrical in shape.

Capacitors are widely used as filters to remove AC signals from variety of circuits, AC ripples in DC power supplies, AC noise etc. they can also be used as timing components (together with resistors) in ICs and amplifier circuits.

A capacitor’s ability to store charge is called it capacitance (measured in farad). However, practical capacitors have capacitances of the order of Micro farad, Nano farad, and Pico farad.

Parallel plate capacitors are used for the construction of this project. The circuit symbol is shown in Fig 2.9 below.

xvii

Page 18: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

2.2.9 TRANSFOMER

A transfomer is a static (or stationary) piece of apparatus by means of which electrical power is one circuit is transform into electrical power of the same frequency in another circuit. It can raise or lower the voltage in a circuit but with a corresponding decrease in or increase in current. It operates based on the principle of electromagnetic induction whereby two circuits are linked together by a common magnetic flux and therefore are in mutual inductive influence of each other.

In its simplest form, it consist of two coils; the first coil called the primary winding in which electrical energy is fed from AC mains supply and the second coil is called the secondary winding from which electrical energy is drawn out.

The other necessary part of the tranfomer are;

i. A container for the core and windingsii. An insulating medium to insulate the core and the windings from the container.

iii. Suitable bushings (porcelain, oil-filled or capacitor type) for bringing out the terminals of the winding from the tank.

A step down transformer is used in this project to step down the 220/240V AC mains voltage at its input to a 12V AC output voltage. The circuit symbol of the transformer is shown in Fig 2.11

Fig 2.11: circuit symbol of a transformer

2.2.10 RECTIFIER

The rectifier is a circuit that employs one or more diodes to convert AC voltage into a pulsating unidirectional DC voltage.

There are different types of rectifier circuits some of which are;

i. Single phase half-wave rectifierii. Single phase full-wave rectifier

iii. Three phase half- wave rectifier

xviii

Page 19: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

iv. Three phase full-wave rectifierv. Full wave rectifier etc.

A full wave bridge rectifier is used in this project and is made up of four diodes with a transformer that is not centre tapped and the diodes are arranged in such a way that they form a bridge.

The circuit symbol of a full wave bridge rectifier is as shown in fig 2.12.

During the positive half cycle, diodes D2 and D3 become forward bias (ON) whereas D1 andD4

becomes reverse biased. Hence diodes D2 and D3 begin to conduct and D1 andD4 are open circuits.

During the negative half cycle, diodesD1 andD4 are forward biased (ON) where asD2 and D3 becomes reverse biased. This way, a unidirectional DC voltage is produced at its output. The figure 2.13a and 2.13b show the input and output waveforms of the rectifier diodes;

2.2.11 REGULATOR

Regulation is the provision of a required voltage at the load despite changes in input voltage.

Integrated circuit technology has simplified the design of a wide variety of power circuits. A 7805 regulator is used in this project.

The 7805 regulator is one of a series of 3 terminal voltage regulators (78xx series) and is available with a fixed output voltage making it useful in a wide range of applications. These include local card regulation, instrumentation, HIFI and other solid state electronic equipment.

The 7805 regulator has some features which are listed below:

i. Output current excess of 0.1Aii. No external current required

iii. Internal thermal overload protectioniv. Output voltage offered in 4% tolerance

The 7805 regulator in standard application is as shown in fig 2.24:

A common ground is required between the input and the output voltages. The input voltage must remain typically 2.0V above the output voltage even during the low point on the input ripple voltage.

2.2.12 SPEAKER

A speaker is a device that produces sound energy at its output. It falls into a class of devices known as transducer. A transducer is a device that converts energy from one form to another.

A speaker is a transducer that converts electrical energy into sound energy. In this project, the output stage is a speaker connected to a sound driver from voice alarm.

Fig2.15 shows a speaker symbol.

xix

Page 20: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

Fig 2.15: Symbol of speaker

2.2.13 555 TIMER IC

The 555 timer/oscillator IC is an analogue integrated circuit that is used for timing and oscillator applications. To fully understand the operation of the IC we look at its internal basic component and the major building blocks as shown on fig 2.16 below.

Fig 2.16: major building block of 555 timers.

xx

Page 21: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

As we can see it has two analogue comparator, S-R flip flop, inverter and discharge transistor. It also has three identical resistors each of 5KΩ resistance and this is the reason why it is called 555 timer. These resistors are used as voltage divider network between the two comparators in the IC. The comp. 1 has a reference voltage of 2/3V cc while the comp. 2 has a reference voltage of 1/3V cc. The comp. 1 is configured in non-inverting mode where it will be triggered to produce a high output only when the variable input from the threshold (6) input is above the reference voltage (2/3V cc ). The comp.2 is configured in inverting mode where it will be triggered to produce a high output only when the variable input from the trigger (2) input is below the reference voltage (2/3V cc ).

Output of the 555 timer is controlled by threshold (pin 6) and trigger (pin 2). When voltage at pin 6 is above2/3V cc comp. 1 is high which trigger thee reset (R) input of the flip flop and hence the out Q of the flip flop is low but since we are using the inverse output Q′ is going to be high. This input is connected to the inverter which gives low output finally at pin 3 and at the same time this high input triggers the discharge transistor and sets it to saturation condition so that any voltage at pin 7 is (discharge) is now allowed to pass from the collector through the emitter of the transistor to the ground. But when voltage at pin 2 is below1/3V cc comp. 2 is high and this trigger the set (s) input of the flip flop and makes the Q′ low which is inverted by the inverter to give high input at pin 3 while the discharge transistor is cut-off since low voltage is at the base, therefore nothing can pass from discharge pin (7) to the ground. When pin 4 (reset) is not in use, we tie it to pin 8 (supply) of the 555 timer.

The 555 timer/oscillator IC is used as, Monostablemultivibrator, Astablemultivibrator andBistablemultivibrator.

In this project, 555 timer is used as, Monostablemultivibrator and Astablemultivibrator.

2.2.14 MICROCONTROLLER

A microcontroller belongs to a class of devices which can be programmed using a programmer and associated software development s, which are installed on a personal computer (PC) to carry out required task and execute certain instructions.

The microcontroller used in this project is the ATmega8.It is a member of AVR microcontroller family; it has many features similar to that of ATmega32. But it has reduced number of features and capabilities, yet it has enough features to work with. If we want to gather knowledge and simultaneously want to do it in less cost than the budget of ATmega32, we can think of making projects with ATmega8. In that case, one feature we won’t be able to realize is the JTAG interface. But rest of the features are available in this IC. Let us see what one can get from ATmega8.

The pin configuration of ATmega8 is shown in fig 2.17

xxi

Page 22: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

Fig 2.17: pin configuration of ATmega8

The ATmega8 have the following features;

i. Memory: It has 8 Kb of Flash program memory (10,000 Write/Erase cycles durability), 512 Bytes of EEPROM (100,000 Write/Erase Cycles). 1Kbyte Internal SRAM

ii. I/O Ports: 23 I/ line can be obtained from three ports; namely Port B, Port C and Port D.iii. Interrupts: Two External Interrupt source, located at port D. 19 different interrupt vectors

supporting 19 events generated by internal peripherals.iv. Timer/Counter: three Internal Timers available, two 8 bit, one 16 bit, Offering various operating

modes and supporting internal or external clocking.

xxii

Page 23: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

v. SPI (Serial Peripheral interface): ATmega8 holds three communication device integrated. One of them is Serial Peripheral Interface. Four pins are assigned to it to implement this scheme of communication.

vi. USART: One of the most powerful communication solutions is USART and ATmega8 supports both synchronous and asynchronous data transfer schemes. It has three pins assigned for that. In many projects, this module is extensively used for PC-Micro controller communication.

vii. TWI (Two Wire Interface): Another communication device that is present in ATmega32 is Two Wire Interface. It allows designers to set up a commutation between two devices using just two wires along with a common ground connection, As the TWI output is made by means of open collector Outputs, thus external pull up resistors are required to make the circuit.

viii. Analogue Comparator: A comparator module is integrated in the IC that provides comparison facility between two voltages connected to the two inputs of the Analogue comparator via External pins attached to the micro controller.

ix. Analogue to Digital Converter: Inbuilt analogue to digital converter can convert an analogue input signal into digital data of 10bit resolution. For most of the low end application, this much resolution is enough.

2.2.15 SEVEN SEGMENT DISPLAY

A seven segment display is the most basic electronic display device that can display digits from 0-9. They find wide application in devices that display numeric information like digital clocks, radio, microwave ovens, electronic meters etc. The most common configuration has an array of eight LEDs arranged in a special pattern to display these digits. They are laid out as a squared-off figure ‘8’. Every LED is assigned a name from 'a' to 'h' and is identified by its name. Seven LEDs 'a' to 'g' are used to display the numerals while eighth LED 'h' is used to display the dot/decimal.

A seven segment is generally available in ten pin package. While eight pins correspond to the eight LEDs, the remaining two pins (at middle) are common and internally shorted. These segments come in two configurations, namely, Common cathode (CC) and Common anode (CA). In CC configuration, the negative terminals of all LEDs are connected to the common pins. The common is connected to ground and a particular LED glows when its corresponding pin is given high. In CA arrangement, the common pin is given a high logic and the LED pins are given low to display a number.

The pin diagram of seven segment display is shown on fig 2.18.

xxiii

Page 24: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

Fig 2.18: pin diagram of seven segment display.

xxiv

Page 25: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

CHAPTER THREE

DESIGN PROCEDURE AND ANALYSIS

3.1 INTRODUCTION

This chapter describes in details the selection criteria of component used and the calculations

made to arrive at their respective values. The design can be categorized into hardware and

software design, the hardware design covers the circuitry up to the point where transmission of

digital data begins. Also, the software design is discussed which covers the algorithm, flow chart

development and writing of assembly language program using the ATmega8 instruction set.

The system may be subdivided into 6 units as outlined below

1. POWER SUPPLY UNIT

2. INFRARED TRANSMITTER UNIT(LED)

3. INFRARED RECIEVER UNIT(SENSOR)

4. SOUND DRIVER(TRANSISTOR STAGE)

5. ATMEGA8 MICROCONTROLLER

6. SEVEN SEGMENT DISPLAY

xxv

Page 26: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

3.2DESIGN OF POWER SUPPLY UNIT

The power supply unit consists of;

I. A 240/12V 500mA step down transformer

II. A full- wave Bridge Rectifier

III. Capacitor Filter

IV. A voltage Regulator

Fig 3.1 shows the block diagram of power supply unit.

Fig. 3.1: Block diagram of a power supply

3.1.2 SELECTION OF TRANSFOMER

The selection of transformer used is dependent on the total maximum current and voltage

rating of component used. The current and voltage rating of basic component used in the

project from their manufacturer’s data sheets are given in table 3.1

xxvi

Page 27: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

Table 3.1 Electrical characteristics of components.

COMPONENTS MAXIMUM CURRENT

RATING (mA)

TYPICAL VOLTAGE

RATING (V)

IN4148(DIODE) 20 -

IN4001(DIODE) 20 -

BC547(TRANSISTOR) 100 ×2 4.8

INFRARED DIODE 50 -

555 TIMER(IC) 6×4 5

ATMEGA8(IC) 3.6 5.5

TOTAL 317.6mA

Based on the data, a transformer rating of 240/12V 500mA 50Hz was chosen. By making

reference to the elementary theory of the voltage transformer, the following equation can

be derived for a transformer.

K =N 2N1

= E2E1

(3.1)

Where; E1 = primary (input voltage)

xxvii

Page 28: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

E2 = Secondary voltage (output voltage)

N1 = number of turns in the primary winding

N2 = number of turns in the secondary winding

K = Voltage transformation ratio (or turns ratio)

Based on the transformer rating K can be evaluated thus;

K =N1N 2

=24012

= 20

Thus, the number of turns of the transformer is 20

The power rating of the transformer can be evaluated using the formula.

P =I rmsV rms (3.2)

Where I rms= root mean square value of output current

V rms= root mean square value of output voltage

Therefore; P =500×10−3 ×12= 6W

3.2.2 SELECTION OF BRIDGE RECTIFIER DIODE

In selecting the diodes used in the bridge rectifiers, the Peak Inverse voltage (PIV) and

maximum secondary voltage (Vsm) of the diode were taken into consideration.

The PIV of diode is;

xxviii

Page 29: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

PIV=Vsm (3.3)

PIV=√2 ×12=17V

This is the maximum reverse voltage above which breakdown of diode occurs in the

reverse direction. Hence, diodes IN4001 are used as rectifier diodes.

3.2.3SELECTION OF FILTER CAPACITOR

The capacitor used as filter is selected based on the following calculations;

C1=¿

I dc

4 f (V ¿¿SM−V dc)¿¿ (3.4)

V SM=√2V rms = 16.97V

V dc = 2V SM

π(3.5)

V dc = 2 × 16.973.14

=10.8V

Similarly,

I dc = 2 I SMπ

(3.6)

I dc=2×√23.14

× 500 = 450mA

C1=¿

450× 10−3

4×50×(16.97−10.08)¿ = 400µF

xxix

Page 30: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

The voltage of the capacitor is;

V c = 32

× V dc (3.7)

V c = 32

× 10.08 = 15.12V

Hence, a capacitor with a rating of 47µF, 16V is suitable as a filter capacitor due to its

high market availability.

3.2.4 REGULATOR SELECTION

Based on the previous analysis, the d.c voltage output of the bridge rectifier diode was

calculated to be 10.08V (i.e. V dc =10.08) and basically all the integrated circuits are

powered by regulated supply voltage of 5V. A 7805 regulator IC which takes a range of

+7V to +35V unregulated voltage is chosen. The capacitor C2 connected across the

output of regulator IC as shown in fig 3.2 improve transient response, keeps the

impedance low at high frequencies and it’s very small compared to capacitor filter. A

value of 0.1µF is suitable as an output filter for the voltage regulator. The electrical

characteristics which were taken into consideration when selecting the voltage regulator

as obtain from the manufacturer’s data sheet are shown in the table below.

Table 3.2 Electrical Characteristics of 7805 regulator

CHARACTERISTICS CONDITIONS MIN TYP MAX UNITS

xxx

Page 31: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

TR?

TRAN-2P3S

C?2200uF

VI1

VO3

GND

2

U?7805

C?0.1uF

R?2.2k

D?LED

220V, 50Hz

D1

1N4007

D2

1N4007

D3

1N4007

D4

1N40070v

5v

Fig. 3.2: Circuit Diagram of Power Supply

Output Voltage 4.8 5.0 5.2 V

Line Regulation 7.0V≤V ¿≤25V - - 100 mV

8.0V≤V ¿≤15V - - 50 mV

Load Regulation 5.0mA≤I out≤1.5mA - - 100 mV

250mA≤I out≤750mA - - 50 mV

Quiescent Current - - 8.0 mA

Dropout Voltages I out=1.0 A - 2.0 - V

Peak Output Current - 2.2 - A

The circuit diagram of the power supply unit is shown below. Fig. 3.2

3.3 DESIGN OF INFRARED TRANSMITTER (LED) UNIT

The infrared transmitter unit consists of;

xxxi

Page 32: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

I. Light emitting diodes (LED)

II. 555 timer (AstableMultivibrator)

III. NPN BJT Transistor (driver transistor).

3.3.1 SELECTION OF LEDs

The LEDs and associated resistors were selected based on performance and electrical

characteristic as discussed. Two LEDs were used both for exit and entry transmitter. A

current of 20mA flows from the power supply through a current limiting resistor (R5) as

seen in fig.3.3 and the LED. The resistor’s function is to limit the current flowing into the

diode at its anode to prevent it from blowing the diode. Based on the data sheet of the

diode, it is seen that a forward voltage of 2.1V occurs at the diode terminals.

Using ohms law;

ID = V s

Rm −

V D

Rm (3.8)

Where; Rm = minimum current limiting resistance

ID = maximum forward current

V s = supply voltage

V D = maximum forward diode voltage

Thus for a current of 30mA (maximum forward current of LED);

xxxii

Page 33: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

Rm = 5−1.7

20×10−3 = 165Ω

Thus the resistor, R5 should not be less than 165Ω i.e. R5 ≥ Rmin

A suitable resistor value of R5 = 330Ω was used as current limiting resistor.

3.3.2 SELECTION OF 555 TIMERS (ASTABLE MULTIVIBRATOR)

As discussed earlier, a 555 timer is device that oscillates back and forth. A 555 timer is

selected for use in the transmitter unit as oscillator; it is configured in astable mode as

seen in fig3.3. Resistors R3 and R1, together with capacitor U1 form the timing circuit.

The resistors and capacitor were selected based on the following criteria;

1. The value of capacitor (U1) must be less than 500pF to avoid stray capacitance.

2. The resistors R3 and R1 must not be less than 1kΩ to avoid over current.

3. R3 + R1 must not be more than 3.3MΩ.

4. Maximum frequency that can be achieved is 1MHz

5. Maximum output current is 200mA. [Mal. A. Kabiru, EEEN540 lecture note]

Based on this the value of R15, RV1 and C20 were choose to be 1KΩ, 5KΩ and 0.01µF

respectively.

3.4 DESIGN OF INFRARED RIECIEVER (SENSOR) UNIT

xxxiii

Page 34: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

The infrared receiver unit consists of;

I. Infrared sensor

II. 555 Timers (monostablemultivibrator)

III. NPN BJT Transistor (driver transistor)

3.4.1 SELECTION OF INFRARED SENSORS

Infrared sensors were suitable because the light from the transmitter is infrared which is

not visible to human eye and therefore suitable for this work. Associated resistor and

capacitors were selected based on performance and electrical characteristics as discussed

earlier.

3.4.2SELECTION OF 555 TIMERS (MONOSTABLE MULTIVIBRATOR)

This unit consists of two timers each for entry and exit sensor respectively, which were

configured in monostable mode at the same timing operation. A monostable is said to

have a single stable state that is the off state. Whenever it is triggered by an input pulse,

the monostable switches to its temporary state. It remains in that state for a period of time

determined by an RC network. It then returns to its stable state. Fig 3.4 shows the circuit

diagram of 555 timers (monostablemultivibrator).

xxxiv

Page 35: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

R4

DC 7Q

3

GND

1VCC

8

TR2

TH6

CV5

U1

R4

DC 7Q

3

GND

1VCC

8

TR2 TH 6

CV5

U2R610k

R710k

100uf C100uf

555 Timer for Entry Sensor 555 Timer for Exit Sensor

Fig. 3.5 Circuit diagram of 555 Timer Unit

Input Trigger from Entry Sensor

Input Trigger from Exit Sensor

Output to the Input driver (Entry) Output to Input driver (Exit)

5V 5V

In fig. 3.4, the duration of the output pulse in seconds can be calculated using the

formula T=1.1R6C

Where R6 and C are timing resistor and capacitor respectively and T is the period

of the output pulse. For proper implementation T was taking to be 1 second, and the

value of capacitor C was picked to be 100µF

Then, T = 1.1R6C = 1

R6¿1

1.1x 10 0−6 = 9.09K𝛀The commercial value of R6 = R7 = 10K𝛀 was used in the design.

The output from the transducer unit served as the trigger to the pin 2 of 555

timers. Thus, the output of 555 timers is being controlled by the input trigger. The

collector of 2N3904 used was connected to a pin of microcontroller and also through

10K𝛀 to Vcc.

xxxv

Page 36: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

The microcontroller used (ATmega8) can sink a current of about 3.6mA

maximum. Thus, by taking the sinking current to 0.5mA, the pull up resistor can be

calculated.

Therefore, the value of pull up resistor R is R= 50.5mA

=10 K𝛀3.4.2 SELECTION OF INPUT DRIVERThis comprises of two NPN BJT transistors (BC547) each for the entry and exit doors respectively. The output from each of the sensor goes to the base of each transistor through a network of a resistor and two capacitors. The transistor is used as the switching device that drives the signal that goes to the 555 timer. The network of resistor and capacitor provide necessary timing and switching.The BC547 was selected

as a driver transistor for the 555 timers based on the following procedure;

1. The transistor's maximum collector current Ic(max) must be greater than the load

current Ic. load current Ic =supply voltageVsload resistance RL

2. The transistor's minimum current gain hFE(min) must be at least five times the

load current Ic divided by the maximum output current from the IC. hFE(min) >

5 × load current Icmax . IC curren

3. Calculate an approximate value for the base resistor: RB =Vc×hFE

5×Ic

where Vc = IC supply voltage (in a simple circuit with one supply this is Vs)

xxxvi

Page 37: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

More over; any general purpose low power NPN transistor can be used. For

general use RB = 10KΩ, RC = 1KΩ

3.4.4 DESIGN OF THE MICROCONTROLER (ATMEGA8).Basic connecting

The current flowing through the reset pin can be calculated asIRst= 5

10000 = 0.5mAAs seen in the figure above, in order to enable the microcontroller to operate properly it is necessary to provide:

a. Power supply:b. Reset signal: and c. Clock signal.

xxxvii

Page 38: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

Power supplyEven though this microcontroller can operate at different power supply voltages, why to test “Murphy’s low”?! A 5V DC is most commonly used. The circuit, shown in the figure, uses a cheap integrated three-terminal positive regulator LM7805, and provides high-quality voltage stability and quite enough current to enable the microcontroller and peripheral electronics to operate normally (enough current in this case means 1Amp).

Reset signalIn order that the microcontroller can operate properly, a logic 0 (0V) must be applied to the reset pin RS. The push button connecting the reset pin RS to power supply VCC is not necessary. However, it is almost always provided because it enables the microcontroller safe return to normal operating conditions ifsomething goes wrong. 5V is brought to this pin, the microcontroller is reset and program starts execution from the beginning.

Clock signalEven though the microcontroller has a built-in oscillator, it cannot operate without two external capacitors and quartz crystal which

xxxviii

Page 39: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

stabilize its operation and determines its frequency (operating speed of the microcontroller).

3.4.3 DESIGN OF THE 2 DIGIT 7 SEGMENT DISPLAYFor visual interactivity with the user, the display is incorporated

in the design work. The display provides a visual presentation of the system counter to the user and also enables the user to see the number of people in the hall.

A common anode arrangement is used since it allows current to be sunk through the LEDs by the microcontroller. The digits are multiplexed to reduce wiring complexity. The digits are individually driven by a PNP transistor as shown in.

The current through each segment can is calculated as followsCurrent through the base of the BC547 PNP transistor is;

IB= 5−0.71000 = 4.3mA

Current through the collector is; xxxix

Page 40: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

IC= IB× 𝛽Where; 𝛽 is the gain of the

amplifier = 100Therefore IC = 4.3×10−3 × 100 =

0.43ACurrent through segments = 50

100× IC = 0.5 × 0.43 = 0.215ACurrent through each segment = 0.215

7 = 30.7mA

xl

Page 41: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

CHAPTER FOUR

CONSTRUCTION, PROGRAM DEVELOPMENT, EXECUTION AND TESTING

4.1 INTRODUCTION

This chapter describe in details, the construction procedure of system hardware, program development and execution on the ATmega8 microcontroller, testing of the entire system and casing of the system hardware.

4.2 CONSTRUCTION PROCEDURE

In the course of designing and constructing this project, the following components with their respective values and rating were used:

RESISTORS:

RV1 = 5KΩ

R12 = 5.1KΩ

R13 = 33Ω

R14 = 100Ω

R6, R7, R9, R15 = 1KΩ

R1, R2, R3, R4, R5, R8, R10, R11 = 10KΩ

DIODES:

D1, D2, D3, D4 – IN4007

D5 – LED

xli

Page 42: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

D6.

CAPACITOR:

C9 = 470µF

C12 = 4µF

C13 = 220µF

C1, C4 = 2.2µF

C5, C6 = 1.0µF

C19, C20 = 10nF

C2, C3, C7, C8, C16, C21 = 0.1µF

C10, C11, C14, C15, C17, C18 = 100Nf

TRANSISTORS:

Q1, Q2, Q3, Q4, Q5 – BC547 (NPN BJT)

INTEGRATED CIRCUITS:

ATmega8 (microcontroller)

555 timer (monostablemultivibrator) ×2

555 timer (astablemultivibrator) ×2

LM7805 Regulator (3 pin IC)

ISD256 (Voice Alarm chip IC)

TRANSFORMER:

220V/12V, 500mA

OTHERS:

Speaker/Buzzer

Infrared sensor – 042-BV1

Vero boards

Sockets

xlii

Page 43: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

Connectors

Jumper wires

In the course of the design and construction of this project, the selection of the above components to reduce bulkiness and complexity was taken into consideration. [Mrs C.O Alenoghena 2007]

The circuit components were first placed on the bread board taking note of polarities and numbering of the pins. Tests were conducted at different stages and results were recorded. This gave room for correction and modifications.

The components were then soldered on a Vero board. For soldering an alloy of 60% tin, 40% lead was used. The soldering provides two functions; to mechanically bind the components to the Vero board and to provide electrical continuity between the components on the board.

4.3 COMPONENT LAYOUT

Vero boards were made use of in the design and construction of this project. The main components like the ATmega8, 555 timers, IC, resistors, capacitors, and transistors were soldered on the main Vero board while the other components like the transformer, voltage regulator and active diode were soldered on separate smaller Vero board and connected by means of wires to the circuitry on the main Vero board. Also, a separate connection goes from the transformer to the power supply. Jumper wires were used to link points which could not be linked directly with solder wires on the Vero board. The seven segment displays and speaker were connected by means of separate to the ATmega8, IC and associated circuit components on the Vero board. After testing, the whole system was housed in a black plastic casing with holes bored through it for the speaker, the indicator LEDS and nuts.

4.4 PROGRAM DEVELOPMENT ON THE ATMEGA8 MICROCONTROLLER

The program development, implementation and execution were done using MPLAB IDE (Integrated Development Environment) and interface with Atmel STK500 programmer. This software allows for code editing, compilation, debugging/simulation and program loading through an appropriate programming interface. Program development was done using MPLAB IDE due to ease of use and efficiency, as the microcontrollerworks well with the integrated environment. For the ATmega8, the compiler used to generate machine codes for it is called Atmel STK500 compiler. After the codes were written, the compiler was used within the MPLAB environment to assemble and link the program and after error checking and debugging, to produce a HEX file containing the machine code instructions for the particular AVR microcontroller, in this case the ATmega8.

The figure4.2 below shows an Atmel STK500 development board.

xliii

Page 44: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

Fig 4.2: Atmel STK500 development board.

4.5 PROGRAM LOADING AND EXECUTION ON THE ATMEGA8 MICROCONTROLLER

Atmel's AVRs have a two stage, single level pipeline design. This means the next machine instruction is fetched as the current one is executing. Most instructions take just one or two clock cycles, making AVRs relatively fast among the eight-bit microcontrollers.

The AVR processors were designed with the efficient execution of compiled C code in mind and have several built-in pointers for the task.

In-system programing (ISP) was used which basically programs the microcontroller via its SPI pins. The Atmel STK500 programmer was connected from the PC to its USB serial port via a USB cable making it possible to interface with the MPLAB IDE software. Thereafter the program was ran and debugged for error-checking.

4.6 SYSTEM TESTING

The various components were tested using a multimeter to verify that right connections were made and ensure that there were no short circuits in the design. The diodes and LEDs were tested to ensure that they conducted in forward direction and they did not in reverse direction. Also the forward and reverse currents flowing through them were measured using a multimeter to ensure that they did not exceed the maximum values as stated in their manufacturers’ data sheets. The output voltage of the regulator was also measured and found to be in the range of the required output voltage needed to power up the ATmega8 and ICs (i.e. 4.8-5.4V). the input and output current at the pins of the ATmega8 and ICsboth when high, ON and low, OFF were each measured and compared with the maximum values as stated in their manufacturers’ datasheets to ensure that they were within safety limits. The transistor current- voltage characteristic were also determined and found to comply with the standard characteristics of transistor operating as switches and driver circuits.

4.7 CASING

xliv

Page 45: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

This is the final appearance given to the system hardware. The system hardware was housed in a plastic casing with the following factors taken into consideration

i. Spaced occupiedii. Portability of the project

iii. Allowance for heat dissipationiv. Ease of insulationv. Thermal conductivity

The dimensions of the casing are

Height =

Length =

Width =

The Vero board was screwed on the plastic casing. The figure below shows the casing of the project.

CHAPTER FIVE

CONCLUSION, LIMITATIONS AND RECOMMENDATIONS

5.1 INTRODUCTION

This chapter presents the conclusion that were drawn from this project, some problems encountered in the course of this work, the precaution taken and some recommendations that could be useful to prospective designer of this nature.

5.2 CONCLUSION

The person counter with voice alarm has been successfully designed, constructed and tested.

The project has been satisfactorily used to count the number of people entering or leaving a room and to indicate through voice alarm when the room is empty.

The ATmega8 was successfully programmed to control the operation of the infrared sensor to receive or sense the reflected infrared radiation from infrared diode due obstruction by person or object I accordance with the principle of reflection.

The project was found to work efficiently within reasonable limits of experimental accuracy.

The project further gave the opportunity of exploiting the diverse capabilities and possibilities inherent in ATmega8 microcontroller device in terms of memory, data storage and precise timing of instructions.

5.3 PROBLEM ENCOUNTERED IN THE PROJECT DESIGN

xlv

Page 46: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

In the course of constructing this project, some components including the integrated circuits were destroyed due to wrong connections and excessive currents flowing through them.

The program on the ATmega8 had to be debugged several times due to errors encountered during program implementation.

The problem of obtaining genuine and required Integrated Circuits, infrared transmitter, infrared receiver and other associated components.

The problem of interfacing of interfacing the MLPAB Integrated Environment and associated software development tools with the Atmel STK500 programmer.

5.4 PREACAUTIONS

i. A dot type Vero board was used in construction for easy soldering.ii. During soldering, components were well placed on the Vero board to prevent short-circuits and

wrong connections.iii. Some sensitive wires were glued to the board to prevent unwanted removal.iv. The circuit was properly checked for short-circuits and open circuits before being powered.v. The current flowing through each component as well as the voltages across each component

were measured using a multimeter in order to make sure excessive currents that will damage the component do not flow through them.

vi. A socket was used to connect the ICs and ATmega8 to the Vero board in order to avoid complications in the circuit design, to prevent damage to the pin of the ICs and ATmega8 and to prevent the ICs and Atmega8 from being damaged.

5.5 RECOMMENDATIONS

In the course of designing and constructing this project it was discovered that this project could be further enhanced and improved upon in future for the project to be of more use and benefit to the society.

The following recommendations are proposed:

i. Increasing the distance of the infrared beam with the use of more infrared diodes and concentrating the rays with the use of lenses, this will require more power.

ii. Incorporating a PC interface so that the number of person can be stored and the result can be sent to a remote server in this way the project can operated even from distant.

iii. Incorporating a backup battery in case of power failure.

xlvi

Page 47: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

REFERENCES

1. A Wilson: Electronic Designs: Pitman Publishing Ltd., London, U.K.2001, pp. 39-852. Berlin Howard M. The 555 Timer Applications with experiments. Howard W. Sam & Co. Inc. 1982

pp.27-30.3. Bluestein I. “sensors magazine” Vol. 13 No. 14, U.K 1995, pp. 254. D. A Smith: The fundamentals of Semiconductors. Cambridge University, U.K, 2003. pp.2055. http://en . Wikipedia.org/wiki/temp:peripheralinterfacecontroller.6. Mal. Kabiru A. Electronic Engineering (III). Unpublished Lecture Note, Department of Electrical

and Computer Engineering Ahmadu Bello University, Zaria. 2012.7. Paul Horowitz and Winfield Hill: The Art of Electronics 2nd Ed. Cambridge University Press U.K

pp.992-9938. W.F John. The chemistry of semiconductors: Pitman publishing Ltd. U.K 1994 pp. 759. W.H. Dennis: Electronics components Butter worth and Co. Ltd. U .K., 1982 pg. 153

.

xlvii

Page 48: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

REFERENCES

1. A Wilson: Electronic Designs: Pitman Publishing Ltd., London, U.K.2001, pp. 39-852. Berlin Howard M. The 555 Timer Applications with experiments. Howard W. Sam & Co. Inc. 1982

pp.27-30.3. Bluestein I. “sensors magazine” Vol. 13 No. 14, U.K 1995, pp. 254. D. A Smith: The fundamentals of Semiconductors. Cambridge University, U.K, 2003. pp.2055. http://en . Wikipedia.org/wiki/temp:peripheralinterfacecontroller.6. Mal. Kabiru A. Electronic Engineering (III). Unpublished Lecture Note, Department of Electrical

and Computer Engineering Ahmadu Bello University, Zaria. 2012.7. Paul Horowitz and Winfield Hill: The Art of Electronics 2nd Ed. Cambridge University Press U.K

pp.992-9938. W.F John. The chemistry of semiconductors: Pitman publishing Ltd. U.K 1994 pp. 759. W.H. Dennis: Electronics components Butter worth and Co. Ltd. U .K., 1982 pg. 153

.

xlviii

Page 49: DESIGN AND CONSTRUCTION OF A PERSON COUNTER WITH VOICE ALARM

xlix