Estimated Time of Arrival System for Campus Buses

By

Siev Ty Ear Ross Sayre Jason Mariquina

UIUC – Department of Electrical and Computer Engineering Senior Design Project Laboratory – ECE 345

TA: Matt Olsen

December 9, 2002

Project Number 3 ii

Abstract

This document will present the Estimated Time of Arrival (ETA) System for Campus buses. Using a network of Antennas, Basic Stamp 2 chips, encoders, and decoders, the ETA system will notify passengers waiting at a particular bus station of the estimated time of arrival for the nearest bus on a given bus route. The components used, the system design, and the overall function verification will be discussed. Additionally, obstacles and challenges that occurred during the process of constructing the system will be explained. iii

TABLE OF CONTENTS

1. INTRODUCTION...... 1

1.1 Motivation...... 1 1.2 Project Goals...... 1 1.3 Project Overview...... 1 1.3.1 Performance Specifications...... 1 1.3.2 Device Subprojects...... 2 1.3.3 Project Block Diagram...... 3

2. DESIGN PROCEDURE...... 4

2.1 Hardware Components...... 4 2.1.1 Antennas...... 4 2.1.2 Transmitters and Receivers...... 5 2.1.3 Encoders and Decoders...... 5 2.1.4 Microcontroller...... 6 2.2 Software Aspects...... 7

3. DESIGN DETAILS...... 8

3.1 Hardware Components...... 8 3.1.1 Bus Hardware...... 8 3.1.2 Station Hardware...... 9 3.2 Software Aspects...... 10

4. DESIGN VERIFICATION...... 13

4.1 Hardware Testing...... 13 4.1.1 Transmitter and Receiver Testing...... 13 4.1.2 Distance Testing...... 13 4.1.3 Frequency Selection...... 13 4.2 Software Testing...... 14 4.3 Overall Function Testing...... 14

5. COST ANALYSIS...... 15

6. CONCLUSION...... 16

6.1 Accomplishments...... 16 6.2 Challenges...... 16 6.3 Future Development Considerations...... 17

7. ACKNOWLEDGEMENTS...... 18

8. REFERENCE...... 19 1

1. INTRODUCTION

1.1 Motivation After using the bus system on campus for many years, passengers have become frustrated with the uncertainty concerning the arrival of a bus at a given bus stop. An increase in traffic and campus construction has caused rerouting of bus routes resulting in delays. Therefore, the development of a device which could provide estimated times for buses with real-time updates would be very useful. In return, passengers would be more satisfied with the bus system and may increase their usage of public transportation on campus. Also, this would enable passengers to better manage their time. This project was intriguing because it could be implemented using wireless communication, thus allowing our group to incorporate the knowledge and engineering skills we have obtained in wireless communications.

1.2 Project Goals

The main goal of this project was to provide a functioning prototype of this device which could initiate the design of a more complex and accurate system. Due to the large network of buses on campus, it was also very important to design a system which would be low in cost. With the campus continually increasing in size, the addition of more buses required that this device be capable of easy updates or alterations by a trained technician. The device should be small in size to allow for easy installation on buses and bus stops as well as be aesthetically pleasing.

1.3 Project Overview

1.3.1 Performance Specifications

Due to the nature of the environment this device will be used in, there are several performance specifications required to ensure reliable transmission and overall system functionality. To prevent the bus hardware from inadvertently triggering an incorrect station, the antenna on the bus must be unidirectional and limited in range to approximately 30 ft. With the use of station to station transmission, the transmission distance of the station transmitter must be greater than the largest distance between any two stations. Based on the fact that the stations can be placed anywhere, it is required that the antennas on the stations be omni-directional. These are the key performance factors which needed to be satisfied in order to obtain a reliable network between buses and stations. 2

1.3.2 Device Subprojects

Our device consists of three different subprojects:

Bus Hardware

The bus hardware consists of a 9-bit Motorola Encoder, HP-II Linx Transmitter and Linx Splatch antenna. The encoder will be used to provide a particular bus with a 9-bit identification number. This number will then be sent to the Linx Transmitter as serial transmission. From the transmitter, the signal will be sent to the Station Hardware via the splatch antenna.

