46
EZ Park FDR December 3, 2004 Prepared By: Tom Congdon Julie Dang Kim Kawahara Prepared For: Dr. Kathleen Kramer Dr. Chuck Pateros EEE 191

EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EZ Park FDR

December 3, 2004

Prepared By: Tom Congdon

Julie Dang Kim Kawahara

Prepared For:

Dr. Kathleen Kramer Dr. Chuck Pateros

EEE 191

Page 2: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

i

TABLE OF CONTENTS Introduction……………. ………………………………………………………………….1 Problem Statement……………. …………………………………………………………..1 Proposed Solution…………… ……………………………………………………………1 Market and Background Survey…………… ……………………………………………..3 Description of Project……………. ……………………………………………………….4

• Functional Requirements • Block Diagrams • Constraints

Specifications……………. ………………………………………………………………10 Methodology……………. ……………………………………………………………….12

• Design Schedule • Design Phases • Enhancements

Personnel…………………………………………………………………........................ 18 Deliverables………………………………………………………………........................20 Testing………………………… ……………………………………………………….20 Budget…………….. ……………………………………………………………………..23 Conclusion…………… ………………………………………………………………….24 References…………… …………………………………………………………………..25 Appendices

• Appendix A: Prototype – Pin Diagram • Appendix B: Main System – Schematic Diagram • Appendix C: PCB Layout of Main System • Appendix D: Sensor System – Schematic Diagram • Appendix E: PCB Layout of Sensor System • Appendix F: Transmitter Module Schematic • Appendix G: Assembly Software Program • Appendix H: Users Manual

Page 3: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

1

INTRODUCTION Throughout the world there are many buildings and attractions that lure in a high volume of people for a limited amount of space. Universities, malls, and airports all share this common trait; and with it comes the common problems of sufficient parking space to accommodate their visitors. These venues may have more than one parking area to accommodate for everyone arriving, but most times, people tend to look for parking that requires the least walking. Thus, certain parking lots or structures tend to become congested and consequently result in a big problem for drivers and the surrounding environment. PROBLEM STATEMENT In heavy congested parking areas, the main problem is that people will waste time driving around in hopes to find a vacant spot. Most times, to their dismay, they will find no open parking spots, which not only sets back their time schedule, but also causes frustrations which provides for a very unhappy environment overall. In addition to this, fuel is wasted during this time spent searching for available spots and with gas prices on the rise, it makes sense to derive a solution to this parking problem. This problem can be eliminated if these drivers were informed by some dynamic system of how many spots are in fact available. PROPOSED SOLUTION Our solution will reduce the amount of time a person spends checking for available parking in a lot, and will also remove the public safety officer from the responsibility of having to redirect traffic to other vacant lots. We plan to design and build a system that monitors how many cars enter or exit the University of San Diego Loma parking lot, and displays the number of available spaces within that lot to the user on an LCD screen that can be up to 300 feet away from the sensors. This will provide the driver with sufficient information to make the most efficient decision about where to park which will save the driver time and frustration. Figure 1 shows a picture of our proposed solution.

Page 4: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

2

Figure 1 - Parking Lot Diagram

Our system will be tested in the Loma lot, which is an overcrowded parking lot at the University of San Diego, but it will be applicable to any parking lot that becomes

Page 5: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

3

overcrowded and causes drivers to become frustrated and late because of parking difficulties. MARKET AND BACKGROUND SURVEY We have researched the market to see if there are any similar products to our idea that is already available to the public. The results of our research have indicated that there are some similar ideas but these products have different components and applications within their systems. For example, in the Barona Casino, San Diego, CA, there is a parking monitoring system in the parking structure that will display to drivers as they pull up how many spots are available within that lot. This sounds like a similar end product to our idea, however, the main difference lies in the method for sensor detection. They use individual optical sensors for each parking space. This creates an inefficient use of resources such as power and maintenance. First, the costs of this parking system (Barona Casino) will be a lot higher than the EZ Park system because the system uses individual sensors for every single parking spot in the lot rather than two (one at the entrance and one at the exit) like the EZ Park system. This is going to generate higher costs because of the larger quantity of sensors that have to be purchased, higher maintenance costs because the more sensors you have the more sensors you are going to have to fix, and there will be extended costs of power to keep this system running. In addition, maintaining all these sensors may be ineffective in its purpose because if one sensor is defective and sends the wrong signal, this will cause the entire system to be defective. EZ Park will address these issues, using less power, and fewer sensors to minimize the potential of error. Our end product will be cheaper and more efficient than any of these current products on the market. Another similar product researched was a parking monitoring system found in the Munich, Germany airport. This product provides a unique helpful feature for users, which is a guided direction display for drivers to follow as they drive into a vacant spot. Again, this feature makes this product cost more, and also limits its portability to this particular structure only. This portability issue is a problem when the desire to expand a structure or make changes arises. EZ Park will eliminate these issues, and provide for a more portable, cheaper and simpler product that will create a happier parking environment for everyone. In addition to this product, most other ideas that are circulating the market are involved with cashless payments, electronic parking permits, license plate readers, etc. Our idea is unique in the sense that it is affordable compared to other parking lot systems, it is portable as it uses above the ground sensors and it solves the specific problem of wasting time driving around in a lot where there are no available spots.

Page 6: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

4

DESCRIPTION OF PROJECT FUNCTIONAL REQUIREMENTS The final overall output of the EZ Park system is a three-digit numerical display on three LCDs showing the number of parking spots available in the parking lot. There are two systems in our EZ Park design: the Sensor System, which is the system that detects cars entering or leaving a lot and transmits this signal to the other system, called the Main System. The Main System receives this signal and updates a counter that displays the number of spots available in that parking lot. Each system will now be discussed in detail. Sensor System

• First, we are using fiber optic sensors to detect cars. The reason that these particular sensors were chosen was because they are made to be used over the ground which enables them for temporary use and allows portability. Most of the other sensors in consideration had to be set into the road, making them a permanent feature which is not ideal for users that may want the option to physically move them. Another reason for choosing these particular sensors is that they can detect cars passing over down to 0MPH. This is vitally important for our application because on days where the parking lot is congested traffic may be traveling at very slow speeds, so these sensors enable us to see every axle that passes over regardless of speed. The fiber optic pressure sensors are placed on the ground and have to be able to distinguish between cars and other outside objects that may come into contact with them. To do this, a protective cover has been placed over the sensors which desensitizes the sensors enough so that someone walking over, or riding a bike over them does not trigger a signal, but the weight of a larger vehicle driving will trigger the sensor.

• Second, the analog output from the sensors is processed into a high or low signal

before it reaches the transmitter. The sensor signal processing is done in three steps.

