Last Updated 24 Mar 2020

Microcontroller Based Car Parking

Words 8645 (34 pages)
Views 864
JOMO KENYATTA UNIVERSITY Of AGRICULTURE AND TECHNOLOGY FACULTY OF ENGINEERING Department of Electrical and Electronics Engineering P. O.

Don't use plagiarized sources. Get Your Custom Essay on

Microcontroller Based Car Parking

just from $13,9 / page

get custom paper
. BAARIU A. M This report is submitted in partial fulfillment of the requirement for the award of BSc. Degree in Electronics and Computer Engineering of Jomo Kenyatta University of Agriculture and Technology. MARCH 2009 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009

DECLARATION I, George Ngugi Kibia, registration number E26-0668/03, do hereby declare that this is my original work and that it has neither been submitted nor transferred by any other student for a degree or any other course in this institution or any other institution of learning. George Ngugi Kibia Signature………………………………. Date………………………………………… CERTIFICATION This project has been proposed, developed supervised and submitted for examinatio n with my approval as the University supervisor. Mr. Baariu A. M Signature………………………………. Date……………………………………….. Lecturer, George N Kibia E26-0668/03 Page 2

MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 Acknowledgement I thank God, the Almighty for the gift of life and for enabling me to pursue my undergraduate studies with good health both mentally and physically. I also kindly thank and acknowledge the efforts of the people who have helped me from the onset to the completion of my course and project. First of all I am grateful to my supervisor, Mr. Baariu A. M for his insight, professional assistance, kind guidance and constructive criticism regarding my work. This was a driving force and immensely contributed to completion of y project . I also thank my parents and siblings whose constant support and encourageme nt steered me through the development of my project. It is through their help too that I’m able to finish the course. Lastly, I express my heart felt gratitude to the lecturers in the Electrical and Electronics Department who parted helpful knowledge to me and thus enabled me to successfully develop my project. To my friends THANK YOU GUYS. Thank you all and may God bless us all and grant us long life. George N Kibia E26-0668/03 Page 3 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 Dedication

To my loving parents and siblings: For your unconditional love, support and encouragement throughout my education. George N Kibia E26-0668/03 Page 4 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 TABLE OF CONTENTS Declaration............................................................................................................... 2 Certification.............................................................................................................. 2 Acknowledgment...................................................................................................... Dedication................................................................................................................ 4 Abstract.............................................................................................................. ...... 7 1. CHAPTER INTRODUCTION.................................................................................. ............... 8 1. 1 Background information................................................................................... ............... 8 1. 2 Problem statement…………………………………………………………………………... 8 1. Goals and objectives…………………………………………………………………………8 1. 4 Justification................................................................ ...................................................... 9 1. 4. 1 Advantages............................................................................................................. 9 2. CHAPTER: LITEATURE REVIEW...................................................................................... 10 2. 1 Types of parking............................................................................................................. 10 2. General information on Road Side parking lots........................................................... ... 10 2. 3 Shortcomings of roadside parking.................................................................................. 13 2. 4 Improvements.......................................................................... ............................ 14 3. CHAPTER 3: METHODOLOGY.................................................................................. .......... 15 3. 1 Microcontroller..................................................................................................... ............. 15 3. . 1 Introduction..................................................................................................... ......... 15 3. 1. 2 Description.......................................................................................... ..................... 16 3. 1. 3 Features..................................................................................................... .............. 16 3. 1. 4 Pin Description......................................................................................................... 18 3. 1. 5 Oscillator Characteristics...................................................... .................................. 20 3. 2 The 8255 Programmable Peripheral Interface................................................................. 20 3. 2. 1 Introduction................................................................................................. .............. 20 3. 2. 2 Uses..................................................................................................... ..................... 20 3. 2. 3 Pin Description.......................................................................................................... 22 3. 2. Operational Description............................................................................................ 24 3. 3 Light Dependent Resistor (LDR).................................................................... .................... 25 3. 3. 1 Introduction.................................................................................................... ........... 25 3. 3. 2 Uses of light dependent Resistors............................................................................ 26 3. 3. 3 Light dependent resistors circuits............................................................................. 26 3. 4 NE555

