Smart Parking - Senior Design Project Lab | ECE 445, Study Guides, Projects, Research of Electrical and Electronics Engineering

Material Type: Project; Class: Senior Design Project Lab; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Spring 2003;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 02/24/2010

koofers-user-uye
koofers-user-uye 🇺🇸

9 documents

1 / 25

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SMART PARKING
By
Emily Wu
Srikala Parvathaneni
ECE 345, SENIOR DESIGN PROJECT
SPRING 2003
TA: Purvesh Thakker
May 1, 2003
Project No. 18
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Smart Parking - Senior Design Project Lab | ECE 445 and more Study Guides, Projects, Research Electrical and Electronics Engineering in PDF only on Docsity!

SMART PARKING

By

Emily Wu

Srikala Parvathaneni

ECE 345, SENIOR DESIGN PROJECT
SPRING 2003

TA: Purvesh Thakker May 1, 2003 Project No. 18

ABSTRACT

The Smart Parking System offers a simple and comprehensive solution to the problem of finding a convenient parking spot in large, multi-level parking garages. In an age where the adage ‘time is money’ seems more applicable than ever before, this user-friendly and adaptable system will eliminate the time drivers are forced to waste as they circle various parking garage floors looking for the optimal spot. The system itself consists of a user-interface at the entrance of the parking garage, which allows the driver to view all available parking spaces. Although the system will recommend the spot it deems most favorable, the driver is free to view each floor and select any available spot. Once a spot has been selected, a series of red and green LEDs built into the road will guide the driver to their chosen destination. In addition, a ticket with directions will be printed that can be used upon return to the parking garage to guide the driver to their vehicle. ii

1. INTRODUCTION

1.1 Motivation

Having experienced the frustration of needlessly circling large, multi-level parking garages, searching for an open spot and the additional irritation involved in locating that same spot upon return to the garage, we felt a solution was needed. After all, with urban populations on the rise across the country, cities have found the need to expand either outwards or upwards. And as seen by such buildings as the Sears Tower and the Empire State Building, it seems the preferred choice is upwards rather than outwards. This trend seems to have spread to parking garages as well. In fact, the latest parking garages consist of as many as 20 floors of circular, winding roadways designed to confuse and intimidate the average driver. We believed we could use our engineering knowledge and modern technology to design a simple and feasible solution for this growing problem.

1.2 Project Goals

The goal of our project was to design and implement a functional Smart Parking System on a prototype parking garage. The ultimate goal is that the ideas and planning demonstrated through this model system can then be easily upgraded to an actual parking facility.

1.3 Project Overview

1.3.1 Performance Specifications As the system is to be implemented in large and busy parking garages, there are a number of performance specifications that have to be met to ensure the system operates correctly and efficiently. Most importantly, the visual basic interface must send and receive the appropriate information from the microcontroller. The microcontroller, in turn, must be able to multi-task and have numerous threads running at the same time in order to track multiple cars throughout the garage. The sensors in the road and parking spots must be accurate enough to locate each car in the garage. Also, the green and red LEDs in the road must be triggered properly and be visible as the car approaches each section of the garage. In order to reliably park each car, these key performance specifications must be met. 1.3.2 Device Subprojects Our device consists of three subprojects. Sensor and LED Hardware The sensors are each connected to the input of a multiplexer (MUX) through a Common-Emitter Amplifier circuit configuration. The MUX’s select, strobe, and output pins are hard-wired to the microcontroller. The LED’s circuitry involves two demultiplexers (DMUX) to select one of twenty-two different sets of guiding LED’s. The output of the DMUX is then latched, amplified and fed to the LED. The DMUX’s inputs come from the microcontroller. 1

Microcontroller The microcontroller used is a BasicX-24. Our program consists of four separate tasks, one for each of the three floors in our model parking garage and one for the entrance to the garage. Each floor task can handle the LEDs and sensors on its floor and can also pass the car onto the next floor if necessary. The entrance task handles all information sent to and from the Visual Basic Interface.

2.2.2 Visual Basic Interface

The Visual Basic program receives information from the microcontroller when a car is at the entrance of the garage. Once the program has been sent all necessary information, the screen will update. The chosen spot is then sent back to the microcontroller and return directions are sent to the printer. Our Visual Basic program is organized by screen. Each screen has a series of functions that are called in order to allow the user to navigate chronologically throughout the interface.

1.3.3 Project Block Diagram