o In the first step, the signal goes through a comparator circuit which is comprised of an op-amp and a reference voltage, which is controlled by a varying voltage regulator, at the negative input. The analog signal is connected to the positive input, so whenever the analog signal is larger than the reference voltage it sends the op-amp into saturation and outputs 9V which will be voltage divided down to 3V. This will help to further filter out any signals which are not cars, and outputs a constant signal of 3V. We chose to use a LM324NNS chip because it has four different op-amps within it allowing us to use just one chip for both sensors, and it also has rail to rail outputs so when the op-amp is in low saturation the output is 0V and in high saturation it is 9V.

Page 7: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

5

o The second processing step is latching the output signal from the op-amps for a certain duration of time so that each axle crossing is only counted once. The chip that was chosen is a dual monostable multivibrator chip and the reason that it was chosen was because it has the capacity to latch 2 different signals (incoming cars and outgoing cars), and the duration of the latched signal can easily be adjusted by varying the 1M potentiometer in the circuit. This potentiometer has been set by the designers to count each axle once after collecting and analyzing data of cars passing over the sensors. Another nice feature of this chip is that it leaves the user the choice of outputting a high or low signal at the output. The chip is also retriggerable so if the signal is latched and another signal comes in, it retriggers itself and restarts its holdoff time. This is illustrated in Figure 2.

Sensor Signal vs. Latched Output Signal

0

2

4

6

8

10

-5 -3 -1 1 3 5

Seconds

Volts

Sensor SignalLatched Output Signal

Figure 2: Sensor Signal vs. Latched Output Signal

The first pair of signals in the above diagram could represent a car coming in at an angle while the latter signal could represent a car coming straight in. Either way the processed signal only outputs 1 signal in each case.

o The final step of data processing uses a second dual monostable chip. In

this step the latched signal from the first dual monostable is used as the input into a second dual monostable. This allows us to determine the exact length of the final output signal which is sent to the transmitter module. This step was necessary because before we were having problems with our transmitter transmitting different numbers of signals for one axle count because the length of the output signal from the first dual monostable chip would vary as seen in Figure 2. The length of the output signal from the second dual monostable has been adjusted by the designer to a fixed length so that it transmits exactly one signal per axle.

Page 8: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

6

• Third, the processed signal is sent wirelessly to a receiver on the Main System via the transmitter module that has been previously fabricated. The program on the rfPIC Microcontroller on the transmitter module will send a 4-byte data word that contains headers and other data that includes the output signal. The transmission will operate at 315Mhz, up to a distance of 300 feet. A great advantage of this particular transmitter and receiver module is that they use FSK (Frequency Shift Keying) scheme to communicate signals digitally, thus reducing noise.

• Fourth, the sensor system requires one DC power supply. The battery that we are

using is rated at 12VDC for 22AH. It is connected directly to the sensor analyzers and runs through voltage regulators to power the other components. The dual monostables and the transmitter module run off of 3V from the first regulator. The Vref signal for the op-amp runs off of 8V from a second regulator and the op-amp is powered by 9V from a third regulator. Further details can be seen in the sensor system schematic located in Appendix D.

Main System

• As mentioned in the Sensor System description, the Main System requires a receiver module. The receiver module receives data from the transmitter with little to no interference of up to a distance of 300feet at 315Mhz, using an FSK scheme.

• The microcontroller on the Main System constantly updates an accurate count

based on the inputs it receives from the transmitter, and then outputs the correct value on the LCD display to show the number of parking spots available to drivers. The software algorithm that is programmed into the microcontroller uses assembly code and the MPLAB IDE v6.61 compiler. The functions of this program can be summarized as follows.

o First, the program initializes the counter register to a certain value, which can be customized for any number depending on the parking lot. The initial value start at a 3 digit decimal number and for the purpose of our demonstration and using Loma Lot, we are initializing the count to be 123, which indicates 123 parking spots available.

o Second, the program will wait to detect any data word transmitted from

the Sensor System. If the sensor that is placed where cars are entering the lot is detected, the counter will decrement the initial value, and thus show a lower value (122). However if the other sensor that is placed where cars are leaving the lot is detected, the counter will increment the intial value (124). These two functions of incrementing and decrementing the counter value based on sensor detection occur in conjunction with each other.

o Third, the program will output the counter value on the input/output port

pins of the microcontroller which connects to the display portion of the

Page 9: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

7

Main System (see Figure 4). Once the value on the counter becomes negative, the program will output 3 zeroes on the LCD display screens to indicate that there are no spots available in the parking lot.

o Also incorporated in the program is a reset feature, where if the count may

become inaccurate, the parking lot manager can push the reset button, and the program will restart to the original count loaded into it and resume counting thereafter.

o Lastly, this whole process is repeated as an infinite loop and will wait to

detect either of the sensor inputs and constantly update the counter accordingly. For more details on the software program, see Appendix G.

• For the display, three decoder/driver chips each receive a nibble from the PIC,

decodes the information, and drives the value to the 4” LCD seven-segment displays. Each nibble outputted from the PIC represents the ones, tens, and hundreds digit on the LCD display. Because the LCD displays require and operating voltage of 3-5 volts AC, a 555 timer chip along with capacitors and resistors were connected to simulate an alternating current. (The oscillator operates at 75 Hz and outputs a peak to peak voltage of 5 volts.) This low frequency oscillator is connected to each of the decoder/driver chips.

• The power supply for the main system is a 9V battery, which is 5V regulated.

This will supply power to the entire main system which includes the receiver, three seven-segment displays, and the PIC that receives data from the receiver. The Main System draws a current of 21mA from the battery that has a life of 570 mA-hours, which provides 26 hours of activity. Since this may be a short time for most daily applications, as an alternative to this 9V battery as a power source for the main system, there is also a power connector for AC power from an electrical outlet (input 120VAC) that is converted to 9VDC (output) and then regulated to 5V.

BLOCK DIAGRAMS A top level block diagram can be seen here below in Figure 3 (Sensor System) and in Figure 4 (Main System). Figure 3 is the block diagram of the sensor system. In this system there are two ground sensors connected to their respective sensor analyzer, each being powered by a 12 volt battery. The outputs from these sensors are then run through our signal processing circuit which is powered by our voltage regulators from our 12V battery. After signal processing the signal will be reduced to either a high or low signal depending on whether or not a car has been detected. This signal is then passed into the transmitter module. The transmitter module includes an antenna and PIC 2 (rfPIC12F675F). This is where the signals are sent to the receiver on the main system.

Page 10: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

8

Figure 3 - Top level block diagram of the Sensor System

