Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 42

CHAPTER ONE: INTRODUCTION

1.0 BACKGROUND The society we live in today is one of convenience, many things we do involve using automated processes in one form or another. For example, when we are in shopping malls, we can take escalators to different floors, when we want to communicate, we can pick up our cell phones and talk to persons thousands of kilometres away. Modern marvels such as these have changed our lives. Since time immemorial, man had maintained a stance of creativity and development of innovations that made it possible for the emergence of tenable solutions whenever confronted with inconveniences, thus necessity is the mother of invention. The application of electronics and mechanical devices to the world around us is nearly limitless. Since the advent of semiconductor devices till date, the world has seen electronics become a major influence in every aspect of our daily life. It is virtually impossible to do daily tasks without relying on electronics and automation. This project work is based on the application of microcontroller with its ancillary components and mechanics. Almost all areas of technology have started taking the advantage of the inexpensive computer control that the microprocessor can provide. The automatic door opener with motor driver described here automates the entrances to residential and public buildings such as banks, shopping malls, hotels, company offices, airports and packing lots to residential homes, organizations, automobile terminus and public car parks. It consists of sensors placed at a close proximity to the entrance and exit which senses an interruption caused by a person or any opaque object at the entrance
1

and exit, and the microcontroller which monitors the state of the sensors. The microcontroller in turn sends a signal to the motor which in accordance with the program opens and closes the door via motor driver.

1.1 PROBLEM STATEMENT The inconvenience experienced in trying to open or close entrances and exits doors respectively by visitors or strangers entering into large buildings such as big shopping malls, hotels, airports, large offices and some residential homes, carrying items bought from shopping malls for example, or those carrying their luggage to the airports as well as the unfortunate disposition of the elderly or physically challenged- those who cannot on their own open entrance doors but would depend on helping hands, are the problems that necessitated this research work. A need for the automation of entrance and exit doors is thus needed, and it is the intention of this research work to design an automatic door with a display that is based on a microcontroller.

1.2 OBJECTIVE The objective of this study is to design and construct a microcontroller based automatic door opener with a counter and LCD display for use in public buildings such as company offices, banks, shopping malls and some residential homes so as to provide convenience, easy access and in order to monitor the number of persons in the building.

1.3 SCOPE This project work is the design and construction of a microcontroller based automatic door that opens and closes upon sensing any person approaching the sensors close to the door, with an LCD display that displays a count not exceeding 255 persons entering or leaving the building.

1.4 SIGNIFICANCE Inhabitants of and visitors to public and residential buildings, tourism and entertainment venues like airports and hotels, would benefit from this study as it checks the frequent inconvenience experienced in entrance and exit by strangers or visitors. The research work would be beneficial to Electrical and Electronics Engineering students across higher institutions as it would go a long way to exposing them to the application of microcontrollers for development of simple and complex automation.

1.5 ORGANIZATION This project report is made up of five chapters and what each chapter handles is stated below; I) Chapter one deals with the general introduction to the project work; it consists of the background, problem statement, objective, scope and significance of the work. II) Chapter two handles the literature review; information on previous work relevant to the topic.

III)

Chapter three deals with the design and construction procedures, details of all calculations and working drawings and design considerations for the choice of component values.

IV)

Chapter four covers the performance and cost evaluation; it contains the results and findings of the research work, and the respective cost of all components used.

V)

Chapter five handles the summary, conclusions and recommendations for further work.

CHAPTER TWO: LITERATURE REVIEW


2.0 INTRODUCTION The need for automatic doors has been on the increase in recent times. The system described here incorporates the use of microcontroller as a controller in achieving the purpose of this project. As affirmed by Shoewu and Baruwa [1], the microcontroller has revolutionalized the electronics industry and has had a remarkable impact on many aspects of our lives. Almost all areas of technology have started taking advantage of the inexpensive computer control that microprocessor can provide. Some typical applications include electronic games, CD players, automatic braking systems, industrial process controls, electronic measuring instruments, automobile emission controls, microwave ovens, traffic controllers, and a rapidly growing number of new products. The automatic door described here automates the entrances to public buildings such as banks, shopping malls, office buildings, airports, residential homes, automobile terminus, and public car parks. It uses the microcontroller convenience to avoid the stress of manually opening and closing the entrance doors. The technology used eliminates door monitoring and manning by human beings. The door uses the state-of-the-art entry system, the doors have to perform gyrations-open, auto-reverse, stop, fully close and fully stop. The automatic door is not a security device and should not be construed as one. It provides a convenient access and intelligent feature that makes it distinct from all other door which brings it so close to security device.