The block diagram, shown in Figure 1, displays the basic organization and flow of data between the various components of our project. A more detailed explanation of each block will be presented in the following chapters. Microcontroller (Basic Stamp) Microcontroller (Basic Stamp) Entrance-Interface (Visual Basic) Sensors LEDs Printer (Return Ticket) Figure 1: Basic Block Diagram 2

high precision, and even symmetry. However, after testing the sensor numerous times, we obtained inconsistent results that were not accurate enough to give us an idea of the car’s direction. The output was dependant upon the angle, direction, and distance the magnets were approaching at; different results were obtained when the sensors were approached at different distances. This seemed highly impractical in a parking garage where every car does not follow the road in the exact same manner. Adding to the impracticality of this sensor, each car in our model parking garage would have to be mounted with anywhere from one to three bulky magnets. Therefore this idea was discarded. Figure 2: Bipolar Slide-By Model [2] The second idea we entertained was the use of a Reflective Object Assembly. We hoped to use the OPB706C sensor used in ECE 110 laboratory. However, there were numerous problems with this idea as well. First, even the most robust of these sensors operate consistently only when within 1/8 in of the surface. Also, we would need to attach a white surface to the bottom of each car used in our model parking garage. Lastly, we would need to develop additional circuitry for each sensor. Due to the fact that we have fifteen sensors, we wanted to keep our circuitry as simple as possible. Ultimately, the sensor we decided on was the Infrared Light Sensor. We used Fairchild Semiconductor’s QSE113 Infrared Phototransistor. The phototransistor has a number of useful features including a daylight filter to filter out ambient light, a medium wide reception angle of 50˚ and relatively high sensitivity. The sensor is used in conjunction with the QED123 Infrared Light Emitting Diode, which can be positioned more than 6 in away from the sensor, exceeding the height of our parking garage ceilings. These sensors were ideal to use in our small scale model as they were inexpensive and readily available. However, since the sensor detects light through small, narrows holes drilled into the floor of the parking garage, its reception angle was significantly decreased and could only detect IR light within a very limited area. Therefore, our margin of error when positioning the IR LED’s had to be very small. In order to amplify the current generated to a useful level, we connected the sensor in a Common-Emitter configuration, also known as a pull-up circuit. This is shown in Figure 3. In this configuration, when the phototransistor detects light in the infrared range, the output transitions from a high state to a low state, and vice versa. 4

Figure 3: Common-Emitter Amplifier (Pull-Up) [3]

2.2 Software Components............................................................................

2.2.1 Microcontroller...........................................................................

The two microcontrollers we considered at the start of our project were the Basic Stamp 2 and the BasicX-24. Both these microcontrollers are programmed through PBasic language, which is considerably less complex than the assembly language code used to program the other option available to us, the Motorola HC-12. Ultimately, in order to meet our performance and design specifications, we chose the BasicX-24 for its speed, floating point accuracy, and multi-tasking capabilities. Multi-tasking is crucial to the implementation of our Smart Parking System. Without this ability, only one driver would be able to park in the garage at a time. This would be highly impractical in a real world application. We chose to organize our code in four different tasks that would run simultaneously. Figure 4 is a basic block diagram of the way in which we organized each task. A. Wait for Car / Entrance Interface Wait until B ready Call E Call B B. Handle 1st Floor (LEDs / Sensors) Wait until C ready Do Nothing Call C C. Handle 2nd Floor (LEDs / Sensors) Wait until D ready Do Nothing Call D D. Handle 3rd Floor (LEDs / Sensors) Done E. Exit Interface Done Figure 4: Microcontroller Tasks Block Diagram 5

3. DESIGN DETAILS

3.1 Hardware Components

3.1.1 Guidance System (Red and Green LEDs) The LED circuitry consists of two OR gates, an SR Latch and a transistor for each LED as can be seen in Figure 5. Q Q SET CLR S R DMUX 4: SN74154N 15 S S S S G G Turn LED Off (micro) 0 Turn LED On (micro) VCC LED Transistor 10K 15 SN74F 74LS 2N Figure 5: LED System Configuration The LED system is made up of 22 different sets of LEDs, therefore we used two 4:16 DMUX to select between the sets. Each output from the DMUX was latched through a series of OR gates and an SR Latch. Figure 6 shows the truth tables used to develop the latching configuration used above. I = Turn LED On (from microcontroller) X = DMUX output I X S’ 0 0 1 0 1 1 1 0 0 1 1 1