To see a more detailed pin diagram of each individual component of the block diagram for the sensor system, please refer to Appendix D for the circuit schematic. The second stand alone subsystem is shown is Figure 4. It is the main system for calculations and output values for EZ Park users. The receiver module and the LCDs are connected to the I/O pins of PIC 1 (PIC16F676). The PIC and receiver module require 5VDC for power, but since 9V batteries are very common, it more practical to include a 9V battery in our design along with a 5V voltage regulator to step it down. In Figure 4, the receiver module is detecting the transmitter data at the same radio frequency, then sends this digital data to the PIC. The PIC then processes the input data from the receiver, and updates its registers to count up or down based on the input data it receives. Then after it updates its counter register, it sends high signals through the binary coded decimal decoder which converts a four digit binary to seven segments. And this is done for each of the three (ones, tens, hundreds place) LCD’s.

Page 11: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

9

Figure 4 – Top level block diagram for the Main System

Underlying this top level block diagram, are detailed pin connections that can be found in Appendix B. CONSTRAINTS There are several realistic constraints that we have overcome in our design process. The first is economic as we stayed within our budget of $1,300 from AS funding. The second is manufacturability as we successfully used the Loma labs and the Loma lot for all of our testing. The third is reliability as our system is able to stand alone in any environmental condition. And the last constraint we faced was legal issues considering that our testing phase needed prior approval from the USD public safety to use the parking lot.

Page 12: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

10

SPECIFICATIONS This section outlines the requirements for the EZ Park system and summarizes its justification for being included in the design. For a more specific parts list and their prices, see the Budget Section. Sensor System

− Over the road sensors 2 sensors with 2.5m of sensors and 5m of feeder cable Uses fiber optics for high reliability Allow for temporary use and portability Detects cars traveling down to 0MPH

− Optical Analyzers

Converts sensor signal into a usable analog signal – LMV324 Op-amp

Has 4 op-amps within chip which saves board space on PCB Rail to rail output which is needed to trigger the dual monostable

– Dual monostable multivibrator Can latch 2 simultaneous signals; incoming car signal and

outgoing car signal Variable latching time Retriggerable

– Microchip rfPIC12F675 Transmitter Module Operates on a low active input from the dual monostable Transmits signals at 315MHz which allows it to be encased in an

enclosure and transmit up to 300ft Has a built in loop antenna

– 12V Lead Acid Battery Has a 22AH capacity Battery is sealed to make it weather resistant

– Varying voltage regulator Easy and inexpensive to acquire Allows for voltages to be regulated anywhere from 3V-12V

– Polycarbonate enclosure Has a ribbed seal which makes it fully weather proof Durable material

Main System − Microchip receiver module with antenna:

Included in a wireless kit, contains a built-in antenna − PIC16F676 microcontroller operating at 40MHz

Page 13: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

11

64 bytes of programmable memory, which is plenty for our instructions

Easily programmable via development board that interfaces to any PC with MPLAB IDE compiler program

Operates on 5VDC, the power supplied to the entire Main System − Three individual 4” LCD 7-SEG displays , operating on 3-5VAC each

Large size for easy visibility from far distance − Three latch/decoder/driver chips, operating on 2-6VDC

Receives binary input, and outputs high signals for a seven-segment display.

− 120VAC to 9VDC transformer power supply For convenient constant power supply from any 120VAC electrical

outlet − 9v Battery

Easy and convenient to purchase − 5V Voltage Regulator

Regulates 9VDC from battery source or from AC-DC power supply

− 555 Timer (oscillator) Simulates an AC voltage that operates at 75 Hz, to keep the LCD

displays from fading. − Plexi-glass weather resistant enclosure

Wireless Transmission − Data transmitted a distance up to 300 feet − Data transmission @ 56kbytes/second, 315Mhz, Frequency Shift Keying

scheme Fast update to refresh the new counter value Digital transmission reduces noise

Software

− Assembly language Easily interfaces with MPLAB IDE compiler program Easily downloads through development board

Page 14: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Julie Dang Kim Kawahara

12

METHODOLOGY DESIGN SCHEDULE This project spanned over two semesters. The first semester involved research, preliminary design and the building of individual components, and programming of the PICs involved. The second semester was used for integrating the individual components and finally testing and troubleshooting the EZ Park system. Using the techniques we learned in Engineering 5, with regards to the design process, we were able to produce a Gantt chart, which contains milestones and a guideline to project tasks to accomplish and their corresponding deadlines. A detailed layout of our design schedule can be seen on the following pages in Figure 5 and Figure 6.

Page 15: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang Kim Kawahara

13

ID Task Nam e

1 SPRING SECTION OF PROJECT2 Spring - 1st Half3 Brainstorm ideas for possible proposal topics4 Work on Request for Proposal5 RFP Due6 Research plan, bibliography, Industry contact7 Research various possible sensors8 Research various displays9 Research wireless Tx/Rx10 Research PIC-microcontroller11 Research Crystal Oscillator12 Research Similar Products13 Initial constraints, specifications, Gantt chart14 Decide on which sensor, PIC, display, Tx/Rx to use15 Work on Proposal16 Proposal-Introduction, Background, Design Plan17 Proposal-Personnel, Technical Survey, Description18 PDF and hard copies of written resort, rehearse presentations19 Create Power Point Presentation20 Proposal21 On going portfolio22 Portfolios and Team Developer Due23 Spring - 2nd Half24 Create Flow Chart for PIC25 Write Code for PICs26 Test and Debug Code27 Design PCB using Express PCB28 Purchase Demo Parts29 Study All Parts30 Design Power Supply31 Work on PDR32 Demo of PDR to instructors33 Preliminary Design Review

2/6

2/20

3/5

3/10

3/12

4/30

5/7

1/11 1/18 1/25 2/1 2/8 2/15 2/22 2/29 3/7 3/14 3/21 3/28 4/4 4/11 4/18 4/25 5/2 5/9February March Apri l May

Figure 5 - Spring Schedule

Page 16: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang Kim Kawahara

14

ID Task Nam e

34 FALL SECTION OF PROJECT35 Fall - 1st Half36 Update work plan, schedule37 Order/Buy Display, PCBs, Power Supplies38 Mount parts on circuit boards39 Create Project Webpage40 Updated budget and parts list complete41 Program all project functions42 Troubleshoot and correct errors in program code43 Interface PIC with display and receiver44 Interface and Test Tx/Rx45 Interface and Test all components46 Updated design specs, product diagram, user interface description47 Summary of tests performed and results, description of tests48 Work on CDR49 Submit and distribute CDR written report50 update webpage51 describe demo52 CDR oral report and demonstration53 Fall - 2nd Half54 Work on FDR55 Demo of FDR to Dr.Kramer and Dr.Pateros56 Final Design Review

KK

KK,TC,JD

Create Project Webpage

Updated budget and parts l ist complete

JD,KK

JD

Updated design specs, product diagram, user interface description

Summary of tests performed and results, description of tests

Submit and distribute CDR written report

update webpage

describe demo

CDR oral report and demonstration

Demo of FDR to Dr.Kramer and Dr.Pateros

Final Design Rev iew 12/10