2.1 REVIEW OF AUTOMATIC DOORS The automatic door operation is accomplished when the open or initiate command is transmitted from the activation device to the control box. A wide variety of devices can be used to activate the doors including wall switches, motion or proximity sensors, infrared beams, or any device that switches using dry contents. Krutz [2] asserted that a microcontroller based control board controls the hold open time and functionality of the doors. Hold open times can be set 1-99 seconds by means of the control board and opening times can be adjusted from 1.5 to 5 seconds by changing air regulator pressure and air flow controls. McGlen [3] said that series operator can be easily mounted to any conventional door frame header and the face of the door. Easy to use templates and an extensive installation and owners manual are included with the units allowing for simple installation. Private door openers [4] revealed that the control box is microcontroller based to insure maximum reliability and flexibility for the end user. The system has been designed to be easy to set up and operate. The control unit is design to be connected to a constant power source of 220V, 60Hz, which powers the control box and a wide variety of activation devices with 24AC power. The control box can be mounted up to 25 feet away from the operator. The only connection between the control box and the operators are two flexible diameter air lines. Air supply to the control box is accomplished through a single air line, if multiple sets of operators are connected to a single control box, a larger air supply line to the control box may be required.

2.2 REVIEW OF SENSORS LIGHT DEPENDENT RESISTORS (LDR) Floyd, [5] defines light dependent resistor (LDR) as a device which has resistance which varies according to the intensity of light falling on its surface. He further explained that light dependent resistors are vital component in any electric circuit which is to be turned on or off automatically according to the level of ambient light-for example, solar powered garden lights, and night security light.

Fig. 2.1: A typical light dependent resistor. Neal [6] interfaced a simple LDR sensor circuit to a microcontroller to control a light/dark detector. According to him, there are two basic circuits using the LDR, the first is activated by darkness, the second is activated by light. The two circuits are very similar and just require an LDR, some standard resistors, a variable resistor and any small signal transistor. According to Floyd [5], LDRS or light dependent resistors are very useful especially in light/dark sensor circuits. Normally the resistance of an LDR is very high, sometimes as high as 1M, but when they are illuminated with light resistance drops dramatically. When the light level is low the resistance of the LDR is high. This prevents current from flowing to the base of the transistors. Consequently the light emitting diode (LED) does not light. However, when light shines onto the
7

LDR its resistance falls and current flows into the base of the first transistors and then the second transistor, the LED lights. The present resistor can be turned up or down to increase or decrease resistance, in this way it can make the circuit more or less sensitive. Vo ( )Vin

The LDR was used to design and construct a device that would be of use to persons who are in the habit of falling asleep while watching or listening to music. The scope of the work ranges from the conceptualization of the idea and theories behind the operation of the device to the stage of packaging the design. The unit provides automatic disconnection of the appliances from the alternating current (AC) main supply upon the expiration of a pre-set time delay period. The system works by detecting a transition from light to darkness in a room. This triggers the device into a time-out mode. During the time delay period, the appliances e.g. compact disk player is connected to main supply. Disconnection occurs after the pre-set time delay period elapses. A key feature of this device is that its operation is light dependent, that is, the device is activated only when it is powered ON in the absence of ambient light or in a sufficiently dark environment making it a light dependent automatic-off timer for electrical appliances. The light dependent automatic-off timer uses a light dependent resistor (LDR) as its light sensor. INFRARED SENSOR Infrared radiation is part of the electromagnetic spectrum which includes radio waves, microwaves, visible light, ultraviolet light, as well as gamma and x-rays.