Station Hardware

The station hardware consists of a HP-II Linx Transmitters, two HP-II Linx Receivers, Basic Stamp 2 microprocessor, three 9-bit Motorola Decoders and the LCD. The basic function of the station hardware is to receive signals from the transmitters on the buses and other stations using the Linx Receiver. The output of the receiver matched to the bus transmitter is then connected to all three decoders. The station hardware also transmits signals to other stations using the Linx Transmitter. With the information from the decoders, the Basic Stamp 2 processes the information and displays the appropriate times for the first closest bus and second closest bus for the given route on a LCD.

Station Software

The station software was implemented using the PBasic language. One of the functions of the software is to sort the data received from the three decoders and the station receiver. Another function is to create a number to be transmitted to other station via the station transmitter. Since the Parallax Basic Stamp 2 does not have an internal clock, there is a timing algorithm used in displaying the times on the LCD.

TXM-900-HP-II 921.37 MHz 3

1.3.3 Project Block Diagram

The block diagram, as shown in Figure 1, displays the flow of data between the hardware components in the project. The processing of data and the relationship between the hardware components will be explained in greater detail in chapter 3, the design details.

TXM-900-HP-II 921.37 MHz

Station 1

RXM-900-HP-II 921.37 MHz

BS2-IC

RXM-900-HP-II TXM-900-HP-II 919.87 MHz LCD 919.87 MHz

TXM-900-HP-II RXM-900-HP-II 919.87 MHz LCD 919.87 MHz

BS2-IC

RXM-900-HP-II 921.37 MHz

Station 2

TXM-900-HP-II 921.37 MHz

Figure 1. Project Block Diagram 4

2. DESIGN PROCEDURE

During the construction of the project, various decisions were made. The types of components used had a crucial impact to the overall functionality of the device. Therefore, the specific hardware components needed to be carefully selected to work simultaneously with the software aspects of the design to ensure optimal performance. The design decisions related to specific hardware components will be discussed in detail followed by the integration of the software aspects.

2.1 Hardware Components

2.1.1 Antennas

Three different antenna types were considered during the construction of the project: helical, splatch, and whip. The main characteristic of the helical antenna is unidirectional propagation. This characteristic was vital for the bus signal transmission because the signal hit more than one station when the signal did not propagate in only one direction. However, due to the large size and bulkiness of this antenna, another antenna had to be used. The bus would not be aesthetically pleasing and also a large antenna protruding from the bus is a hazard.

The Splatch antenna was the next antenna considered. The functionality of the Splatch antenna is very similar to the functionality of the helical antenna. The main characteristic of the Splatch antenna is that it also has unidirectional propagation yet is very small in size compared to the helical antenna.

The last antenna considered for this project was the whip antenna. The whip antenna is an omni-directional antenna. This characteristic was necessary for the station transmitter and receiver. In order for all of the stations to be functioning properly, each must receive the same information. The omni-directional property of the whip antenna must be utilized because stations can be located in various directions with respect to one another.

After considering the various possible antennas, the Splatch antenna best fit the criteria for the bus transmitter due to the unidirectional propagation and the small, planar shape would allow for a virtually unnoticeable alteration to the bus. For the antennas on the station, it was vital that the antenna be omni-directional; therefore, the only allowable antenna was the whip antenna.

The whip antenna has a lead length that has an affect on the impedance. To match the impedance of the antenna with the impedance of the transmitter or receiver, Equation (1) can be used. The lead length (L) of the antenna for ½ - wavelength is

L (ft) = 468/Frequency (MHz) (1) 5

2.1.2 Transmitters and Receivers

With the resources provided, the decision was limited to two different wireless transmitters and receivers, both manufactured by Linx Technologies. First, the LC Series Linx modules were evaluated. The LC Series modules could be used on three different frequencies at 315 MHz, 418 MHz and 433.92 MHz. Each separate frequency was implemented on a different chip. The modules were very small in size and could be mounted parallel to a surface.