7/11 7/18 7/25 8/1 8/8 8/15 8/22 8/29 9/5 9/12 9/19 9/26 10/3 10/10 10/17 10/24 10/31 11/7 11/14 11/21 11/28 12/5 12/12 12/19August September October Novem ber Decem ber

Figure 6 - Fall Schedule

Page 17: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

15

DESIGN PHASES In creating the EZ Park system there were four different phases in the design plan. These phases include research, prototype production, interfacing, and integration. Last spring we were able to complete all of our research, order all necessary parts, and create a fully working prototype. By the end of this fall semester we interfaced all of the parts in their subsystems and integrated these two systems together, yielding a fully working model of the EZ Park system.

Research (semester 1)

• The first step to our design plan was to do research to find out what parts we are going to need to make our system work. We did extensive research on parts and applications for our project last spring. Our research included finding other systems that compare with ours so that we can be sure to design our system to be unique from all others. It also included finding parts that would work for our application, and then making design choices on which parts would work for our project best. Our research was ongoing as

we continued to look for new innovative ways to design and improve our system.

Prototype Production (semester 1)

• In order to simulate our EZ park system, we created a small scale prototype. This prototype simulated cars coming in and out of a parking lot using two push buttons on a circuit board. One push button represented a car coming in and the other represented a car going out. The total amount of cars in the parking lot was simulated by a series of 12 LEDs that would light up individually as the push button, which simulates a car coming in, was pushed or a push button, simulated a car going out was pushed. The amount of unlit LEDs represented how many available parking spots there are left in the lot. Our prototype utilized wireless data transmission as the two push buttons were attached to the transmitter and the LEDs were attached to the receiver on two different systems.

• Our prototype was constructed by creating a circuit board that included the

transmitter, a PIC, and two push buttons. The other circuit board consisted of the receiver, a separate PIC and 12 LEDs. Assembly code was written to enable communication between our transmitter and receiver and to also make our LEDs correctly correspond to the signals from the push buttons.

• To simulate the LCD, an LTC-4727JR, one inch high quadruple digit seven-

segment display was soldered to a board with resistors, and NPN transistors were wired to the evaluation socket on the PICkit 1 Flash Starter Kit. The PICkit which is a development tool that is used to load assembly programs into any PIC microcontroller. This PICkit was programmed to continuously display a four digit number, with each individual digit displaying a different number. For a detailed pin diagram for this prototype, refer to Appendix A.

Page 18: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

16

Interfacing (semester 2) We have interfaced all of our individual components with their respective

subsystems (sensor system and main system). The following describes our methodology for interfacing each individual system.

Sensor System: • Interfacing the parts in the sensor system first began on the breadboard. On the

breadboard we would test each individual part first to make sure that it worked properly and after that we began interfacing parts together one by one. After each part would be interfaced into the system we would stop, check all of our inputs and outputs to check for accuracy and once we got the results that we wanted we moved onto the next part. Details on the sensor circuit diagram can be seen in Appendix D.

• After our system was fully working on the breadboard we laid it out on a PCB

which can be seen in Appendix E. Once all of the parts were soldered onto the PCB we went through and checked all of the major inputs and outputs to verify that the system was working correctly.

• From looking at the sensor system schematic one can see all of the connections

in the system. The following is a more detailed description of exactly what is going on.

1. The raw analog sensor signal is fed from the sensor analyzer into the positive input of the op-amp. The op-amp is powered by a 9V regulator and has a reference voltage of 8V going into its negative input.

2. When the sensor signal becomes larger than the reference voltage it sends the op-amp into high saturation and outputs 9V. This voltage is then divided down to 3V and is used as one of the inputs for the first dual monostable. The other input is held constantly high.

3. The dual monostable chip has two outputs. One that goes low when triggered and one that goes high when triggered. Once the first dual monostable is triggered these two outputs are used as the inputs for the second dual monostable. When configured correctly these inputs created a logic function that makes it so that the second dual monostable only outputs one pulse for every incoming signal.

4. The output signal from the second dual monostable is then used as the input signal into the transmitter module. The pull up resistors on the outputs for the second dual monostable are there to ensure that the signal is always high or low, and does not get stuck in some sort of intermediate state.

5. The transmitter then transmits this signal to the receiver located on the main system.

• The final step was to enclose the PCB and the sensor analyzers in a

polycarbonate weather resistant box.

Page 19: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

17

Main System:

• The first step in interfacing the main system was to collect all of our components along with the PCB to begin soldering parts. Please see Appendix B and C for details of our schematic diagram and PCB, respectively.

• Referring to our schematic and PCB, it can be seen how the components are

connected and oriented. 1. 9 input/output pins of the PIC Microcontroller are wired to the three

seven segment decoder chips, which are ultimately connected to their corresponding LCD (ones digit, tens digit, hundreds digit).

2. 1 input pin of the PIC Microcontroller is wired to the receiver module. 3. 1 input pin of the PIC Microcontroller is wired to the restart button. 4. The oscillator circuit (which includes the 555 timer chip) is connected to

the three seven segment decoder chips to provide an oscillated signal that mimics an AC voltage source that the LCD’s require.

5. The power supply connected for this system is a 9V battery placed in a battery holder directly on the PCB or a power jack that accepts AC voltage from an electrical outlet.

• The next step in interfacing was to download and debug the software program

into the PIC. 1. The counter register increments or decrements based on the sensor

inputs. 2. The program processes two inputs (two axles of a car) and counts it as

one car. 3. The program accepts an interrupt from the restart button and reset the

entire program. • The last step was to enclose the circuit board along with the LCD’s in a clear

water resistant box that shows all elements of our design.

Integration (semester 2) • Once each individual system was fully working, the two systems were integrated

together to create the final EZ Park system. Details of integrating the two systems (Sensor System and Main System) are further described in the Testing Section.

Our project is specifically designed to be used for the Loma Lot with only one entry and exit. We are designing for a one entry and exit parking lot to stay within our budget constraints. For an application requiring multiple entries and exits, more components such as additional sensors and transmitters must be purchased in order to monitor all of those areas.

Page 20: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

18

ENHANCEMENTS Once we met our proposed requirements, we added some enhancements to our design that addressed early problems with our system. One of the major problems that we encountered that would negatively affect the optimal performance of our system was that over time the count became inaccurate due to the following reasons:

1) Cars going in/out the wrong way or cars crossing a sensor and reversing causing

the PIC to count two cars instead of one. Solution:

A restart button is used to connect to PIC 1, and at anytime, the user can restart the program and return the display to the value of all available spots.

2) Diagonal cutting occurring when drivers defy the traffic lane assignments.

Solution: A plastic/rubber middle barricade is placed in the center of the entrance/exit lanes to deter drivers from cutting corners and hitting the wrong sensor.