The infrared range falls between the visible portion of the spectrum and radio waves. Infrared wavelengths are usually expressed in microns, with the infrared spectrum extending from 1.7 to 1000 temperature measurement. Using advanced optic systems and detectors, non-contact infrared thermometers can focus on nearly any portion or portions of the 0.7-14 micron band. Because every object emits an optimum amount of infrared energy at a specific point along the infrared band, each process may require unique sensor models with specific optics and detectors types. For example, a sensor with a narrow spectral range centred at 3.43 macrons is optimized for measuring the surface temperature of polyethylene and related materials. A sensor set up for 5 microns is used to measure glass surfaces. As explained, the intensity of object emitting infrared energy varies in proportion to its temperature. It is the emitted energy, measured as the targets emissivity that indicates an objects temperature. Emissivity is a term used to quantify the energy emitting characteristics of different materials and surfaces. Infrared sensors have adjustable emissivity settings usually from 0.1 to 10, which allow accurate temperature measurement of several surface types. The emitted energy comes from an object and reaches the infrared sensor through its optical system, which focuses the energy onto one or more photosensitive detectors, the detector then convert the infrared energy into an electrical signal ,which is in turn convert into a temperature value based on sensors calibrations equation and the targets emissivity. This temperature value can be displayed on the sensor or in the case of the smart sensor, converted to a digital output and displayed on computer terminal.

2.3 REVIEW OF COMPUTER MEMORIES The purpose of electronic memories is the same as that of human memory-to retain information so that it can be used at a later time, Tokheim [7]. Although human memory is able to store a wide variety of items, such as names, languages, images of scenes, scent, digital electronic memory is limited by being able to remember only sequences of zeros and ones or highs and lows. Much of the effort invested in computer science at the present time is devoted toward finding efficient ways to store and retrieve information about languages, images and perhaps even scent in digital memories. The development of electronic memories or electronic storage elements has been an integral part of the development of computers, as a result, the language used to describe memories is the language of computer architecture and computer science; the converse is also true. In fact, early computers were called stored program devices, or stored program calculating machines, indicating that at least in the beginning, one of the most important features of computer was the memory. A wide variety of memories or storage elements have been used within the relatively short computer era. The earliest computers used relays and punched paper tapes memories. Other early elements included acoustic delay lines (an electromechanical analogue of a shift register) and magnetic drums. Since then punched cards, magnetic tapes, magnetic disks of many types and magnetic cores have been used. In the last decade, integrated solid state memories have come to dominate the computer memory market.

10

2.4 REVIEW OF THE ATMEL AT89S52 MICROCONTROLLER According to Mazidi [8], the AVR Atmel Corporation, in 1981 introduced an 8-bit microcontroller called the AT89S52.This microcontroller had 256 bytes of RAM,8K bytes of on-chip ROM, three timers, one serial port and four ports (each 8-bit wide) all on a single chip. At the time, it was also referred to as a system on a chip. The AT89S52 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at time. Data larger than 8 bits has to be broken into bits pieces and be processed by the CPU. The AT89S52 has a total of four input and output ports, each 8 bits wide. Although the AT89S52 can have a maximum of 64k bytes of on-chip ROM, many manufacturers have put only 4k bytes on the chip. The AT89S52 became widely popular after Atmel allowed other manufacturers to make and market any flavour of the AT89S52, they are pleased with the condition that they remain code-compatible with the AT89S52.This has led to many versions of the AT89S52 with different speeds and amounts of on-chip ROM marketed by more than half a dozen manufacturers. It is important to note that although there are different flavours of the AT89S52 in terms of speed and amount of on-chip ROM, they are all compatible with the original AT89S52 as far as the instructions are concerned. This means that if you write your program for one, it will run on any one of them regardless of the manufacturer.

FEATURE ROM

QUANTITY 8K bytes

11

RAM Timer I/O pins Serial port Interrupt Sources

256 bytes 3 32 2 8

Table 2.1: Features of the AT89S52 microcontroller.

2.5 REVIEW OF DISPLAYS Shoewu and Baruwa [1] used a 7-segment configuration to form the decimal characters 0 through 9 and the hex characters A through F. The display unit comprised of the following; Z80 PIO, BCD-to-7-Segment Decoder/Driver and a7-Segment display. The Z80 PIO used in the display unit provides two 8-bit I/O ports, which have been programmed as output ports. The output of the PIO cannot be fed directly to the 7-segment display; therefore, it needs a driver. The unit sends signals to the driver each time a vehicle crosses the gate. A BCD-to-7-Segment Decoder/Driver is used to take a four-bit BCD input and provide the outputs that will pass through the appropriate segments to display the decimal digits. Figure 2.4 shows the BCD-to-7-Segment Decoder/Driver (74LS47) being used to drive a 7-Segment common anode LED readout. Each segment consists of one or two LEDs. The anodes of the LEDs are all tied to Vcc (+5V). The

12