Timer............................................................ .......................................................... 27 3. 4. 1 Introduction.................................................................................................... ........... 27 3. 4. 2 Monostable mode..................................................................................................... 28 3. 4. 2. 1 Monostable circuit.......................................................................................... 28 3. 4. 2. 2 Doing the Calculations................................................................................... 9 3. 4. 2. 3 Varying the Time Period................................................................................ 29 3. 5 LED Seven Segment Display.................................................................... ......................... 31 3. 5. 1 Introduction.................................................................................... ........................... 31 3. 5. 2 Types of Seven Segment LEDS............................................................................... 32 3. 5. 3 Using Lookup Table ............................................................................................... 3 3. 6 Liquid Crystal Display (LCD).............................................................................................. 36 3. 6. 1 LCD Pin Descriptions................................................................................................. 36 3. 7 Motors.................................................................................................... ............................ 39 3. 7. 1 Introduction......................................................................................... ....................... 39 3. 7. Stepper Motor............................................................................................................ 40 3. 7. 2. 1 Fundamentals of Operation........................................................................... 40 3. 7. 2. 2 Stepper Motor Characteristics.......................................................... .............. 41 3. 7. 3 Unipolar Stepper Motor............................................................................................. 42 George N Kibia E26-0668/03 Page 5 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 3. 74157 Multiplexer........................................................................................................... 44 3. 8. 1 Introduction.................................................................................................... ........ 44 4. CHAPTER FOUR: CIRCUIT DESIGN................................................................................. 46 4. 1 Hardware Description.................................................................. ................................ 46 4. 1. 1 Display Section.................................................................................................... 7 4. 1. 2 Lift Section.................................................................... ....................................... 48 4. 1. 3 Motor Section....................................................................................................... 49 4. 1. 4 Floor Sensor Section........................................................................................... 50 4. 1. 5 LCD Section........................................................................................................ 51 4. 2 Software Development................................................. .............................................. 53 4. 3 Program Flow chart........................................................................ ............................. 54 5. CHAPTER FIVE CONCLUSION AND RECOMMENDATIONS............................. 55 5. 1 Experimental Results...................................................................................... 55 5. 2 System Application....................................................................... ................... 55 5. 3 Problems Encountered.................................................................................... 56 5. Recommendations .......................................................................................... 56 6. CHAPTER SIX BUDGET ESTIMATE..................................................................... 58 7. CHAPTER SEVEN TIME SCHEDULE................................................................... 59 REFERENCES...................................................................................................... 60 APPENDIX A Terms and Abbreviations APPENDIX B List of figures and tables APPENDIX C Project Program code APPENDIX D Pin configuration of parts APPENDIX E Project Circuit Diagram

George N Kibia E26-0668/03 Page 6 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 ABSTRACT The problem of the increasing number of vehicles is receiving considerable attention with the construction of new parking lots in major cities around the world including Nairobi: Kenya. The theoretical and practical modeling of the Microcontroller Based Vehicle Parking System will improve the management of multistoried parking lots. In the Microcontroller Based Vehicle Parking System (MICROBVPS) I have developed an embedded system that manages a multistory parking using digital integrated circuits.

The system incorporates the following major sections: Microcontroller, Di splay section, Sensor section, Motor and lift section which are interconnected in a logical way to perform the control with greater flexibility and reliability. A software program is written in assembly language and a hardware interface developed to implement the controller. I t also involves the use of modern sensor devices to bring about the detection intelligence. The system is controlled by sensors which are activated by LDRs placed in the lift and on each floor.

The sensors send a signal to the microcontroller which uses an internally stored program is to detect what floor the car is at and decrement / increments a counter at the ground floor on exit/entrance. The system uses a stepper motor to move vehicles among the different floors of a multistory building. The system when implemented in a real multistoried parking, it will help in managing the parking lot in an efficiency and less costly way at the same time saving time and fuel cost spent by motorists when looking for a place to park. The system is also economical. George N Kibia

E26-0668/03 Page 7 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 CHAPTER ONE 1. INTRODUCTION 1. 1 BACKGROUND INFORMATION Owning and driving a car should not only be a luxury but also an enjoyable thing. This is not encouraged by the constant hustle and headache s one goes through when trying to get a parking space in a congested town or city. Parking lots should be well managed and provide relevant information to motorist in the shortest time possible. This information could be the number of available parking spaces and the location. 1. 2 PROBLEM STATEMENT

Due to the limited number of parking spaces in Nairobi Central Business District (NCBD) and major cities around the world, it has become necessary to have car parks in office blocks and at times multistory buildings used exclusively for car parks. It? s for this reason that a system that can manage the car park efficiently using lifts instead of the traditional concrete ramp needs to be developed and implemented. 1. 3 GOALS AND OBJECTIVES 1. To have an efficient and well managed vehicle parking system in line with “ KENYAS VISION 2030” of having and maintaining a sustainable economic growth of 10%.

This system would eliminate time wasted while looking for parking and also to create employment. 2. To design a system that can display how many cars are parked in each floor and the ones that are available for cars to be parked. 3. To have sensors in each floor and in the lift to detect presence of a car. 4. To have a Welcome screen at the entrance of the car park entrance. 5. To provide a lift in a storied parking lots to move cars from ground floor to respective floors for parking and vice versa. George N Kibia E26-0668/03 Page 8 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 1. 4 JUSTIFICATION

MICROCONTROLLER BASED VEHICLE PARKING SYSTEM will help to minimize the car parking time in places where many vehicles need to be parked; this system proves to be useful in reducing wastage of space and provide a well coordinated parking system. This MICROCONTROLLER BASED VEHICLE PARKING SYSTEM enables the parking of vehicles, floor after floor and thus reducing the space used. Here any number of car s can be parked according to specific requirement and a system provided to show number of cars parked and tho se remaining. For example you can have different floors with different requirements for access e. . carwash parking, members parking, VIP parking where you are required to enter a password for entry etc. This makes the system modernized and even saves space. 1. 4. Advantages 1. Security The vehicle is safe from damage. Theft is impossible. Since the inside of the Park System can be monitored via CCTV at a centralised location, the vehicle cannot be br oken into, and the vehicle is safe from adverse weather conditions and vandalism as well. 2. Speed Parking time is reduced unlike the case where we have a single one way ramp and the driver drives in different floors looking for an empty parking space.

https://phdessay.com/the-cardiovascular-system-intrinsic-conduction-system/