PERSONNEL Tom Congdon, Julie Dang, and Kim Kawahara are all Senior Electrical Engineering students at the University of San Diego and have been in USD’s engineering program for the past four years. All three have taken courses to supply them with the knowledge in order to build the systems designed in this project. Tom, Julie, and Kim have all successfully completed the following courses that pertain to our project.

• Introduction to Microcomputers – course introduced a basic microprocessor and its applications, memory, and basic I/O device interfacing.

• Electronics I & II– topics included the analysis and design of analog and digital electronic circuits, devices, and systems.

• Signals & Systems – involved a mathematical modeling of physical systems. • Analog & Digital Communications– involved signal analysis, analog and digital

modulation and detection techniques, and modern communication circuits and devices. • Communication Transmission Principles– where we learned the principles of

electromagnetic fields, propagation, and transmission, and also had an introduction to antennas.

Note: For the subject on PIC microcontrollers, all three of us purchased the PIC Book from Picbook.com, received training from Dr. Pateros’ tutorials, and consulted our colleagues in the EEE142 Microcontrollers class.

Page 21: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

19

Individual Tasks The group work has been divided across our three group members, according to each person’s strengths, weaknesses, and task preferences. Tom Congdon has solid experience with sensors coming from his current internship with SAIC and his NIFTY project. He has done extensive research on sensors and how they work therefore he will be in charge of the sensor system of the EZ Park system. He will research and find appropriate sensors that will meet our specifications. He is our contact person for the sensor manufacturer industry contact. For the prototype system, he was in charge of connecting the push button sensors and interfacing them with PIC 2. He was also in charge of writing the code that lit up the LEDs in correspondence to the inputs from the push buttons. For the final system he designed the hardware for the sensor system and laid out the design on a PCB. His duties also included calibrating the sensors, processing the signals so that they are interfaced with the transmitter module and performing all of the testing on the sensor system. He was in charge of our finances and budget. Julie Dang has some wireless experience from her analog/digital communications class she took in Sydney, Australia. She also has been coordinating with Dr. Herr, professor of Microcomputers class, and her peer Joey Church for programming PICs. Thus, she was responsible for finding wireless data transmission that will be suitable for our project. She is also responsible for configuring the transmitter onto PIC 2 and configuring the receiver on PIC 1. For the prototype system, she soldered the receiver module onto the PIC 1 board with respective LEDs. For the final system, she worked with Kim to integrate with the seven-segment LCDs. She also overlooked hardware integration, making sure each component integrates properly. She also wrote the program counter and display output. She was also in charge of task management. Kim Kawahara has experience with output displays as she has designed a seven-segment display in the Microcomputers class at USD, where she had to output a number ranging from -999 to 999 for the FPGA calculator her group had to design previously for a final project. Kim found displays big enough yet still affordable for our project. For the prototype, she soldered the necessary components for a 10mm quadruple digit seven-segment display onto a circuit board with PIC 1. She also wrote the program to output numbers onto the display. For the final system, she worked with Julie on integrating the bigger seven-segment LCDs with our entire system, built an oscillating circuit, laid out the Main System PCB. She also maintained our portfolio.

Page 22: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

20

DELIVERABLES By the end of the semester 1, we were successfully able to make all of our individual components function as planned. These individual components included programming the PIC Microcontroller for calculation algorithms, I/O functionality of the PIC, monitor display interface with the PIC, sensor operation and its PIC detection, and wireless transmission of data. By our Critical Design Review on October 29th we had each individual system fully interfaced together and working on breadboard models. For the sensor system, we showed on the oscilloscope actual signals coming from the sensors compared to what their signal looks like after signal processing. The main system was fully interfaced together on a breadboard layout, and for demonstration purposes had signals coming in from push buttons on the transmitter module, which represented incoming and outgoing cars, and have correlating numbers display on our LCD’s. By our Final Design Review on December 10, we were able to demonstrate a fully integrated and functioning parking monitoring system. With this final product, we are displaying the full system using the Loma parking lot. Our system counts the cars that enter and exit the lot, makes a calculation, and then provides the user with the number of available spots on a display screen which allows the user to choose to enter that parking lot or relocate to another lot. TESTING The two different subsystems for our project include a sensor system and a main system. The sensor system is where the initial inputs are received and where the data is transmitted to the main system. The main system is where the actual calculations occur to determine how many available parking spots there are, and data is outputted onto the three LCDs. Sensors System

• The first tests conducted were to make sure that individual parts worked before trying to integrate them with others. To see if the fiber optic ground sensors were working properly their analog output from the sensor analyzer was connected to an oscilloscope, and it was found that they worked in correspondence to their expectations. They were found to be overly sensitive, though, when they were laid out without a cover because any amount of pressure would cause the sensor to clip on the oscilloscope. To solve this problem, we purchased a cover to provide some resistance so that only heavy objects, such as cars, will be able to trigger the sensors. The first cover chosen was a thick plastic material and after testing with cars it was found to be too resistive, as no signal would be detected. So the second cover that was chosen was a thinner plastic and after testing with pedestrians walking across it and cars driving over it we found it to be a perfect resistance as it would only detect the cars.

Page 23: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

21

• We have also tested a comparator circuit by connecting the analog output from the sensor analyzer to one input of an op-amp and a set reference voltage at the other input. We were able to successfully light an LED at the output of the comparator every time the sensors output an analog signal larger than the reference voltage. After testing actual cars passing over the sensor we found that the sensor signal clipped at 9V for every axle that crossed over. This allowed us to set our reference voltage to our op-amp at 8V which means that any signal produced by the sensor that is less than 8V will be ignored. This helps us to further filter out any object, other than a car, that may cross over the sensor.

• To test the first dual monostable chip, we wired it up on the breadboard and ran the

function generator to simulate the incoming signal from the sensors. The oscilloscope displayed how the output signal from the chip would stay high for a certain duration of time when triggered. We were also successfully able to lengthen and shorten the duration of the latched signal by adjusting the 1M potentiometer in the circuit. When the frequency on the function generator was raised to the point of where more than one signal would occur in the duration of the latched signal, the output from the chip stayed high as expected because of its retriggering ability. To determine the proper holdoff time for the dual monostable we recorded the time difference between axle crossings for cars traveling at variable speeds and different turn angles. Once this data was collected we went through and took the average of the times to determine the proper holdoff time.

• Another test that was performed was to determine the proper holdoff time for the output

of the second dual monostable so that the transmitter would only transmit one signal for each axle crossing. To do this we connected up both systems and counted on the LCDs how many times it would increment for a single sensor input. We then adjusted the holdoff time accordingly until the LCD would only increment one time for each sensor signal.

• In terms of integration of the sensor system, we were successfully able to connect all of

the components together and have them run sufficiently. This is illustrated in Figure 7 as it shows the signal coming directly from the sensor and the final output signal coming from our second dual monostable chip that will be going into our transmitter.