cathodes of the LEDs are connected through currentlimiting resistors to the appropriate outputs of the decoder/driver. The decoder/driver has active-LOW outputs, which are open-collector driver transistors that can sink a fairly large current. This is because LED readouts may require 10 to 40mA per segment, depending on their type and size. The display unit is used to show in decimal values, the number of vehicles that passed through the entrance gate (number of vehicles coming in) and the number of vehicles going out through the exit gate. The difference between the two gives the number of vehicles in the facility at any time. This serves as a counter. The system is designed in such a way that it monitors the space available in the park.

Fig. 2.2: Display unit.

13

2.6 REVIEW OF DOOR CONTROL Shoewu and Baruwa [1], in an endeavour to design and construct a microprocessor based automatic gate, employed the use of the following devices to achieve automatic gate control; - PNP and NPN transistors - Diode - Motor The PNP and NPN transistors are arranged in such a way that a pair (PNP and NPN) controls the opening of the gate through the motor and the other pair reverse the polarity of the motor by rotating it in the opposite direction to close the gate. There is a time interval of 10 seconds between the opening and the closing of the gate. The arrangement of the diode serves to protect the transistors from reverse bias polarity and the resistor serve to improve switching time. The motor is used to control the opening and closing of gate, the electric (DC) motor used is one that has the ability to rotate in both directions simply by reversing the polarity.

14

12

Q3 R3 1K
4

D1 1N4007GP

D4 1N4007GP

Q4
2

R2

BJT_NPN_VIRTUAL S1
6 10 7 8

1K BJT_NPN_VIRTUAL
11 5

DC_MOTOR_ARMATURE Q1 R1 1K BJT_NPN_VIRTUAL 9
3

D3 1N4007GP

D2 1N4007GP

Q2
1

R4

1K BJT_NPN_VIRTUAL

Fig. 2.3: Door control circuit.

The researcher after embarking on diligent study of various literatures was informed about the attempt by several individuals, and groups of individuals to develop an automatic door opener. It reveals the distinct difficulties and problems encountered by them. One of the intriguing efforts is the one made by two indigenes- Shoewu and Baruwa specifically on the software and the motor control system. Considerable setbacks were noticed, besides there were limitations on the sensor units being triggered erratically, the researcher wishes to work towards overcoming such limitations.

15

CHAPTER THREE: DESIGN AND CONSTRUCTION PROCEDURE


3.0 SYSTEM DESCRIPTION From fig. 3.1 shown below, once the system is powered on, the infrared transmitter continuously transmits infrared light at a frequency of 38KHz which can be received by the infrared receiver. The microcontroller monitors the state of the receiver output and then enables the motor driver to open or close the door when there is a change in the state of the receiver (from low-high or highlow); the microcontroller also registers and increments the count as persons enter or leave through the door and sends the data to be displayed on the LCD display. A complete circuit diagram of the system and a snapshot of the circuit is shown in the appendix. Certain specifications, parameters and methods of implementation must be considered in system design and construction in order to give the expected result. The various data on the components used in the design of the study were obtained from datasheets and textbooks. They provided the electrical characteristics (maximum and minimum voltage, current and power ratings of electrical components) which served as a guide in properly utilizing the components in the design. The implementation of the design involves segmenting the overall system design into modules/units, which are individually designed and tested before the integration of the various subsystems. The system design is divided into; I) Hardware design consisting of: - Power Supply Unit - Infrared Sensor Unit
16

Door Control Unit

- Display Unit - CPU Module II) Software

POWER SUPPLY

INFRARED TRANSMITTER

INFRARED RECEIVER AT89S52 MICROCONTROLLER SWITCH

MOTOR MOTOR DRIVER

LCD DISPLAY

Fig. 3.1: Block diagram of the system.

17

3.1 POWER SUPPLY UNIT The microcontroller based system design has to be activated with a clean power supply of good regulation characteristics. A transient on the power line could send the microcontroller wandering, resulting in system failure. The circuit operates on a 5V voltage and as a result, the power supply unit design is 5V DC and is not affected by variations in the AC voltage serving as input to the transformer. The components used as shown in fig. 3.2 are explained below:

Fig. 3.2: Power supply unit.