Further research was done concerning the HP-II Series Linx modules to determine if they were a better fit for the requirements needed for the project. The HP-II Series modules could be used on eight different frequencies in a range of 902-928 MHz. Most importantly, the HP-II Series modules had channel selects allowing for the use of any of the eight frequencies on one given module. The only negative aspect of the HP-II Series compared to the LC Series was the fact that the HP-II Series was larger in size and could not be mounted parallel to a surface.

After careful consideration, it was determined that the HP-II Series best fit the requirements needed for wireless transmission. The higher frequencies would be beneficial in allowing for a smaller antenna length and the variable channel selects. These channel selects allowed for the purchase of one specific module for both the bus to station link and the station to station link whereas the LC Series required the purchase of separate modules for two different frequencies.

2.1.3 Encoders and Decoders

In order to identify given buses, the most logical approach was to assign a unique binary bit string to each bus. To satisfy this requirement, encoders were the most efficient choice. During initial research, an encoder with a significant number of bits was one manufactured by Holtek Semiconductors Inc. In order to obtain parts directly from Holtek, ordering from an international company was required. As a result, the Motorola IC encoders and decoders (see Figure 2) were chosen because they could be ordered from domestic suppliers. Decoders were ordered initially for testing purposes but were later incorporated into the final product. 6

Figure 2. Encoder/Decoder Schematic

The oscillation frequency is

fosc = 1/(2.3*RTC*CTC’) (2) where

CTC’ = CTC + 20 pF (3)

RS = 2*RTC (4)

The resistor and capacitor values for the decoder from Figure 2 are determined by

R1C1 = 3.95* RTC*CTC (5)

R2C2 = 77* RTC*CTC (6)

2.1.4 Microcontroller

The two microcontrollers considered were the Motorola HC-12 and Basic Stamp 2. The Basic Stamp 2 was chosen for multiple reasons. Not only was the Basic Stamp 2 approximately half the price of the Motorola HC-12, but the Assembly language used to program the Motorola HC-12 was much more complex than PBasic language used to program the Basic Stamp 2. Even though the Motorola HC-12 has a faster processor, processing speed was not a major concern of this project. The speed of the processor was not very important in the ETA system because the number of instructions were not considerably high. Finally, the Basic Stamp 2 was significantly smaller is size, which was a key feature, compared to the Motorola HC-12. 7

2.2 Software Aspects

The software was written using Parallax’s Basic Stamp Editor. As mentioned before, the software language for the Basic Stamp 2 is PBasic, a rather simple language. The simplicity of the language was a key factor in the decision on which microcontroller was to be used. The software embedded in the Basic Stamp modules at each station performs the processing of data received from the bus receiver, after being decoded with the Motorola IC decoders, the station receiver as well as providing the data to be sent to other stations through the station transmitter. 8

3. DESIGN DETAILS

3.1 Hardware Components

The hardware components exist in two different levels, bus hardware and station hardware. All Linx transmitters and receivers have been supplied with a clean power source by including the suggested supply filter in Figure 15 in the HP Series-II Transmitter Module Design Guide [1].

3.1.1 Bus Hardware

The bus hardware consists of a 9-bit Motorola encoder (MC145026), Linx transmitter (TXM-900-HP-II at 921.37 MHz) and a Linx Splatch Antenna (ANT-916-SP), as shown in Figure 3.

Motorola MC145026 TXM-900-HP-II Encoder

ANT-916-SP

Figure 3. Bus Hardware Block Diagram

The identification number for each individual bus is encoded as a 9-bit binary string by the Motorola encoder. The address pins (A1-A9) were set to 100000000 to encode bus 1, A1-A9 = 110000000 for bus 2 and A1-A9 = 111000000. With a 9-bit binary encoder, 29 buses with unique identification numbers can be encoded. The 9-bit binary string is then sent serially to the Linx transmitter to be transmitted to the station for processing. The Linx transmitter was set at a frequency of 921.37 MHz by setting the channel select pins, CS2-CS0, to 111 on the transmitter. Alternative frequencies may be set by setting the channel select pins according to Figure 17 in the HP Series-II Transmitter Module Design Guide [1]. The signal is then sent via the Splatch antenna connected to the antenna pin of the transmitter.