This w astes a lot of time which can be saved by the driver knowing in advance which floor has an available parking. 3. Fewer Emissions The Park System takes ecological and social aspects into consideration as well, and creates additional parking space for the futu re. Fewer emissions (up to 35% less CO2 and 44% less Benzene) and the total elimination of traffic caused by people looking for a space in a roadside car park have a positive impact on the environment. The smaller footprint of a Park System compared to a roadside car park will save precious real estate which can be used for other purposes. George N Kibia

E26-0668/03 Page 9 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 CHAPTER TWO LITERATURE REVIEW 2. 1TYPES OF PARKING Parking lot (called a car park) is a cleared area that is more or less level and is intended for parking vehicles. Usually, the term refers to a dedicated area that has been provided with a durable or semi-durable surface. See Fig 1. 1 Fig1. 1. Adiagonal parking in Nairobi Fig 1. 2. Multi storey parking using ramp (A MICROBVPS to be installed) In most countries where cars are the dominant mode of transportation, parking lots are a feature of every city and suburban area.

Shopping malls, sports stadiums, mega churches and similar venues often feature lots of immense area. 2. 2 GENERAL INFORMATION ON ROADSIDE PARKING LOTS The usual parking lot is paved with asphalt. Some are paved with concrete. Many are gravel lots. A few of the newer lots are surfaced with permeable paving materials. Parking lots have their own special type of engineering. While parking lots have traditionally been an overlooked element of development projects by governmental oversight, the recent trend has been to provide regulations for the configuration and spacing of parking lots, their andscaping, and drainage and pollution abatement issues. Parking lots can be small, with just parking spaces for a few vehicles, very large with spaces for thousands of vehicles, or any size in between. Small parking lots are usually near buildings for small businesses or a few apartments, although many other locations are possible. Larger parking lots can be for larger businesses or those with many customers, institutions such as schools, churches, offices, or hospitals, museums or other tourist attractions, rest areas, strip malls, or larger apartment buildings.

George N Kibia E26-0668/03 Page 10 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 At places where most visitors and employees use their car to access place, the parking lot usually takes up more land area than the buildings. This is at least true for shopping centres and office buildings, unless a multi-storey park is used. In most cases, especially in areas where parking is scarce, one must pay to park in a parking lot. Entry and exit access is often controlled at these types of lots to ensure those parking pay the required fee.

In many congested areas where some businesses lack their own parking areas, there are parking lots where practically any driver can pay a fee to park. These typ es of parking lots are often effectively businesses in themselves. Some parking lots have parking meters into which coins must be paid to park in the adjacent space. Some spaces in a parking lot may be marked as "reserved" for certain people, including those who are handicapped. There are often one or more parking spaces for handicapped people, which may be slightly wider, close to the point of entry for the corresponding store or building.

Vehicles with handicapped tags may park there, but the non -handicapped are not allowed to. Although many parking lots are rectangular-shaped, there are parking lots of all sorts of shapes. A parking lot can be in front or back, on the side of the building it services, or any combination of these, including all around the building, often depending on local building codes. In a very large parking field, it is easy to get lost or have trouble finding one's vehicle. Such large parking lots often have various sections marked, for example by numbers or letters, to help identify the location.

The area in parking lots is organized into parking spaces, which are generally marked with paint lines for each vehicle and often contain a turtarrier, and driving lanes in between so that vehicles can drive into and out of the spaces. The arrangement of the parking spaces relative to the driving lanes can feature perpendicular parking spaces, angle parking (most common in North America, especially in large lots), or parallel parking (least common in parking lots, and usually only for a few spaces), or possibly some combination of these. Large parking lots have multiple lanes with rows of parking spaces between each one.

Except for rather small lots, the location of the parking spaces for each vehicle are usually indicated with pavement markings or lines, similar to center lines on streets . A very common arrangement in large parking lots is angle parking for two rows of vehicles between driving lanes, with the parked vehicles facing front to front between the two rows. At the sides of the parking lot, other driving lanes connect these lanes perpendicularly so that a vehicle can drive into and out of the parking lot at designated locations. George N Kibia E26-0668/03 Page 11 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 009 Fig 1. 3: Parking lot layout with angle parking as seen from above. W hite arrows show direction of allowed travel in each lane (for right -hand-drive countries; vice versa in left-hand-drive countries). Several parking spaces closest to the building entrance are reserved for the handicapped. Cars of various colors are shown parked in some of the spaces. The obtusely pointed end indicates the front end of each car. There may be speed limits, stop signs and crosswalks for pedestrians in large parking lots. Tall overhead lights may illuminate some parking lots at night.

Most spaces in normal parking lots available to the public are sized for vehicles about the size of a car. The spaces are usually arranged assuming the vehicle can back out of the parking sp ace. In many rest areas on highways, long parking spaces are also available for trucks or other vehicles with trailers, into which they can enter at one end and leave at the opposite end to avoid potentially cumbersome reverse driving. A common arrangement in paid parking lots is to have a vehicle entry point with a cross gate where an entering driver presses a button to take a stub with the entry time and to open the cross gate for access to the lot.

When leaving, the driver would pay at an exit point according to how much time was spent in the lot as determined from the stub. In order to keep unauthorized people from parking in lots, towing crews sometimes patrol parking lots after business closing hours, especially at night, to tow away vehicles which should not be parked there. George N Kibia E26-0668/03 Page 12 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 2. 3 SHORTCOMINGS OF ROAD SIDE PARKING 1. Runoff handling Parking lots have certain characteristics that set them apart from roadways in terms of their engineering and operating requirements.