3.11 TRANSFORMER In order to achieve an input voltage for the regulator that falls within the range of the difference between input and output of the regulator, a transformer with a secondary voltage of 8.5V was rewound so as to obtain a peak voltage of 12V as explained below; Input voltage Output voltage of regulator = 4 7 V With an input voltage of 12V and an output voltage of 5V, 12 5 = 7V, which falls within the range. The input voltage into the regulator is the output voltage of the capacitor, and the output voltage of the capacitor = Vp = 12V
18

Where Vp = Peak voltage Vp = Vrms 3.1 Vrms = Vrms =

= 8.5V Vrms is the secondary voltage of the transformer and thus the transformer equation is used to get the number of turns in the secondary side of the transformer as shown; E = 4.44f
m mN

. 3.2

= Bm A . 3.3

Where, E = transformer secondary voltage f = frequency of the AC source


m

= maximum flux

N = number of secondary turns Bm = maximum flux density A = area of the core E = 8.5V, f = 50Hz, Bm = 1.15 wb/m2 for sine wave A=l b

From measurements of the transformer core,

19

l = 2.9cm, and b = 2.2cm A = 2.9 = 6.38 2.2 = 0.029 10 4 m2


mN

0.022

From, E = 4.44f N= =

Where, E = 8.5V for secondary side N= = = 52.18 turns = 52 turns approx. A copper wire of gauge 26 was used in the winding because of the recommended current rating of 1.3A which is closest to the desired secondary current of 1A. The primary side remains untouched as it was manufactured to work with 220V.

3.12 RECTIFICATION The IN4007 diode converts the AC current to DC and satisfies charging current demands of the filter capacitor. The arrangement of the diodes is called a bridge rectifier. Rectification is done by the PN junction diodes. The DC voltage varies above and below an average value. This variation is called ripple voltage. In order to reduce ripple voltage to a very small value, the DC voltage needs to be filtered.
20

3.13 FILTER CAPACITOR Filter capacitor was chosen to be large enough to reduce the ripple voltage contained in a rectified voltage, to a relatively filtered voltage which resembles a smooth DC voltage as much as possible.. To determine the proper value of capacitor used, the equation given below is employed: i= 3.4

Where q = CV 3.5 i= C= dV = Vr (Ripple voltage), and dt = T= Thus dt = C=

i = 1A, f = 50Hz,

Vp = 12V and Vr = 10% of Vp Vr = C= 12 = 1.2V

21

= 8.333

10 -6 F

= 8,333 F A capacitance value of 6,800 F was chosen due to availability, with a voltage of 25V which is above the supply voltage.

3.14 REGULATOR (LM7805) The LM7805 regulator is a three terminal positive regulator which can deliver an output current of up to 1A. It receives the input of a constant DC voltage and supplies as output a somewhat lower value of DC voltage, which it maintains fixed or regulated over a wide range of load current or input variation. The LM7805 regulator maintains a +5V dc supply voltage to the system.

Fig. 3.3: LM7805 Regulator.

22

3.2 INFRARED SENSOR UNIT Two pairs of sensors are used for the entire system in an ideal situation; each pair for the entrance and exit doors. The sensor unit arrangement is in such a way that it consists of two pairs of infrared receiver to provide signals for the microcontroller whenever there is an obstruction through the entrance or exit door. For the design, two conditions are considered: first, when light rays are focused on the infrared receiver, and secondly when the rays are being interrupted. When light rays of are focused on the infrared receiver, the output voltage is low and when the light rays are interrupted, the output voltage increases. Each pair of sensors is separated by a reasonable distance such that the passage of a person or other moving objects cannot obstruct the sensor pair separation. The sensor is conveniently installed on both sides of the automatic door frames. This consists of an infrared LED directed at an infrared receiver. For the purpose of simplicity and elimination of obscurity, the researcher chooses to use the infrared receiver and infrared LED. In this case, the infrared receiver and LED are placed opposite each other on the door frame. As the intensity of light falling on the infrared receiver increases, the impedance of the infrared receiver decreases. The two parts of the sensor unit- an infrared LED (light emitting diode) and an infrared receiver module, as discussed below.

23

3.2.1 INFRARED LED This is a high intensity diode that emits infrared light at a frequency of 38KHz as programmed by the timer 2 of the microcontroller which is not visible to the naked eye. It operates on a 5V voltage source.

Fig. 3.4: Infrared LED circuit. In order to determine the value of the series current-limiting resistor, the following equation is used: Rs = .. 3.6