To determine the baud rate of the encoder, Equations (2) and (3) were used to obtain a value for the baud rate as close to, but not exceeding 9600 baud. This baud rate was selected after research had shown that 9600 baud was one of the industry standards and allowed for fast transmission of data. Exceeding a baud rate of 9600 baud could possibly result in errors during transmission due to information being lost or misinterpreted because the information is already being sent at a relatively fast rate compared to other 9 industry standards. The specific values of the capacitors and resistors used in Equations (2) and (3) are listed in Table 1.

TABLE 1. ENCODER AND DECODER DESIGN SPECIFICATIONS

fosc CTC’ CTC RTC RS R1 R2 C1 C2 9211 Hz 4720 pF 4700 pF 10 kΩ 20 kΩ 8.06 kΩ 165 kΩ .022 µF .022 µF

3.1.2 Station Hardware

The station hardware consists of a Basic Stamp 2 microcontroller (BS2-IC), a Linx bus receiver (RXM-900-HP-II at 921.37 MHz), a Linx station receiver (RXM-900-HP-II at 919.87 MHz), a Linx transmitter (TXM-900-HP-II at 919.87 MHz), three Motorola IC decoders (MC145028), three whip antennas (ANT-916-CW) and a 16 X 2 serial input LCD (PC1602Q), as shown in Figure 4.

RXM-900-HP-II 921.37 MHz

MC145028 MC145028 MC145028

TXM-900-HP-II RXM-900-HP-II BS2-IC 919.87 MHz 919.87 MHz

PC1602Q

Figure 4. Station Hardware Block Diagram

The bus receiver obtains data sent from the transmitter located on the bus. This data is then sent to all three decoders where the valid transmission pin goes high if the decoder address bits, A1-A9, match those sent by the bus hardware. Each separate decoder output is connected to an independent input pin on the Basic Stamp 2. The Basic Stamp 2 uses this data and transmits the corresponding data to all other stations via the station transmitter. The station receiver obtains data sent from other stations and transmits this data serially to the Basic Stamp 2 for processing. After processing has concluded, the appropriate data is sent to the LCD for display. 10

To achieve a reliable wireless link, the length of the antenna leads needed to be a ½ - wavelength of the frequency. Using Equation (1) with the frequency equal to 919.87 MHz, the length of the antenna lead was 6.105 inches and with the frequency equal to 921.37 MHz, the length of the antenna lead was 6.095 inches. Due to the differences in antenna leads being one hundredth of an inch, all leads were cut at slightly over 6 inches because the only accessible tool was a conventional ruler.

In order for the decoders to receive the correct serial data, the baud rate it receives at must match the baud rate the data is sent from the encoder. With the encoder baud rate set at 9211 Hz, the values for R1, R2, C1 and C2 were determined using Equations (5) and (6). These values are listed above in Table 1.

3.2 Software Aspects