I X Q

0 1 Qo 1 0 1 1 1 Qo 7

Desired Output S’ = I’ + X R’ = I + X Figure 6: Latching The 15Ω resistor before the LED was calculated using equations (2) and (3) from the previous chapter.

I X S’

8

The Microcontroller output pins are protected by the 2N2222 NPN transistor. The microcontroller can only drive a maximum of 6mA of current; the transistor increases the current to a level that allows all of our TTL logic to function properly. The NPN transistor is connected in a Common Collector Amplifier configuration. The output pins of the microcontroller go through a 3.3KΩ resistor into the base of the transistor. The load the microcontroller is driving is in parallel with an emitter resistance of 100Ω. The program itself is organized such that each floor is controlled by its own task. Once the driver has chosen a spot, the spot number is sent to the first floor task. This is done by declaring the variable spot to equal the chosen spot. If the chosen spot is on the first floor, the LightPath function is called. This function accesses the EEPROM on our microcontroller development board where the LED paths for each parking spot are stored. We were forced to store the LED paths in the EEPROM due to the fact that the microcontroller chip contains only 400 bytes of onboard RAM. Once the EEPROM has been accessed, the proper path is lit. When the sensor corresponding to the chosen parking spot is blocked, the LEDs on the first floor are cleared and the task loops back to the beginning. If the chosen spot is not on the first floor, the ramp to the second floor is checked. This is done by checking to see if the variable ramp1 is full. If it is full, this means a car is waiting on the ramp. If ramp1 is empty, the LightPath function is called and the proper LEDs on the first floor are lit. Next, the sensor at the base of the ramp to the second floor is checked to see if the car has passed it and entered onto the ramp. Once the car is on the ramp, the first floor LEDs are cleared and the variable ramp1 is set equal to the variable spot1 and spot is cleared, indicating that the car is now on the ramp and no longer on the first floor. In this manner, a car parking on the third floor is essentially passed from floor to ramp all the way up to the third floor. The car moves from the first floor task to the first ramp, then to the second floor task, then the second ramp, and finally the third floor task. Because of this we can have a maximum of five cars parking in the garage at any one time. The tasks for floors two and three are very similar to the task for floor one. Please see Figures 8-10 for detailed flowcharts of the microcontroller floor tasks. The last task is the entrance task. This task communicates with the Visual Basic interface through a serial port at a baud rate equal to 9600 baud. This task checks the sensor at the entrance to the parking garage every two seconds. If the sensor is blocked, the program initiates communication with the VB interface. Each of the parking spot sensors are checked and translated into a two byte array. The first 12 bits of the array each correspond to a different parking spot sensor. A ‘1’ means the spot is empty, and a ‘0’ means the spot is filled. The array is sent to the VB program. Once the driver has navigated through each of the VB interface’s screens, the microcontroller receives the chosen spot. The spot’s status is checked. If the spot is indeed empty, it is assigned to the first floor spot1 variable. Please see Figure 11 for a detailed flowchart of the Entrance Task. 10

First Floor Task Spot1 Empty? Yes Spot1 on 1st Floor? No Ramp to 2nd No Floor Empty? No Call LightPath START Yes Check Ramp to 2 nd^ Floor Sensor Sensor Blocked? No Clear 1st^ Floor LEDs Yes Call LightPath1 Yes Check Spot sensor Sensor Blocked? No Clear 1st^ Floor LEDs Yes Ramp1 = Spot Spot1 = Empty END Figure 8: First Floor Task 11

Third Floor Task

START Ramp Empty? Yes Call LightPath Check Spot sensor Sensor Blocked? No Clear 3rd^ Floor LEDs Yes Spot3 = Empty END Spot3 = Ramp Ramp2 - Empty No

Entrance Task

Check Entrance Sensor Sensor Blocked? No Send ‘c’ for ‘car here’ And Receive ‘r’ for ‘VB ready’ Yes Check All Parking Spot Sensors Send Sensor Info And Receive Chosen Spot Spot Empty? Set Spot1 = Chosen Spot Yes No Figure 10: Third Floor Task

3.2.2 Visual Basic Interface