Where VF = the forward voltage for the LED IF = the continuous forward current of the LED From the infrared LED datasheet, VF = 1.2V, thus for the two LEDs VF = 2 IF = 20mA = 20 Vcc = 5V
24

1.2 = 2.4V

10-3A

Thus Rs = Rs = = 130

The value of 120

was chosen due to market availability.

3.2.2 INFRARED RECIEVER MODULE When infrared light falls on the infrared receiver, a low signal is observed at the output of the receiver. This low signal at the base doesnt bias the transistor, thus the microcontroller then sees a high signal (Vcc) at its input pin. When the infrared light is obstructed, a high signal is observed at the output of the receiver, which biases the transistor to switch the ground. The microcontroller under this condition sees a low signal (0V) at its input pin.

Fig. 3.5: Infrared Receiver circuit.

25

The 100

resistor and 4.7uF capacitor connected to the infrared receiver are

recommended in the datasheet to suppress power supply disturbances. Thus, the output of the sensor unit is either logical high or low. The software developer is at liberty of considering either logic high or low as they write the program. The transistor is a three-layer semiconductor device consisting of either two n- and one p-type layers of material or two p- and one n-type layers of material. The former is called an NPN transistor; while the latter is called a PNP transistor. Application of transistors is not limited solely to the amplification of signals. Through proper design it can be used as a switch for computer and control applications. For the base resistor of the transistor used in the receiver circuit = = Where Vcc = 5V, and Rc = 10K (pull up resistor) = 5 / 10K = 0.5mA = = 0.5mA / 10 = 0.05mA = 50A Also, ............................................................................... 3.8 ,

3.7

26

= = 86K The closest standard resistor value of 82K was chosen for the base resistor.

3.3 MOTOR CONTROL DRIVER AND ACTUATOR The door control unit is made of the motor driver and a DC motor as explained below; 3.3.1 L293D MOTOR DRIVER The L293D is a quadruple drivers capable of delivering bidirectional drive currents of up to 600mA at voltages from 4.5V to 36V.As the microcontroller ports are not powerful enough to drive DC motor directly, a L293D chip is used, it is a 16 pin chip. The pin configuration is as shown in figure 3.5, to set appropriate level at two pins of the microcontroller to control the motor. Since this chip controls two DC motor there are four input and output pins for the four drivers in the IC. The driver 1 and driver 2 controls the first motor clockwise and anticlockwise directions while driver 3 and driver 4 controls the second motor in the same way. There are also two enable pins they must be high (+5V) for operation, if they are pulled low(GND), the motor will stop.

27

Fig 3.6: L293D Motor Driver.

3.3.2 DC MOTOR A motor is an electromechanical device that converts electric energy into mechanical energy. Its action is based on the principle that when a currentcarrying conductor is placed in a magnetic field, it experiences a mechanical force whose direction is given by Flemings Left-Hand Rule and whose magnitude is given by; F=BIL Newton Where, F=Mechanical force in Newton (N) B=Magnetic field in Weber (Wb) I=Current through the conductor in Amperes (A) L=Length of Conductor in meters (m)

28

3.4 DISPLAY UNIT The display unit is a liquid crystal display (LCD). It is a thin flat panel used for electronically displaying information. It is low electrical power consumption enables it to be used in battery- powered electronics equipment. It is an electronically-modulated optical device made up of any number of pixels filled with liquid crystals. They use far less power than comparable LED displays because they block or pass the light from other sources rather than emit their own. The pin connection is as shown below;

Fig. 3.7: A Liquid Crystal display (LCD).

3.5 CPU MODULE The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density non-volatile memory
29

technology and is compatible with the industry- standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of flash, 256 bytes of RAM, 32 I/O lines, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry.

3.6 SOFTWARE DESIGN SOFTWARE DEVELOPMENT PROCEDURE Designing software for the automatic door opener was not a trivial task. In the development cycle of a microcontroller base system, decisions are made on the parts of the system to be realized in the hardware design and the parts to be implemented in software. The software is decomposed into modules so that each can be individually tested as a unit and debugged before the modules are integrated and tested as a software system in order to ensure that the software design meets its specification. The program for the system is written in assembly language for speed optimization. Assembly code represents halfway position between machine code and high level language. The assembly code is usually mnemonic derived from the instruction itself, i.e. LDA is derived from LOAD the Accumulator. Assembly code is thus simple to remember and use when writing programs.
30