The first is that they often cover large contiguous areas with impermeable paving surface. This means that virtually all of the rain (minus evaporation) that falls becomes runoff. The parking lot must be built to effectively channel and collect runoff. Traditionally, the runoff has been shunted directly into storm sewers, streams, or even sanitary sewers. However, larger municipalities now require retention basins to catch runoff to reduce the stress on sewer syst ems or stream ways. 2. Water pollution Parking lots also tend to be subject to contamination with concentrated spots of pollutants such as motor oil.

While motor vehicles on roadways may drip oil, they do so over a large area. Oil drips on parking lots are concentrated enough that they can have a deleterious effect on the water quality of the runoff. Other pollutants, even brake-lining dust, rust particles, and other particulate materials that settle on the parking lot surface, can be a similar p roblem. Therefore, an important second function of the retention basin for parking lots is to act as a temporary storage impoundment to allow particulate materials to settle out and to slow or even prevent the release of other pollutants into waterways. 3.

Alternative paving An alternative solution today is to use permeable paving surfaces, such as brick, stone, special paving blocks, or tire-tread woven mats. The intent of these is to allow rain to soak into the ground through the spaces inherent in the parking lot surface. The ground then may become contaminated in the surface of the parking lot, but this tends to stay in a small area of ground, which effecti vely filters water before it seeps away. This can however create problems if contaminants seep into groundwater, especially where there is groundwater abstraction 'downstream' for potable water supply. . Landscaping Many areas today also require minimum landscaping in parking lots. This usually principally means the planting of trees to provide shade. Customers have long preferred shaded parking spaces in the summer, but parking lot providers have long been antagonistic to planti ng trees because of the extra cost of cleaning the parking lot. George N Kibia E26-0668/03 Page 13 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 However, parking lots represent significant heat islands and, indeed, heat sinks in urban areas.

The heat from paved areas in urban zones has been shown to even have the power to change the weather locally. By providing trees or other means of shading parking lots, the heat and glare resulting from them can be significantly reduced. 2. 4 IMPROVEMENTS 1. INCREASED PARKING SPACE Automatic multi-storey car parks provide lower building cost per parking slot, as they typically require less building volume and less ground area than a conventional facility with the same capacity. This would ease congestion and increase parking space by having a certain vehicle parking capacity increased by a multiple of the number of floors. . REDUCED PARKING TIME Having an efficient park lot monitoring system would reduce the time a driver takes looking for an empty parking. In this system the stats of the parking lot is displayed at the entrance, thus enabling him to find another parking lot. 3. REDUCED POLLUTION These systems reduce fuel wasted while searching for empty spaces and helps in the reduction of carbon emissions. The city council can build a special drainage for the parking lot to remove spilt oil in the parking 4. REDUCED CONGESTION Reduction in congestion in the city due to fewer cars driving around searching for spa ces

George N Kibia E26-0668/03 Page 14 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 CHAPTER THREE 3. 0 METHODOLOGY 3. 1 MICROCONTROLLER: 3. 1. 1 INTRODUCTION In this project AT89C51-24 microcontroller was used which is an 8051 derivative. The first task faced when learning to use a new microcontroller was to become familiar with the capability of the machine. The features of the microcontroller was best learned by studying the internal hardware design, also called the architecture of the device, to determine the type, number, and size of the registers and other circuitry.

The hardware is manipulated by an accompanying set of program instructions, or software. Once familiar with hardware and software, the microcontroller was applied to the problem at hand. I. e. to develop the microcontroller based vehicle parking sys tem The 8051 microcontroller generic part number actually includes a whole family of microcontrollers that have numbers ranging from 8031 to 8751. The block diagram of the 8051 shows all of the features unique to microcontrollers: ? ? ? ? Internal ROM and RAM I/O ports with programmable pins Timers and counters

Serial Data communication The block diagram below shows the usual CPU components program counter, ALU, working registers, and the clock circuits. The 8051 architecture consists of these specific feat ures: ? ? ? ? ? ? ? ? ? ? ? 8 bit CPU with registers A and B 16 bit PC ; data pointer (DPTR) 8 bit program status word (PSW 8 bit stack pointer (SP) Internal ROM or EPROM (8751)of 0(8031)to 4k(8051) Internal RAM of 128 bytes. 4 register banks , each containing 8 registers 80 bits of general purpose data memory 32 input/output pins arranged as four 8 bit ports:P0 -P3 wo 16 bit timer/counters:T0-T1 Two external and three internal interrupt sources George N Kibia E26-0668/03 Page 15 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) ? 2009 Oscillator and clock circuits 3. 1. 2 DESCRIPTION The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel? s high-density nonvolatile memory technology and is compatible with the industry -standard MCS-51 instruction set and pin out.

The on-chip Flash allows the program memory to be reprogrammed in -system or by a conventional nonvolatile memory programmer. By combining a versatile 8 -bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcompute r which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two -level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry.

In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Power-down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset. 3. 1. 3 FEATURES Compatible with MCS51 product 4K Bytes of In-System Reprogrammable Flash Memory Endurance: 1,000 Write/Erase Cycles Fully Static Operation: 0 Hz to 24 MHz