The source code can be accessed in the appendix (https://courses.ece.uiuc.edu/ece345/cgi-bin/view_project.pl?fall2002_3).

The key functions of the software were to set values from data obtained from inputs and to construct a timing algorithm due to the Basic Stamp lacking a usable internal clock. The Basic Stamp 2 allows for the use of 16 I/O pins, but the software only utilizes 7 pins. The assignment of pins is listed in Table 2.

TABLE 2. BASIC STAMP 2 I/O PIN ASSIGNMENTS

PIN I/O FUNCTION 1 Input Decoder – Bus 1 2 Input Decoder – Bus 2 3 Input Decoder – Bus 3 4 Input Station Receiver 5 Output Station Transmitter 6 Output LCD 7 Output Transmitter Power Down

Initially, to decipher which bus was at the station, the software was to obtain a serial stream of data from the bus receiver and determine which bus was present. To ensure proper transmission of data into the Basic Stamp, the baud rate of the serial input had to match the baud rate of the encoders. Equation (7) is obtained from Table 5.72 of the Basic Stamp Programming Manual [2].

Software value = INT(1,000,000/baud rate) - 20 (7)

Using Equation (7) with the baud rate equal to 9211 baud, the value used in the software was 88. 11

To ensure proper transmission, a test file was created with the serial input baud rate matched to 9211 baud. Several tests had been administered and continually the data received from the encoder serial stream did not match the actual values set on the encoder. As a result, the deciphering of buses was converted into a hardware issue and implemented using decoders. This provided the necessary accuracy of the data retrieval.

With the lack of a usable internal clock, the countdown of the times on the LCD needed to be implemented as a software algorithm. The Basic Stamp 2 could process up to 4,000 instructions every second and with this information a timing algorithm could be created by approximating the number of instructions run between each time update and the time set for timeouts in the serial data capture.

To determine the initial times for the countdown, the constants were added to the software according to Figure 5 below.

Station 1

5 minutes 3 minutes

7 minutes Station 2 Station 3

Figure 5. Estimated times between stations

The flow of data and the decisions encountered can be seen in the software flow chart below in Figure 6. The software continually loops and is only restarted when the reset button is pushed on the Basic Stamp 2 Carrier Board or the 9V battery is disconnected. Therefore, the software jumps from checking for a bus signal to checking for a station signal. Only when a signal is present in either case does the software continue. During serial input and output commands in the software, the timing algorithm is run to update the display times as well as the times in memory. The reasoning behind the timing algorithm running at this portion of the software is due to the extended time given to wait for an incoming signal. With virtually 4,000 instructions needed to equate to a second, it was only necessary to run the timing algorithm after the serial commands. This was allowable because the serial commands occurred at least once every second in the software. 12

Software Flowchart

Initialize LCD

No

No Yes BusID and Bus Rx pin Station Rx pin StationID high? active? received

Yes No Find estimated time for BusID BusID = 1st BusID and StationID received closest BusID?

Yes Estimated time and BusID Send bit string with Shift 2nd closest received BusID and time to 1st closest StationID to Tx time, stored 3rd closest time to 2nd closest time

Yes No Replace 1st closest on LCD BusID = 1st with estimate closest BusID?

Shift 2nd closest data to 3rd Yes No Bus Rx pin still closest data, shift 1st closest No high? BusID = 2nd data to 2 nd closest data, set closest BusID? 1st closest on LCD with No estimate and BusID BusID = 2nd Estimate greater No closest BusID? than 1st closest? Yes Shift 1st closest data to 2nd closest data, set 1st closest Stored 3rd closest Yes Yes on LCD with estimate and time shifted to 2 nd BusID closest time, stored 3rd time set Yes to zero Replace 2nd closest on LCD BusID = 2nd with estimate closest BusID?

No

Shift 2nd closest data to 3rd BusID = 3rd No Estimate closest data, set 2nd closest closest BusID? greater than 2nd on LCD with estimate and closest? BusID Yes Yes

Set 3rd closest time Yes BusID = 3rd to zero closest BusID?

No

No Estimate Replace 3rd closest with LCD estimated greater than 3 rd estimate and BusID time flashes 00:00 Station Rx pin closest? high?

Yes Yes

Station Rx pin Start estimated LCD estimated still active? time countdown time at zero? No No

Yes Figure 6. Software Flow Chart 13

4. DESIGN VERIFICATION

4.1 Hardware Testing

4.1.1 Transmitter and Receiver Testing

The main components used for the wireless aspect of the project were the Linx transmitter and receiver. To test the functionality of the transmitter and receiver, a function generator and oscilloscope were used. As shown in Figure 7, the function generator was set to output a 1 kHz, 1.2 V peak-to-peak square wave. The output of the function generator was then connected to the Data In Pin of the transmitter. The Data Out Pin of the receiver was then connected to an oscilloscope. The results can be seen in Figure 8. As demonstrated, the frequencies remained the same, but the peak to peak voltage was amplified to 5 V. This change in amplitude is acceptable because binary strings are being sent, all high values are equal to VCC and all low values are equal to 0 V can still easily be detected by the hardware.

Figure 7. Transmitter Input Figure 8. Receiver Output

4.1.2 Distance Testing

The distance testing was done in the Quad area between The Union and Foellinger Auditorium. In order to test distance, a transmitter, receiver, decoder, encoder and LED were used. The Data In Pin of the transmitter was connected to the Data Out Pin of an encoder, and the Data Out Pin of the receiver was attached to the Data In Pin of a decoder. Connected to the Valid Transmission Pin of the decoder was a LED. The LED would turn on when a valid transmission was being sent. The transmitted signal was sent from the foyer of The Union and received at approximately near Foellinger Auditorium. Testing continued at increasing distances until the transmitted signal was no longer received. For this test, the LED turned off at a distance of approximately 1200 ft.

4.1.3 Frequency Selection

To test the functionality of the frequency select capabilities of the transmitters and receivers, a transmitter, receiver, decoded, encoder and LED were used. The encoder 14 was connected to the Data In pin of the transmitter. The decoder was connected to the Data Out pin of the receiver. An LED was connected to the Valid Transmission pin of the decoder. When the LED was turned on, proper communication between the transmitter and receiver was established. The LED remained on when frequency select channels were matched on both the transmitter and receiver. However, when the frequency select channels on the transmitter and receiver were set differently, the LED turned off. Thus, the operation of the transmitter and receiver set at one frequency would not affect another pair of modules set at another frequency.

4.2 Software Testing

Testing of the software was done by creating a test file. As long as the software could be loaded into the Basic Stamp 2 module, further testing on the accuracy of the software would be done in the overall function test. The test file was created to determine if valid data would be received from an input connected to an encoder transmitting 9-bits of data serially. The test was used to determine if a bus identification number could be correctly read from the 9-bit transmitted data. With the baud rate of the SERIN command matched to the output of the encoder, the test file would output the value obtained on both the LCD as well as the PC for verification. The values displayed on the PC by means of the DEBUG command matched the LCD yet they did not match the corresponding input. After several tests, the data received varied for a fixed input and therefore was deemed unreliable for this project. An alternative hardware implementation was used in order to decipher which bus was at the station.

4.3 Overall Function Testing

In order to test the remaining portion of the software, the entire circuit had to be assembled. Only with the hardware and software integrated could the system be verified for operational use. Tests were performed mainly on the SERIN and SEROUT commands of the PBasic language. To ensure correct transmission, previously determined values were sent to indicating the beginning of relevant data. In the case of this software, “GO” was sent prior to relevant data through the SEROUT command. When a station was to receive this data, it would skip “G” or one byte and wait for “O” to arrive then store the data following as a variable of specific length. The testing of this process indicated that waiting for “GO” would not work and therefore the skipping of a byte and waiting for “O” was tested and worked.

To determine where faults in the data transmission may have occurred, SEROUT commands to the LCD were included in the software with relevant text indicating when certain portions of the software were run. This allowed for corrections in the data retrieval and placement algorithms. 15

5. COST ANALYSIS

TABLE 3. PARTS LIST

Part Name Part Number Unit Cost Quantity Total Cost 16X2 LCD PC1602Q Lab Resource 2 --- Linx Receiver RXM-900-HP-II Lab Resource 4 --- Linx Transmitter TXM-900-HP-II Lab Resource 5 --- Whip Antenna ANT-916-CW Lab Resource 6 --- Splatch Antenna ANT-916-SP-ND $2.08 5 $10.40 Basic Stamp 2 BS2-IC Lab Resource 2 --- BS2 Carrier Board 27120 $20.00 2 $40.00 9V Battery EN22 $1.26 12 $15.12 9V Battery Holder 1295K-ND $0.93 12 $11.16 IC Encoder 9 Lines MC145026P-ND $2.19 4 $8.76 IC Decoder 9 Lines MC145028P-ND $3.03 4 $12.12 8 Position Dip Switch 76SB08 Lab Resource 14 --- LED HLMPxxxx Lab Resource 6 --- CAPACITORS 4700 pF Lab Resource 3 --- 0.022 µF Lab Resource 12 --- 0.1 µF Lab Resource 9 --- 33 µF Lab Resource 9 --- RESISTORS 8.06 kΩ Lab Resource 6 --- 10 kΩ Lab Resource 9 --- 165 kΩ Lab Resource 6 --- TOTAL $97.56

LABOR: ($40.00 / hour)*(100 hours)*2.5 = $10,000.00 per person ($10,000.00 per person)*(3 people) = $30,000.00

TOTAL: Total parts: $97.56 Total labor: $30,000.00 Total cost: $30,097.56 16

6. CONCLUSION

The final product of the ETA system performed as projected in the original proposal. The design objectives that were originally planned were met with slight modifications to the original design due to unforeseen challenges.

6.1 Accomplishments

The overall system functioned as expected. During the design and testing, a wireless link from a station transmitter to a station receiver was achieved over a large distance. In addition to the communication between stations, the bus transmitter was able to communicate with the bus receiver located at a particular station. The transmission distance of the data from bus to station was consistent with original projections of bus to station data transmission. Another goal achieved was the successful integration of the hardware and software. This integration was reached by the careful design of testing procedures used to test the software and hardware both independently and together as one system. The overall cost of the end product was also a major concern. Less expensive microprocessors were used to keep costs down without sacrificing performance. The nature of the project would require a microcontroller at every bus stop for each route. For this reason, the Basic Stamp 2 was chosen over the more expensive Motorola HC-12. This decision complicated the software aspect of the project because of the limited amount of memory provided by the Basic Stamp 2 as compared to the Motorola HC-12. This complication was overcome by reducing the amount of memory used by the software. Even though this obstacle produced a more complex program, the functionality remained consistent with the original intentions for the software.

6.2 Challenges

Many challenges were overcome during the construction of the ETA system. One challenge encountered during the integration of the hardware and software was the serial input on the Basic Stamp 2 microcontroller. This microcontroller was not able to receive the serial data properly from the binary encoder. Even though the baud rates of the Basic Stamp 2 and the encoder were designed to be equal, the Basic Stamp 2 received inconsistent and invalid binary strings from the serial output of the encoder. This was overcome by including additional hardware to our system to receive the serial data from the encoder and then output the correct information to the Basic Stamp 2. Another challenge was matching the impedance of the antenna to the transmitter. In order to eliminate mismatches in impedance, the correct antenna lead length needed to be measured along with a direct connection from the antenna to the Linx modules. With the antennas connected to the Linx modules correctly, individual receivers and transmitters behaved sporadically. The transmission and reception of the Linx modules varied depending on which transmitter was transmitting to which receiver. The information from the distance testing was used to determine which transmitters and receivers were used for the individual stations and buses. The transmitters and receivers with a smaller range of communication were used for the bus to station communication because the bus 17 to station transmission required only a short distance compared to station to station transmission.

6.3 Future Development Considerations

In the future, more advanced microcontrollers would enable the ETA system to be easily implemented on larger bus routes. The Basic Stamp 2 has a small amount of allocated memory which can not handle a large amount of information. If the Basic Stamp 2 microcontroller was used on a large bus route, multiple microcontrollers would be present at each station significantly increasing the amount of hardware necessary for optimal operation. The use of more advanced microcontrollers would have the capabilities to incorporate additional hardware components into the software reducing the amount of hardware in the design. In order to assure consistent data transmission, reliable communication hardware should be utilized in the production of the ETA system. This would eliminate some of the errors encountered with the use of less reliable hardware. With testing procedures yielding a transmission distance from station to station at approximately 1200 ft, a signal amplifier would be necessary to ensure transmission to all stations. Linx Technologies offers a Broadband Amplifier for their RF modules which will in turn boost the transmission distance by at least four times the original distance. 18

7. ACKNOWLEDGEMENTS

Authors would like to acknowledge Professor Jennifer Bernhard for her help concerning the wireless aspects of this project and Professor Stephen Franke for his assistance with the RF aspects of this project. 19

8. REFERENCE

[1] Linx Technologies, “HP Series-II Transmitter Module Design Guide,” December 2002, http://www.linxtechnologies.com/ldocs/pdfs/hptransman.pdf.

[2] Parallax, Inc., “BASIC Stamp® Programming Manual Version 2.0c,” December 2002, http://www.parallax.com/Downloads/Documentation/BASIC Stamp Manual v2.0.pdf.