When entering an assembly program into a microcontroller, the assembly code must first be converted into machine code. For short programs, of a few lines, this relatively easy and usually requires that the programmer construct a table which contains the assembly mnemonics and the equivalent machine code. This technique is known as Hand Assembly and is limited to program of about one hundred lines or less. For longer programs, a separate program called an assembler program, is used to convert the assembly code into machine code which is placed directly into the microcontroller memory. The software was designed using the following steps: i. ii. iii. Algorithm Flowchart Assembly Language Codes

3.6.1 ALGORITHM A step by step statement showing the chain of steps involved in solving a problem. An ordered sequence of well defined and effective operations which terminates in a finite amount of time. The algorithm is as shown; - Start - Generate 38KHz frequency - Check sensor for interrupt - Open door - Check opposite sensor for interrupt - Close door - Display in (or out) count on LCD - Stop.

31

3.6.2 FLOWCHART Flowchart can be defined as graphic representation of the definition, analysis and solution of a problem, or a chart that pictorially displays the chain of steps involved in solving a problem. The flowchart for the program is illustrated in appendix 1.

3.6.3 ASSEMBLY LANGUAGE An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture. This representation is usually defined by the hardware manufacturer, and is based on abbreviations (called mnemonics) that help the programmer remember individual instructions, registers, etc. An assembly language is thus specific to a certain physical or virtual computer architecture (as opposed to most high-level languages, which are portable). The program is as shown in appendix 2.

3.7 COMPONENT ASSEMBLING Assembling is a very important stage in the construction process. It is usually the transfer of an idea from abstract to the concrete world. It involves inserting, connecting or joining the various components in a vero-board in accordance with the schematic diagram. The Vero-board consists of two faces, a free face and a face with copper coatings in form of parallels lines. It also contains many perforated holes that facilitate the insertion of component. In this project, the components were inserted through the free face and interconnected in the copper face using soldering iron and lead. The cutting of
32

the line was done by razor blade, and the joining of two parallel lines was done with jumper wires. IC sockets were used to accommodate the IC, a way of avoiding damaging of the ICs by excessive heat dissipated by the soldering iron.

3.8 OUTER CASING DESIGN The outer casing is made of wood. This choice was given priority for its structural rigidity. The casing houses the entire circuitry, dc motor and door assembly, power supply unit, moving mechanism and its ancillary items. On the front (entrance) of the casing is the arrangement of the sensor unit, consisting of the infrared (LED), a source of light beam carefully aligned and focused on the infrared receiver module. On the rear side of the casing is a hole through which the power supply cable passes. A snapshot of the casing is shown in the appendix.

9cm 23cm

48cm

Fig. 3.8: Outer casing design

33

CHAPTER FOUR: PERFORMANCE AND COST EVALUATION 4.0 INTRODUCTION


This chapter reveals the tests carried out on the project work and the performance /results obtained. It also provides a list of the components used and the cost.

4.1 TESTING/PERFORMANCE Prior to the final assembling of the automatic door opener each unit was subjected to various characteristics test. Use was made of a digital multi-meter to determine and compare the voltage level at some strategic points. For instance; -In the power supply unit, the dc motor requires 5V while the electronic circuitry was powered by 5V. It was expedient that the voltage output be tested before coupling. -Voltages on the microcontroller input and output pins were also tested. Pins 40 and 31 should be at Vcc Potential, Pin 20 at ground potential. -The motor was also observed to rotate in a clockwise and anticlockwise direction when there was an interruption in the respective sensor pair. - The LCD displayed the count of the number of persons that the microcontroller registered and increments, as persons enter or leave through the door.

34

Parameter
Frequency at P1.0 of the microcontroller and at the infrared LED Voltage at the infrared receiver module with no obstruction in the line of sight transmission Voltage at the infrared receiver module with obstruction in the line of sight transmission

Measured Value
37.97KHz

0V

1.76V

Table 4.1: Test results.

4.2 LIST OF COMPONENTS AND COSTING The various components selected for the assembling of the automatic door opener with counter and LCD display and their costs are displayed in the table below;

S/NO. 1. 2.

COMPONENT Resistor (120) Resistor (100)

QUANTITY 1 2

RATE (N) 5 5

AMOUNT(N) 5 10

35

3. 4. 5.

Resistor (82K) Resistor (10K) Variable resistor (10K)

3 7 1

10 10 30

30 70 30

6.