Three-level Program Memory Lock 128 x 8-bit Internal RAM 32 Programmable I/O Lines Two 16-bit Timer/Counters Six Interrupt Sources Programmable Serial Channel/full duplex Low-power Idle and Power-down Modes George N Kibia E26-0668/03 Page 16 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 Fig 3. 1: Block diagram showing the usual CPU components program counter, ALU, working registers, and the clock circuits. George N Kibia E26-0668/03 Page 17 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 A pin out of the AT89C51-24 packaged in a 40 pin DIPS * Appendix 3. 1 . 1. 4 PIN DESCRIPTION VCC Supply voltage GND Ground PORT 0 Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high -impedance inputs. Port 0 may also be configured to be the multiplexed low -order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull -ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pullups are required during program erification. PORT 1 Port 1 is an 8-bit bi-directional I/O port with internal pullups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current because of the internal pullups. Port 1 also receives the low -order address bytes during Flash programming and verification. PORT 2 Port 2 is an 8-bit bi-directional I/O port with internal pullups. The Port 2 output buffers can sink/source four TTL inputs.

When 1s ar e written to Port 2 pins they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current because of the internal pullups. Port 2 emits the high -order address byte during fetches from external program memory and during accesses to external data memory that use s 16-bit addresses (MOVX @ DPTR). In this application, it uses strong internal pull -ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register.

Port 2 also receives the high -order address bits and some control signals during Flash programming and verification PORT 3 Port 3 is an 8-bit bi-directional I/O port with internal pullups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current because of the pullups. Port 3 also serves the functions of various special features of the AT89C51 as listed below: George N Kibia E26-0668/03

Page 18 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 PORT 3 PIN ALTERNATE FUNCTIONS P3. 0 RXD (serial input port) P3. 1 TXD (serial output port) P3. 2 INT0 (external interrupt 0) P3. 3 INT1 (external interrupt 1) P3. 4 T0 (timer 0 external input) P3. 5 T1 (timer 1 external input) P3. 6 W R (external data memory write strobe) P3. 7 RD (external data memory read strobe) Port 3 also receives some control signals for Flash programmin g and verification. RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.

ALE/PROG Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 of the oscillator frequency, and may be used for external timing or clocking purposes. Note however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction.

Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN Program Store Enable is the read strobe to external program memory. W hen the AT89C51 is executing code from external program memory, PSEN is activated twice eac h machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations startin g at 0000H up to FFFFH.

Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12 -volt programming enable voltage (VP P) during Flas h programming, for parts that require 1 2-volt VP_P. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 George N Kibia E26-0668/03 Page 19 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 Output from the inverting oscillator amplifier 3. 1. 5 OSCILLATOR CHARACTERISTICS

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on -chip oscillator. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be lef t unconnected while XTAL1 is driven. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide -by-two flip-flop, but minimum and maximum voltage high and low time specif ications must be observed. 3. THE 8255 PROGRAMMABLE PERIPHERAL INTERFACE 3. 2. 1 INTRODUCTION The Intel 8255 (or i8255) Programmable Peripheral Interface chip is a peripheral chip originally developed for the Intel 8085 microprocessor, and as such is a member of a large array of such chips, known as the MCS-85 Family. This chip was later also used with the Intel 8086 and its descendants. It was later made (cloned) by many other manufacturers. It is made in DIP 40 and PLCC 44 pins encapsulated versions. 3. 2. 2 USES This chip is used to give the CPU access to programmable parallel I/O.

The 8255 is used in home computers such as SV-328 and all MSX . The 8255 chip is used together with a micro controller to expand its I/O capabilities. The 82C55A is a very powerful tool for interfacing peripheral equipment to the microcomputer system. It represents the optimum use of available pins and flexible enough to inter face almost any I/O device without the need for additional external logic. Each peripheral device in a microcomputer system usually has a “service routine” associated with it. The routine manages the software interface be tween the device and the CPU.

The functional definition of the 82C55A is programmed by the I/O service routine and becomes an extension of the system software. By examining the I/O devices interface characteristics for both data transfer and timing, and matching this information to the examples and tables in the detailed operational description, a control word can easily be developed to initialize the 82C55A to exactly “fit” the application. George N Kibia E26-0668/03 Page 20 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 Fig 3. 2 8255 FUNCTIONAL BLOCK DIAGRAM This block diagram shows the internal architecture of the 8255ppi 5V GROUP A CONTROL GROUP A PORT A (8) PA7-0 POWER SUPPLIES GND GROUP A PORT C (4) BIDIRECTIONAL DATA BUS (D7-D0) DATA BUS BUFFER PC7-4 8 BIT INTERNAL DATABUS PC3- 0 GROUP B PORT C (4) RD WR A1 A0 READ WRITE CONTR OL LOGIC GROUP B CONTROL GROUPB7- 0 P AB PORT AB (8) RESET George N Kibia E26-0668/03 Page 21 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 3. 2. 3 8255 PIN DESCRIPTION Data Bus Buffer This 3 –state bi directional 8 bit is used to interface the 82C55A to the system data bus. Data is transmitted or received by the buffer upon execution of input or output instructions by the CPU.

Control words and status information are also transferred through the data bus buffer. Read/Write and control logic The function of this block is to manage all of the int ernal and external transfers of both Data and Control or Status words. It accepts inputs from the CPU Address and Control busses and in turn, issues commands to both of the Control Groups. Chip select (CS) A “low” on this input pin enables the communication between the 82 55A and the CPU. Read (RD). A “low” on this input pin enables 8255A to send data or status information to the CPU on the data bus. In essence, it allows the CPU to “read from” the 8255A.