Page 24: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

22

Sensor Signal vs. Final Output Signal

0

2

4

6

8

10

-2 0 2 4

Seconds

Volts

Final Output SignalSensor Signal

Figure 7: Sensor Signal vs. Final Output Signal

From the above figure you can see how the final output signal is a specified duration of length regardless of how many incoming signals are latched.

Main System

• Writing and debugging the software to program the PIC Microcontroller in the main system involved many steps. To test the program on the main PIC, we compiled in MPLAB a wireless program that lights up LED’s on the development board, corresponding to the two buttons pressed on the transmitter module. After this was successful, we tried to edit the program so that we could intentionally control all other output pins. We successfully measured high output signals from the PIC when corresponding buttons were pressed. At this point we knew that we could control any output and input pin on our PIC using the software compiler. In the next step, we were ready to connect the Main PIC (separate from the development board) to the receiver module and decoder/driver chip with a simple 7-segment LED display to initiate the same sequence. As a result, we were able to see on the LED display the numbers, 0,1,2,3 based on the 2 digit binary combination we would press on the transmitter module (00,01,10,11-respectively). Once our final design’s 4” 7-segment LCD displays arrived we could finally test it with our driver, PIC, receiver, and transmitter. We were successful in displaying a count from 0-3 that was transmitted wirelessly.

• We then wrote software that would simulate a full count of three digits, and tested this

after downloading it into the PIC. We tested to see if the count remained accurate after pressing the button on the transmitter many times.

• To test the range of our transmission, we transmitted data and gradually moved further

away from the receiver to see what the maximum distance is before we can no longer receive any information. We found that our design goal of 300 feet was met.

Page 25: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

23

Full Integration (Sensor System + Main System) • The final test was conducted after the two systems were integrated together. It consisted

of performing controlled simulations where the amount of inputs were known as well as what the final outputs should be and seeing if they match up correctly with our LCDs.

• The two systems were placed in the Loma Lot and we drove cars over the sensors and

saw that our Main System kept an accurate count of the number of cars entering and exiting the lot. In the end it displayed the correct number of available parking spots in the lot.

BUDGET The list of EZ Park’s cost can be seen in Table 1. This table outlines the major costs of the project that may be adjusted throughout the progress of the EZ Park system. The following table has two totals, Price Total which is the total that our group has spent and the Actual System Total is the amount that it cost to build one EZ Park system. The most expensive part will be our sensors due to the fact that they have to be highly durable and accurate.

Table 1 – Costs for EZ Park Description Order Date Quantity Price Total Actual Cost of SystemUHF ASK/FSD/FM Receiver 4/14/2004 1 45.15 45.15Flash-Based Microcontroller w/ ASK/FSK Transmitter 4/14/2004 1 45.15 45.15Pickit 1 Flash Starter Kit 4/14/2004 1 65.00 65.00Proto-Piezo Traffic Sensorline 4/15/2004 1 406.00 406.0014-PIN Flash-Based 8-bit CMOS Microcontroller 4/28/2004 4 5.00 1.25BCD-to-7 Segment Latch/Decoder/Driver 9/27/2004 5 (sample) (sample)IC Multivibrator Mono DL 16-DI 9/27/2004 5 11.96 4.784.0' single digit LCD 7-segment display 10/1/2004 3 68.58 68.5814-pin right angle socket 10/12/2004 4 (sample) (sample)Cover for sensors 10/13/2004 3 42.00 28.00LM324 10/18/2004 5 19.10 3.825V @1A 10/21/2004 1 0.90 0.90Power Source 10/21/2004 2 4.26 2.137.5" x 6.0" PCB 10.21/2004 2 156.08 156.083"x6" PCB 11/8/2004 2 120 120BATT SEALED LEAD ACID 12V 33AH 11/8/2004 1 59.73 59.739-V Battery Holder 11/9/2004 1 1.41 1.41CONN POWER JACK 2.1MM PCB 11/9/2004 1 0.38 0.38TRANSFORMER 9V 200MA 2.1MM 11/9/2004 1 4.18 4.18IC REGULATOR POSITIVE 5V TO-220 11/9/2004 1 0.90 0.90CONN HOUSING 4POS .100 HI PRESS 11/9/2004 6 2.04 0.68CONN HEADER 4POS .100 VERT TIN 11/9/2004 6 2.82 0.95CONN TERM FEMALE 22-30AWG GOLD 11/9/2004 20 10.42 5.21Weather proof box to enclose circuitry 11/14/2004 2 60.00 30.00Screws, washers, standoffs etc. 11/14/2004 10 20.00 20.009-volt Battery 11/14/2004 2 10.00 5.00Extra hardware, adhesives, wires, connectors 11/21/2004 50

Total 1211.06 1075.28

Page 26: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

24

CONCLUSION EZ Park is a great solution to solve the big problem that people face in congested parking lots. We have successfully designed and built a working model of the wireless parking lot monitoring system. Not only will this product be applicable to the Loma Lot that we designed for, but it is also versatile to be used in any other similar parking lot application.

Page 27: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

25

REFERENCES

• Pateros, Chuck, Dr., Professor, University of San Diego • Church, Joey, University of San Diego • Buckley, Pete, Measurement Specialties, (757) 766-1500, [email protected] • California Department of Transportation, (916) 227-7000,

http://www.dot.ca.gov/hq/esc • Peatman, John B., Embedded Design with the PIC18F452 Microcontroller, Prentice

Hall, August 2002. • Tim Fielder, Roadramp Rural, (215) 794-9155,

http://www.roadrampsystems.com • Digikey Components, Transmitter and Receivers,

www.digikey.com • Barnett, Larry, Public Safety at University of San Diego,

[email protected] • How Stuff Works, Microcontrollers,

http://electronics.howstuffworks.com/microcontroller.htm

Page 28: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

26

APPENDICES Appendix A: Prototype – Schematic Diagram

Page 29: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

27

Appendix B: Main System – Schematic Diagram

Page 30: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

28

Appendix C: PCB Layout of Main System

Silkscreen and Pads

Page 31: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

29

Top Layer

Bottom Layer

Page 32: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

30

Appendix D: Sensor System – Schematic Diagram

Page 33: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

31

Appendix E: Sensor System PCB Layout

Silkscreen and Pads

Page 34: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

32

Top Layer

Bottom Layer

Page 35: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

33

Appendix F: Transmitter Module- Compliments of Steve Bible from Microchip Technologies Inc.

Page 36: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

34