Capacitor (25V,6800uF)

100

100

7.

Capacitor (16V,4.7uF)

20

40

8.

Capacitor (16V,10uF)

30

30

9. 10. 11. 12. 13.

Capacitor (30pF) Diode (IN4007) Regulator (LM7805) Power switch Transistors (BC337 NPN)

2 4 1 1 3

30 5 50 40 30

60 20 50 40 90

14 15. 16.

Transistor (BC 327) Infrared LED Infrared receiver module

2 2 2

30 150 350

60 300 700

17.

Reset switch

20

20

36

18. 19. 20. 21. 22.

Quartz crystal Transformer (8.5V) DC motor (5V) Vero board Microcontroller AT89S52

1 1 1 2 1

50 1000 1000 100 400

50 1000 1000 200 400

23.

Motor driver (L293D)

250

250

24.

Casing Total

4000

4000 9,325

Table 4.2: Component costing

37

CHAPTER FIVE: CONCLUSIONS


5.0 SUMMARY This project work attempts to proffer a lasting solution to the long lingered difficulties and inconveniences with door opening in an unprecedented manner. Unprecedented in the sense that it employs the microcontroller as the brain of the system, thereby eliminating the use of unnecessarily large number components. The use of assembly language to program the microcontroller guarantees excellent performance and accuracy beyond average. Information surfed from the internet and relevant books form the sources of data used to achieve the desired goal. Components selected were assembled on a Vero-board in accordance with schematic diagram. The assembly was tested with relevant instrument before the final packaging and casing. Tested results reveal that: The voltage measured at some strategic points were approximately tending to the value obtained from calculations. This can be justified with fact that, i. ii. No conducting material is perfect. Same components of some values do not measure perfectly the same when tested with multimeter. iii. Joints made with soldering lead introduce capacitive effects especially if not properly soldered. Instead of a 5V dc motor of used in this model, if a motor of higher torque were acquired, it could be mounted in any real standard door for automatic operation.

38

5.1 CONCLUSION The findings aforementioned indicate that the project was successful. This proves beyond reasonable doubt that the system is more reliable because of the ease with which instructions could be written to the chip in assembly language, coupled with this is the ease with which the program could be modified. Despite the prevalent advantages accompanying this system, it should not be accepted as a perfect and flawless product.

5.2 RECOMMENDATIONS The researcher recommends the use of this project in domestic buildings, schools, hospitals, industries etc. For further study, modification and improvement, the researcher recommends: The program could be modified by writing a program for displaying a count of up to five hundred persons or more so as to obtain the count of persons entering or leaving large public buildings. The University should provide a modality for ensuring that components necessary for any design are readily available and found in the laboratories. Separate entrances could be used in the design- one for entrance and exit respectively, and the program modified accordingly. The program could also be modified to include a display of the remaining persons in the building which would be an arithmetic difference of the in and out count.

39

REFERENCES 1. Shoewu O. and Baruwa O.T. (2004).Design and construction of microprocessor Based Automatic Gate. Unpublished B.sc project, Lagos State University: Epe, Nigeria 2. Krutz, R.L.(1980).Microcontroller and Logic Design, John Wiley and Sons, Inc: New York, NY 3. McGlen, L. (1978).8080A, 8085 Assembly Language Programming. McGraw-Hill, inc: New York, NY 4. Private Door Information. Lombard, IL; www.privatedoor.com 5. Floyd L.T. (2002). Electronic Devices, Sixth Edition, Pearson Education Singapore pte. Limited India. 6. Neal S.W.(1998).Digital System; Principles and Application. Eigth Edition Prentice-Hall International: Princeton, NJ. 7. Tokheim, R.L. (1988).Digital Electronics; Principles and Application. Fifth Edition. McGraw-Hall, Inc: New York, NY. 8. Mazidi, A.M. and Mazidi J.(2000).The 8051 microcontroller and Embedded System. 9. Theraja B.L and A.K Theraja, (2005).A Textbook of Electrical Technology S.Chand Company Limited. Ram Nagar, New Delhi-110005. 10.Robert L.B. and Louis N.(2004).Electronic Devices and Circuit Theory. Eight Edition, Prentice-Hall of India Private Limited, New-Delhi

40

APPENDIX

Plate 1: The Assembled Components.

Plate 2: The Outer Casing.


41

Fig. A: Complete circuit diagram.

42

You might also like