Write (WR). A “low” on this input pin enables the CPU to wr ite data or control words into the 82C55A. Port Select 0 and Port Select 1. (A0 and A1) These input signals, in conjunction with the RD and WR inputs, control the selection of one of the three ports or the control word register. They are normally connected to the least significant bits of the address bus (A0 and A1). A1 A0 RD W R CS INPUT OPERATION 0 0 0 1 0 Port A-Data BUS 0 1 0 1 0 Port A-Data BUS George N Kibia E26-0668/03 Page 22 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 1 0 0 1 0 Port A-Data BUS 1 1 0 1 0

Control Word-Data bus A1 A0 RD W R CS OUTPUT OPERATION 0 0 1 0 0 Port A-Data BUS 0 1 1 0 0 Port A-Data BUS 1 0 1 0 0 Port A-Data BUS 1 1 1 O 0 Control Word-Data bus A1 A0 RD W R CS Disable Function x X X x 1 Chip is Disabled x X 1 1 0 2009 Chip is Disabled TABLE 3. 1: Control Signals of the 8255ppi (RESET) Reset. A “high” on this input initializes the control register to 9Bh and all ports (A, B, C) are set to the input mode. “Bus hold” devices internal to the 82C55A will hold the I/O port inputs to a logic “1” state with a maximum hold current of 400µA. Group A and G roup B Controls

The functional configuration of each port is programmed by the systems software. In essence, the CPU “outputs” a control word to the 82C55A. The control word contains information such as “mode”, “bit set”, “bit reset”, etc. , that initializ es the functional configuration of the 82C55A. Each of the Control blocks (Group A and Group B) accepts “commands” from the Read/Write Control logic, receives “control words” from the internal data bus and issues the proper commands to its associated ports. Control Group A - Port A and Port C upper (C7 - C4) Control Group B - Port B and Port C lower (C3 - C0)

The control word register can be both written and read as shown in the “Basic Operation” table. When the control word is read, bit D7 will always be a logic “1”, as this implies control word mode information. George N Kibia E26-0668/03 Page 23 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 Port A, B, and C The 82C55A contains three 8 -bit ports (A, B, and C). All can be configured to a wide variety of functional characteristics by the system software but each has its own special fea tures or “personality” to further enhance the power and flexibility of the 82C55A.

Port B One 8-bit data input/output latch/buffer and one 8 -bit data input buffer. Port C One 8-bit data output latch/buffer and one 8 -bit data input buffer (no latch for inp ut). This port can be divided into two 4 -bit ports under the mode control. Each 4 -bit port contains a 4-bit latch and it can be used for the control signal output and status signal inputs in conjunction with ports A and B . 3. 2. 4 OPERATIONAL DESCRIPTION Mode Selection There are three basic modes of operation than can be selected by the system software: Mode 0 - Basic Input/ Output Mode 1 - Strobed Input/ Output Mode 2 - Bi-directional Bus

W hen the reset input goes “high”, all ports will be set to the input mode with all 24 port lines held at a logic “one” level by internal bus hold devices. After the reset is removed, the 82C55A can remain in the input mode with no additional initialization required. This eliminates the need to pullup or pulldown resistors in all-CMOS designs. The control word register will contain 9Bh. During the execution of the system program, any of the other modes may be selected using a single output instruction. This allows a single 82C55A to service a variety of peripheral devices wit h a simple software maintenance routine.

Any port programmed as an output port is initialized to all zeros when the control word is written. The modes for Por t A and Port B can be separately defined, while Port C is divided into two portions as required by the Port A and Port B definitions. All of the output r egisters, including the status ip/ ops, will be reset whenever the mode is changed. Modes may be combined so that their functional definition can be “tailored” to almost any I/O structure. Operating Modes Mode 0 (Basic Input/ Output). This functional configuration provides simple input and output opera tions for each of the three ports.

No handshaking is required; data is simply written to or read from a specific port. Mode 0 Basic Functional Definit ions: • Two 8-bit ports and two 4-bit ports George N Kibia E26-0668/03 Page 24 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) • Any Port can be input or output • 2009 Outputs are latched Input are not latched • 16 different Input/ Output configurations possible Mode 1 (Strobed Input/ Output). This functional configuration provides a means for tran sferring I/O data to or from a specified port in conjunction with strobes or “hand shaking” signals.

In mode 1, port A and port B use the lines on port C to generate or accept these “hand shaking” signals. Mode 1 Basic Function Definitions: • Two Groups (Group A and Group B) • Each group contains one 8 -bit port and one 4-bit control/data port • The 8-bit data port can be either input or output. Both inputs and outputs are latched. • The 4-bit port is used for control and status of the 8 -bit port. Mode 2 (Strobed Bi-Directional Bus I/O) The functional configuration provides a means for communicating with a peripheral device or structure on a single 8-bit bus for both transmitting and receiving data (bi -directional bus I/O). Hand shaking” signals are provid ed to maintain proper bus discipline similar to Mode 1. Interrupt generation and enable/disable functions are also available. Mode 2 Basic Functional Definitions: • Used in Group A only • One 8-bit, bi-directional bus Port (Port A) and a 5 -bit 3. 3 LIGHT DEPENDENT RESISTOR (LDR) 3. 3. 1 INTRODUCTION A photo resistor is an electronic component whose resistance decreases with increasing incident light intensity. It can also be referred to as a light-dependent resistor (LDR), or photoconductor. A photoresistor is made of a high -resistance semiconductor.