Appendix G: Assembly Software Code Programmed to Main System PIC ;---------------------------------------------------------------------- ;---------------------------------------------------------------------- ; Main Program ;---------------------------------------------------------------------- ;---------------------------------------------------------------------- ; JULIE clrf AXLE_UP clrf AXLE_DN RESET clrf FLAGS ; clear flags clrf PORTA ; initialize PORTA inputs and outputs clrf PORTC ; initialize PORTC inputs and outputs movlw BEGN ; setup the state counter to call BEGIN movwf STATECNTR call INITIAL movlw 05H movwf ONES movlw 00H movwf TENS movlw 00H movwf HUNDREDS ; call LCD MAIN call TIMER call CLOCK ; movlw B'00000111' ; check if LEDs S0, S1, or S2 are set ; andwf LEDREG, W ; if set call SXOB ; btfss STATUS, Z ; call SXON btfss LRNPB ; if learn button is pushed call goto JULIE ; LRNDTCT ; btfsc LRNFLG ; if in learn mode call LEARN ; call LEARN movlw HIGH STATEM movwf PCLATH

Page 37: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

35

movf STATECNTR, W ; Mask out the high order bits of andlw B'00001111' ; STATECNTR (a noise guard) addwf PCL, F ; The program clock (PCL) is incre;mented by STATECNTR in order to go to the appropiate routine STATEM goto BEGIN ; goto BEGIN1 ; goto HEADER goto HEADER1 goto HIGHPLSE goto LOWPULSE goto RECORD goto WAIT4END goto VALIDATE goto COUNTER ; goto RESET ; These RESET commands correct ; goto RESET ; erroneous values of STATECNTR ; goto RESET ; not caught by the mask above. ; goto RESET ; goto RESET ; goto RESET ;---------------------------------------------------------------------- ; RECEIVE SEQUENCE ;---------------------------------------------------------------------- ;*********************** CODE WORD FORMAT **************************** ; _ _ _ _ _ __ _ __ _ _ ; | | | | | | | | | | | | | | | | | | | ; | |_| |_| |_| |_____________| |__| |_| |_/ /_| |_| |_________| ; / / ; |--PREAMBLE---|---HEADER----|---------DATA------------|--GUARD--| ; TIME ;********************************************************************* ;******************** RECEIVED DATA BREAKDOWN ************************ ; ;bytes | DATA1 | DATA0 | ;bits | 7| 6| 5| 4| 3| 2| 1| 0| 7| 6| 5| 4| 3| 2| 1| 0| ;desc. |S2|S1|S0|S3| 0| 0| SERIAL NUMBER 3 | ; ;bytes | DATA3 | DATA2 | ;bits | 7| 6| 5| 4| 3| 2| 1| 0| 7| 6| 5| 4| 3| 2| 1| 0| ;desc. | COUNTER | ; ;* S3 Not used ; ;********************************************************************* ;---------------------------------------- ; BEGIN ; This function looks for a possible start to the data stream. ; ; Input Variables: ; RXDATA ; Output Variables:

Page 38: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

36

; none BEGIN btfsc RXDATA incf STATECNTR, F ; Make state BEGIN1 goto MAIN BEGIN1 btfsc RXDATA goto MAIN call SETWATCH incf STATECNTR, F ; Make state HEADER goto MAIN ;---------------------------------------- ; HEADER ; Detects a valid header. ; ; Input Variables: ; RXDATA ; Output Variables: ; none HEADER btfsc RXDATA ; The program loops here until 1.25ms goto RESTART ; passes and if the data is still btfss TMRHIGH, 0 ; low. If both hold true -> HEADER1. goto MAIN ; 1.25ms occurs when: movlw D'64' ; TMRHIGH = 1 ~= 2^8*4us = 1ms andwf TMRLOW, W ; TMRLOW = 64 ~= 64*4us = 0.25ms btfsc STATUS, Z goto MAIN incf STATECNTR, F ; Make state HEADER1 goto MAIN HEADER1 movlw D'6' ; If the data goes high before 6ms subwf TMRHIGH, W ; then the header is valid, else btfss STATUS, C ; restart. goto HEADER2 ; TMRHIGH = 6 = 6*1ms = 6ms goto RESTART HEADER2 btfss RXDATA goto MAIN call SETWATCH movlw D'32' ; Initiate BITCNTR to 32 in order to movwf BITCNTR ; receive 32 bits of the data stream. incf STATECNTR, F ; Make state HIGHPLSE goto MAIN ;---------------------------------------- ; HIGHPLSE

Page 39: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

37

; Times the width of high pulses. ; ; Input Variables: ; RXDATA ; Output Variables: ; none HIGHPLSE btfsc TMRHIGH, 0 ; If TMRLOW overflows then RESTART goto RESTART btfsc RXDATA goto MAIN movf TMRLOW, W ; Move the pulse width value to movwf HIGHWDTH ; HIGHWDTH for later calculations. call SETWATCH incf STATECNTR, F ; Make state LOWPULSE goto MAIN ;---------------------------------------- ; LOWPULSE ; Times the width of low pulses. ; ; Input Variables: ; none ; Output Variables: ; none LOWPULSE btfsc TMRHIGH, 0 ; If TMRLOW overflows then make goto LOW2 ; state HEADER. btfss RXDATA goto MAIN movf TMRLOW, W ; Move the pulse width value to movwf LOWWDTH ; LOWWDTH for later calculations. call SETWATCH incf STATECNTR, F ; Make state RECORD goto MAIN LOW2 movlw HEADR movwf STATECNTR ; Make state HEADER if lowpulse is ; too long. goto MAIN ;---------------------------------------- ; RECORD ; Records each bit as it comes in from the data stream. ; ; Input Variables: ; RXDATA ; Output Variables: ; DATA0 ; DATA1 ; DATA2 ; DATA3

Page 40: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

38

RECORD movf HIGHWDTH, W subwf LOWWDTH, W ; The state of the carry bit after rrf DATA3, F ; this operation reflects the data rrf DATA2, F ; logic. This is then rotated rrf DATA1, F ; into the storage bytes. rrf DATA0, F movlw HIGHP movwf STATECNTR decfsz BITCNTR, F goto MAIN movlw D'4' ; Starting here and including RECORD1 movwf COUNTR ; a check is made to make sure that movlw DATA0 ; the data is not composed entirely movwf FSR ; of 1s. RECORD1 movlw 0xFF xorwf INDF, W ; Use indirect referencing to point to btfss STATUS, Z ; DATA0 -- DATA3 on subsequent loops goto RECORD2 ; in RECORD1. incf FSR, F decfsz COUNTR, F goto RECORD1 goto RESTART RECORD2 movlw WAIT movwf STATECNTR ; Make state WAIT4END goto MAIN ;---------------------------------------- ; WAIT4END ; Wait for the guard time at the end of the code word before ; attempting to receive another code word. ; ; Input Variables: ; RXDATA ; Output Variables: ; none WAIT4END btfsc HLFLG ; HIGHLOW is set to indicate that the goto WAIT1 ; data has transitioned from a high btfsc RXDATA ; to a low. goto MAIN call SETWATCH bsf HLFLG WAIT1 btfss RXDATA goto WAIT2