The source code can be accessed here. https://courses.ece.uiuc.edu/ece345/projects/spring2003/project18_file2.rtf The entrance interface that the driver uses to view and select the desired parking space is programmed in Visual Basic. This graphic-friendly language allows us to mask function calls and command lines with colorful buttons, so the full functionality of a rigorous computer program is readily available to any common user at the click of a mouse. The screen shots of the interface are shown in Figure 12. The maps were created in Adobe Photoshop based on the floor plans of the model parking garage. Filled parking spots are crossed out with a red line. Available parking spaces are marked with either the letter ‘H’ for handicapped or ‘P’ otherwise. The parking spots are assigned identification numbers based on their closeness to the elevator. For exampled, in our model garage, parking spaces 0-2 are reserved for the physically disabled, since these spaces are next to the elevator on each floor. Spot 11 is the furthest spot on the 3rd^ floor, thus least likely to be picked. Following this numbered priority scheme, the Visual Basic program recommends the most logically optimal parking space or the smallest numerical value in this case. The recommended spot is boxed, and the driver may move the ‘+’ cursor freely to select a spot. Simple and clear screens inform the driver when the system is updating or paused for printing. Figure 12: Visual Basic Interface Screen Shots

4. DESIGN VERIFICATION

The project is composed of four components, which were tested and modified individually throughout the design process. Modular testing allowed for identifying and solving problems quickly and efficiently.

4.1 Guidance System (Red and Green LEDs)...........................................

Each LED was tested in series with a resistor on the protoboard before being wired into the parking garage floor. A number of different size resistors were tested to achieve maximum optical brightness of the LEDs. We first used a 150Ω resistor. However, once all the LEDs were built into the parking garage, we observed that they were not bright enough and increased the input current to approximately 100 mA using a transistor and a much smaller resistor of 15Ω. When a certain LED in the road failed to light, we used voltmeters to trace the circuit for misconnections. In the rare case where the LED was burnt out, we replaced the broken diode with a new one that had also been tested separately.

4.2 Tracking System (Sensors)

Each IR Sensor / IR LED pair was tested on the protoboard before being installed into the model parking garage. Similar to the road LEDs, we tested the IR LEDs with various size resistors and used a resistance of 30Ω in order to maximize the input current, thus producing greater intensity. Please see Figure 14 for a graph of intensity vs. input current. Figure 14: Normalized Radiant Intensity vs. Input Current To check the intensity of the IR LED, we used a special Infrared paper that visibly reflects IR light. Due to the limited detection range of the sensors, we individually adjusted the position of each IR LED relative to the sensors. A voltmeter was used to measure the output voltage of the sensor—above 4V is high and below 1V is low. Upon achieving the lowest possible output voltage from the IR sensor when exposed to IR light, usually about .2 V, the sensor and LED were secured with electrical tape. By blocking the light of the IR LED, the high output voltage

of the sensor was also tested. After finding that the sensors were not as accurate in the parking garage when surrounded by so many IR LEDs, we taped the back of the sensors with black electrical tape to block unwanted IR light leakage for greater accuracy. Throughout building the parking garage, we constantly measured the output of individual sensors with a voltmeter to assure proper performance. The position of individual sensors and LEDs were adjusted accordingly when voltage output levels were not high or low enough for digital logic.

4.3 Microcontroller

We wrote a number of small test programs to test the various functionalities of the microcontroller. Using the monitoring port and the built-in Debug.Print function of the BasicX- 24, we were able to observe and debug using these test programs. To test the I/O Pins, we forced either a high or low value on specific pins and read the output with a voltmeter. To test for serial port communication, we sent and received known byte values and observed the exchange for speed and accuracy. To debug the parking program’s algorithm, we broke the codes into various smaller segments and used the Debug.Print function to manually step through the loops.

4.4 Visual Basic Interface

The serial port communication ability of the Visual Basic Interface was tested with the microcontroller as described in Section 4.3. Upon successful compilation of the functions, the Visual Basic code was then modified to achieve the most simplified and aesthetically pleasing graphical layout on the interface screens. After the individual components were tested and verified, the LED guidance circuits, sensor networks, microcontroller, and Visual Basic interface were integrated together for a complete, fully functional Smart Parking System. Then using toy cars to trigger sensors, we were able to simulate a number of real world scenarios within our model. The simulations allowed us to observe our parking system functioning under different conditions. In accordance to our observations, we adjusted timing, delay, and frequency of looping within the computer programs to optimize performance. We also replaced faulty sensors, LEDs, TTL Logic Chips, and broken wire connections within the circuit. In the end, our parking system performed as expected, meeting all design specifications.