If light falling on the device is of high enough frequency, photons absorbed by the semiconductor give bound electrons enough energy to George N Kibia E26-0668/03 Page 25 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 jump into the conduction band. The resulting free electron (and its hole partner) conduct electricity, thereby lowering resistance. A photoelectric device can be either intrinsic or extrinsic. In intrinsic devices, the only available electrons are in the valence band, and hence the photon must have enough energy to excite the electron across the entire band gap.

Extrinsic devices have impurities added, which have a ground state energy closer to the conduction band since the electrons don't have as far to jump, lower energy photons (i. e. longer wavelengths and lower frequencies) are sufficient to trigger the device. 3. 3. 2 USES FOR LIGHT DEPENDENT RESISTORS Light dependent resistors are a vital component in any electric circuit which is to be turned on and off automatically according to the level of ambient light - for example, solar powered garden lights, and night security lighting.

An LDR can even be used in a simple remo te control circuit using the backlight of a mobile phone to turn on a device - call the mobile from anywhere in the world, it lights up the LDR, and lighting (or a garden sprinkler) can be turned on remotely! 3. 3. 3 LIGHT DEPENDENT RESISTOR CIRCUITS There are two basic circuits using light dependent resistors 1. Darkness activated 2. Light activated The two circuits are very similar and just require an LDR, some standard resistors, a variable resistor (aka potentiometer), and any small signal transistor 1. Darkness activated Fig 3. 3: Darkness activated LDR George N Kibia E26-0668/03

Page 26 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 In the circuit diagram above, the LED lights up whenever the LDR is in darkness. The 10K variable resistor is used to fine-tune the level of darkness required before the LED lights up. The 10K standard resistor can be changed as required to achieve the desired effect, although any replacement must be at least 1K to protect the transistor from being damaged by excessive current. 2. Light activated Fig 3. 4: Light activated LDR By swapping the LDR over with the 10K and 10K variable resistors (as shown above), the circuit will be activated instead by light.

Whenever sufficient light falls on the LDR (manually fine -tuned using the 10K variable resistor), the LED will light up. Calculating Vout : V out = Rbottom x V in Rbottom +Rtop 3. 4 NE555 TIMER 3. 4. 1 INTRODUCTION The 555 is an integrated circuit (chips) implementing a variety of timers and multivibrators applications. The 555 timer is one of the most popular and versatile integrated circuits ever produced. Depending on the manufacturer, it includes over 20 transistors, 2 diodes and 15 resistors on a silicon chips installed in an 8-pin mini dual-in-line package (DIP -8). The 555 has three operating modes: •

Monostable mode: in this mode, the 555 functions as a “one shot”. Applications include t imer, missing pulse detection, bounce free switches, touch switches, Frequency Divider, Capacitance Measurement, PWM, etc George N Kibia E26-0668/03 Page 27 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 Astable Free Running mode: the 555 can operate as an oscillator. Uses include LED and lamp flashers, pulse generation, logic clocks, tone generation, security alarms, pulse position modulation, etc Bistable mode or Schmitt trigger: the 555 can operate as a flipflop, if the DIS pin is not connected and no capacitor is used.

Uses include bounce free latched switches, etc 3. 4. 2 MONOSTABLE MODE The waveforms in figure 3. 5 illustrate the operation of a monostable. A monostable circuit produces one pulse of a set length (time period T) in response to a trigger input such as a push button. The output of the circuit stays in the low state until there is a trigger input, hence the name "monostable" meaning "one stable state". FIG: 3. 5 The monostable input and output wave form 3. 4. 2. 1 The 555 Monostable Circuit The circuit diagram of the 555 monostable circuit is given in figure 3 . 6.

Notice that the resistor value R and the capacitor value C are unspecified. The values of these components determine the length of time that the monostable output is in the high state, and they may be calculated using the equation below. … W here T is the time period in seconds, and R and C are the component values in Ohms (? ) and Farads (F). George N Kibia E26-0668/03 Page 28 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 FIG 3. 6 The 555 monostable circuit 3. 4. 2. 2 Doing the Calculations Here is a step-by-step guide to calculating the value of resistor R - an example is given in curly braces {}. . Firstly, decide the time period T that you require. This can be very small (milliseconds) or large (minutes), but it must be expressed in seconds. {I choose T = 10 seconds} 2. Next, guess a value for the capacitor C, expressed in Farads. For starters, try 100? F. {I choose C = 100? F} 3. Put the values of T and C into the equation below and calculator resistor R... If the resistor value you calculated is smaller than 1k? or larger than 1M? , you should re -do the calculation with a different value for capacitor C until you get a resistor value within the acceptable range. . 4. 2. 3 Varying the Time Period If you will need to adjust the time period of the monostable circuit in use, you can use a linear variable resistor for R, as shown in figure 3. 7 Because the resistance of a variable resistor goes down to around 0? at one end of its range, a 1k? resistor is placed in series with it so that the value of R will never fall below 1k?. As the shaft of the variable resistor is turned from its lowest setting to its highest, T will become longer. George N Kibia E26-0668/03 Page 29 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 009 If your chosen variable resistor has three connections, it is a potentio meter, and you should connect to the centre connection and either of the end connections. FIG 3. 7 Varying the time period with a variable resistor The Trigger Input As you can see from figure 3. 5, the 555's Trigger input must be taken low to trigger the monostable. This is achieved in figure 3. 6 by placing a button in series with a resistor across the power supply. Normally, the 10k? resistor keeps the Trigger input high, at the voltage Vs, and the monostable is in its steady state.