Page 41: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

39

bcf HLFLG goto MAIN WAIT2 btfss TMRHIGH, 3 ; If the low period is greater than goto MAIN ; 8ms (2^3*1ms) then the guard time bcf HLFLG ; has been reached. incf STATECNTR, F ; Make state VALIDATE goto MAIN ;---------------------------------------- ; VALIDATE ; Checks that the transmission received is from the valid ; transmitter. ; ; Input Variables: ; DATA0 ; DATA1 ; Output Variables: ; none VALIDATE movlw 0x00 ; EEPROM Address = 0x00 call DATA_EEPROM_READ ; Get stored DATA0, EEDATA -> W xorwf DATA0, W ; compare with received DATA0 btfss STATUS, Z ; If first byte checks out then goto RESTART ; continue, else restart movlw 0x01 ; EEPROM Address = 0x01 call DATA_EEPROM_READ ; Get stored DATA1, EEDATA -> W movwf TEMP ; move received DATA1 -> TEMP bsf STATUS, RP0 ; ---- Select Bank 1 ----- movf EEDATA, W bcf STATUS, RP0 ; ---- Select Bank 0 ----- xorwf TEMP, F ; compare with received DATA1 btfsc TEMP, 0 ; Do bits 8 and 9 of Serial Number 3 goto RESTART ; check out? btfsc TEMP, 1 goto RESTART incf STATECNTR, F ; Make state IMPLEMENT goto MAIN ;---------------------------------------- ; COUNTER ; Implements the outputs specified by the received code word. ; ; Input Variables: ; DATA1 ; Output Variables: ; S0 ; S1 ; S2

Page 42: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

40

COUNTER btfsc DATA1, 5 ; Check if input 1 is depressed (cars leaving lot) call AXLE_I call LCD btfsc DATA1, 6 ; Check if input 2 is depressed (cars entering lot) call AXLE_D ; call LCD ; clrf SX1TMR ; initialize the timers for the clrf SX2TMR ; outputs goto RESTART ;---------------------------------------- AXLE_I incf AXLE_UP movlw 02H xorwf AXLE_UP,W btfsc STATUS,Z call INC return INC clrf AXLE_UP incf ONES movlw 0AH xorwf ONES, W btfsc STATUS, Z call CHANGE1 ; call LCD return CHANGE1 clrf ONES incf TENS movlw 0AH xorwf TENS,W btfsc STATUS,Z call CHANGE2 return CHANGE2 clrf TENS incf HUNDREDS return AXLE_D incf AXLE_DN

Page 43: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

41

movlw 02H xorwf AXLE_DN,W btfsc STATUS,Z call DEC return DEC clrf AXLE_DN decf ONES movlw 0FFH xorwf ONES,W btfsc STATUS,Z call CHANGE3 ; call LCD return CHANGE3 movlw 09H movwf ONES movlw 00H xorwf TENS,W btfsc STATUS,Z call CHANGE4 decf TENS return CHANGE4 movlw 09H movwf TENS decf HUNDREDS goto COUNTER LCD ; movlw 09H ; xorwf ONES,W ; btfsc STATUS,Z btfsc ONES, 3 bsf RA4 btfss ONES, 3 bcf RA4 btfsc ONES, 2 bsf RA2 btfss ONES, 2 bcf RA2 btfsc ONES, 1 bsf RA1 btfss ONES, 1 bcf RA1 btfsc ONES, 0 bsf RA0 btfss ONES, 0 bcf RA0

Page 44: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

42

btfsc TENS, 3 bsf RC4 btfss TENS, 3 bcf RC4 btfsc TENS, 2 bsf RC3 btfss TENS, 2 bcf RC3 btfsc TENS, 1 bsf RC2 btfss TENS, 1 bcf RC2 btfsc TENS, 0 bsf RC0 btfss TENS, 0 bcf RC0 btfsc HUNDREDS, 0 bsf RC5 btfss HUNDREDS, 0 bcf RC5 movlw 09H xorwf ONES,W btfsc STATUS,Z call LCD2 return LCD2 bcf RA4 bcf RA2 bcf RA1 bcf RA0 bcf RC4 bcf RC3 bcf RC2 bcf RC0 bcf RC5 return ;------ ; RESTART ; Sets the State Counter to BEGIN so that the receive sequence ; is restarted. ; ; Input Variables: ; none ; Output Variables: ; none RESTART movlw BEGN ; restart receive sequence and return movwf STATECNTR ; to MAIN

Page 45: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

43

goto MAIN ;---------------------------------------------------------------------- ; Data EEPROM Memory (Section 8.0) ; ; PIC12F629/675 devices have 128 bytes of data EEPROM with address ; range 0x00 to 0x7F. ; Initialize Data EEPROM Memory locations ORG 0x2100 DE 0x73, 0x43, 0x02, 0x03 ;---------------------------------------------------------------------- ; Calibrating the Internal Oscillator (Section 9.2.5.1) ; Oscillator Calibration Register (OSCCAL) (Section 2.2.2.7) ; ; The below statements are placed here so that the program can be ; simulated with MPLAB SIM or emulated with the ICD2 or ICE-2000. ; ; The programmer (PICkit or PROMATE II) will save the actual OSCCAL ; value in the device and restore it. The value below WILL NOT be ; programmed into the device. org 0x3ff retlw 0x40 ;---------------------------------------------------------------------- end ; end of program directive ;----------------------------------------------------------------------

Page 46: EZ Park - University of San Diegocatcher.sandiego.edu/items/usdengr/EZParkFDR.pdf · Munich, Germany airport. This product provides a unique helpful feature for users, which is a

EEE 191 EZ Park Tom Congdon Fall 2004 Kim Kawahara Julie Dang

44

Appendix H: Users Manual I. Set-up To set up, execute the following steps.

1) First choose a side that will host the black box which will include the power source, and the Sensor System PCB with both analyzers on it.

2) At the entrance of the lot, place sensor marked “Entry Sensor” with the flat part marked “bottom” face down against the road. This will be your car entry sensor.

3) Next, extend the round portion of the sensor marked “Exit Sensor” past the first sensor and then place the flat part of the sensor marked “bottom” face down on the road in the area where cars will be exiting. This will be your car exit sensor.

Figure 8: Sensor Layout

4) Place the receiver box with the LCD display within 300 ft. of the black box.

II. Operation

1) To start up the system make sure the two pin power header is plugged in. Make sure the black and red wires plug into the matching colored pins. Also turn on the power switch of the receiver box before the black box to ensure that no cars are missed.

III. Maintenance

1) Clear the lot and press the reset button on the Main System once a month. 2) Replace 12V battery in the black box once a month. 3) Before replacing battery make sure that the sensor system is turned off. Then unscrew

the lid and the battery slides out.