W hen the button is pushed, the Trigger input is directly connected to 0V and the time period T starts. The Reset Input If you want to make the monostable output go low before the time period has elapsed, simply take the 555's Reset input briefly low. This can be achieved with a push button in exactly the same way as with the Trigger input. George N Kibia E26-0668/03 Page 30 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 TABLE 3. 2: 555 TIMER PIN DESCRIPTION TABLE Nr. Name Purpose 1 GND Ground, low level (0V) 2 TR A short pulse high > low on the trigger starts the timer Q During a timing interval, the output stays at +VCC 4 R A timing interval can be interrupted by applying a reset pulse to low (0V) 5 CV Control voltage allows access to the internal voltage divider (2/3 V CC) 6 THR The threshold at which the interval ends (it ends if U. thr > 2/3 V CC) 7 DIS Connected to a capacitor whose discharge time will influence the timing interval 8 V+, VCC The positive supply voltage which must be between 3 and 15 V 3. 5 LED SEVEN SEGMENT DISPLAY 3. 5. 1 INTRODUCTION The Light Emitting Diode (LED) finds its place in many applications of modern electronics.

One of them is the Seven Segment Display. Seven-segment displays contains the arrangement of the LEDs in “Eight” (8) passion, and a Dot (. ) with a common electrode, lead (Anode or Cathode). The purpose of arranging it in that passion is that we can make any number out of that by switching ON and OFF the particular LED's. George N Kibia E26-0668/03 Page 31 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 Here is the block diagram of the Seven Segment LED arrangement. FIG 3. 8 Pin configuration of a seven segment display: 3. 5. 2 TYPES OF SEVEN SEGMENT LEDS LED? s are basically of two types ?

Common Cathode (CC) All the 8 anode legs uses only one cathode, which is common. ? Common Anode (CA) The common leg for all the cathode is of Anode type. For discussion purpose, we use CC LED, where by just reversing the logical voltages we can implement the same for CA LED also. In a CC LED, all the 8 legs ('a' through 'h') are of anode type and the common cathode will be connected to the GND of the supply. By energizing any of the legs with +5 Volts will lead to switch the correspondent segment ON. In the microprocessor binary syste m, 0Volts will be considered as Binary 0, and 5Volts will be considered as Binary1.

Considering these two condition, we can make an arrangement as the microcontroller gives OUT the 0s and 1s through its ports, which is connected to George N Kibia E26-0668/03 Page 32 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 the 8 legs of the LED. Of course, we can control the Port Output; implicitly we can Switch -ON required legs of the display. Here we discuss 2 methods of interfacing LED with the Microcontroller Intel 8051/8951. 1. Using lookup table. This uses 7 output pins of microcontroller 2. Using 7447 decoder.

This method uses 4 output pins of microcontroller The difference between the two main methods is simple and clear. In both the cases, microcontroller communicates with external world through its ports. But, in the 1st case, we connect all the 8 pins of the port directly to the LED and control the voltage through the ports manual ly to display the desired number. But, in the second case, we send the BCD of the number that we wanted to display to a middleware IC 7447, the BCD to LED code converter, which by itself gives out the correspondent 7 segment codes to the LED. 3. 5. 3 USING LOOKUP TABLE:

This method uses the port of the microcontroller to display the desired number. The common cathode pin is connected to GND by external wire, if it is the CC LED and in the case of the common Anode LED, the Anode pin is connected to +Vcc. Here , other pins of the LED are connected to Port 2 of 8951 via 8255 ppi. A table will be prepared which relates the BCD code to the LED display code (pattern). This table is known as a Lookup table. The table below explains how a Lookup table is constructed. Circuit diagram is given below. George N Kibia E26-0668/03 Page 33 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009

FIG 3. 9 Circuit diagram for Common Anode 7 -Segment Display FIG 3. 10: Circuit diagram for Common CATHODE 7 -Segment Display interfaced to 8951 George N Kibia E26-0668/03 Page 34 MICROCONTROLLER BASED VEHICLE PARKING SYSTEM (MICROBVPS) 2009 Calculation of lookup table as follows: The lookup table contains the input pattern for the LED legs, to display the corresponding digits. The table shows the seven segment requirement pattern to display the Hex number, with the seven segment conversion. For example, Let us consider the display of the number 0, where we need to switch ON al l the LEDs which are there at the boundary. I. . for a CC LED, we should supply 5 volts to these LEDs. The 6 LEDs ('a' through 'f') should get binary 1, the dot and the (middle) hyphen segment should get 0Volts or the binary Zero. Effectively the Seven seg ment pattern code will be (0011 1111) 3Fh. That is what we OUT through the port pins. For a Common Anode LED, the display pattern will be the complement of that of Common Cathode pattern. Table 3

Remember. This is just a sample.
You can get your custom paper from our expert writers

get custom paper

Cite this page

Microcontroller Based Car Parking. (2017, May 29). Retrieved from https://phdessay.com/microcontroller-based-car-parking/

Not Finding What You Need?

Search for essay samples now

We use cookies to give you the best experience possible. By continuing we’ll assume you’re on board with our cookie policy

Your Deadline is Too Short?  Let Professional Writer Help You

Get Help From Writers