















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Project; Class: Senior Design Project Lab; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Fall 2003;
Typology: Study Guides, Projects, Research
1 / 23
This page cannot be seen from the preview
Don't miss anything!
















Wireless Security Device By Melanie Gayagoy Gi Hyun Ko Edward Yin ECE 345, SENIOR DESIGN PROJECT FALL 2003 TA: Han Seok Kim December 7, 2003 Project No. 16
This project provides a solution to the outbreak of personal assaults that have occurred on campus in recent semesters. Our device consists of a keychain switch module, a GPS transmitter module to be carried on the person, and a corresponding receiver located in a 911 emergency response center. The switch module contains a speech chip that will alert others of they type of emergency occurring. The GPS data output is gated by a Basic X-24 microcontroller and sent via a 900 MHz transmitter. Finally, the receiver is connected to the computer, through which a specially-designed software interface will decode the GPS information. Each module has been tested individually and as part of an integrated system, resulting in a device that shortens the emergency response time of police, firefighters, or paramedics. ii
iv
1.1 Purpose Twenty-seven women were attacked on the University of Illinois at Urbana-Champaign during the Fall semester of 2002. The emergency booths scattered around the campus can sometimes be hard to find, and even if one has been found, it would be hard to expect a victim if she is being chased to be able to stay in one place long enough for the police to arrive. Meanwhile, the other current popular deterrent is the rape whistle, which is given all the female freshmen on campus. When a rape whistle is blown, bystanders who are within the vicinity are suppose to either start a chain by blowing his or her whistle or come to the aid of the victim. However, if an assault occurs during the hours of 2 to 5 am in the morning, the chances of a passerby are minimal. The need for a better security solution is greatly in demand, and our wireless security device provides the best remedy. By integrating the portability of the whistle and location tracking features of the emergency booths, the wireless security device will allow the user to carry around the product that will be able to both produce an alert sound and send the location of the user to the police center. 1.2 Preliminary Design The system designed for the proposal and design review had minimal functionality. The circuit consisted of a keychain module which housed the following: one pushbutton switch (with pull-down resistor) for alerting the police only a Linx 315 MHz transmitter to transmit the button press to the GPS module a square wave generator activated by the pushbutton an audio amplifier to control the volume of the alert a speaker to output a high pitch trill, of which the pitch is variable with the frequency of the square wave The GPS module, designed to fit in a purse or jacket pocket, included the following: a Linx 315 MHz receiver to receive the button press a Motorola HC-12 microcontroller for turning on the GPS unit and shutting it off after a predetermined amount of time the GPS unit to determine the user’s location and output GPS data a Linx 900 MHz transmitter to send the GPS data information to a computer On the other end of the GPS module was a Linx 900 MHz receiver that was connected through a serial cable to a computer that contained Microsoft MapPoint 2002 software. The functional block diagram is shown in Fig. 1.1.
invoke a reaction from others such “Help me. Call the Police.” Once aware of an emergency, bystanders could inform local authorities and provide a more detailed report of the incident to emergency personnel. The Motorola HC12 microcontroller was decided to have more functionality than was needed, so the Basic X-24 was implemented instead. The Basic X-24, being a smaller unit with fewer features than the HC12, requires less power and therefore extends battery life. The circuit was modified such that in place of the 5 V power supplies, voltage-regulated 9 V batteries were implemented. This essentially gives the design the portability it needs to be commercially viable. The map interface at the emergency center was written in Visual Basic. It automatically detects the reception of emergency type data as well as GPS data through the serial cables. The software uses the emergency type data to display the type of emergency to the screen, and it uses the GPS data to display the location of the user on a map of the surrounding area. The final design is shown as a block diagram in Fig. 1.2. 3 8 1 6 5 (^50) coax Ω RXM-315-LC^ LINX 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 2 3 4 5 6 7 8 9 10 LINX RXM-900-HP-II LINX TXM-900-HP-II Computer COM Data Out Data Out Channel Select 0, 1, 2 Data In GPS Unit Power Output^ Serial VCC From TXM-315-LC To RXM-900-HP-II From TXM-900-HP-II VCC DM74LS157^ 2 to 1 MUX BASIC X ATmega16L SPO256-AL LM386-N Basic X 1 3 2 MC7805 CT 9V 0.33 uF 0.1 uF 5V VOLTAGE REGULATOR KEY Mute Police Fire Paramedics 3 6 8 5 4 390 Rx Ω (^50) coax Ω TXM-315-LC^ LINX To RXM-315- LC COM Switch Module GPS Module Computer Interface Figure 1.2 Block diagram of final design 1.4 Performance Specifications
Three different types of emergency switches should produce the alerts from the speech chip The microcontroller on Switch Module should produce distinct serial data for each type of emergency selected The transmitter range should be up to 25 feet. The microcontroller on GPS Transmitter Module should receive the serial data from the receiver and distinguish each other for each type of emergency. The microcontroller on GPS Transmitter Module should output a serial data for each type of emergency selected, which is interpretable by a computer GPS signal should be inputted into the computer after 10 seconds of personal information input phase 1.5 Subprojects Our device consists of three main subprojects: Switch Module The switch module, intended to be small enough to hang on a keychain, is the unit by which the user would activate the transmission of data from the GPS module. It contains four pushbutton switches, a 315 MHz Linx transmitter, an ATmega16L microcontroller, an SPO256-AL2 speech chip, an audio amplifier and speaker, and a Basic X-24 microcontroller. The Basic X-24 is connected to the GPS module via the 315 MHz transmitter. Through this link, it transmits a different byte depending on the type of emergency that the user selects. Each of the three emergency buttons activates the speech chip, which is configured to alert surrounding people of the type of emergency that is occurring. A list of the different sentences it outputs is displayed in Table 1.1. A mute button on the switch module stops the audio alert from sounding, but lets the GPS module continue sending data. Table 1.1 Output of the SPO256-AL2 in response to each button press Button Pressed Output Sentence Police “Help me. Call the police.” Fire “Danger, fire. Danger.” Paramedics “Help me. Call the ambulance.” GPS Module The GPS module is intended to be small enough to carry in a purse or in a jacket pocket. It contains the 315 MHz Linx receiver, a Basic X-24 microcontroller, a GPS unit, a 2-to-1 multiplexer, and a 900 MHz Linx transmitter. The Basic X-24 reads in the byte sent in from the 315 MHz receiver, and compares it with its internal memory. If the received byte matches one of the emergencies, then it starts a timer and outputs the same byte serially to the multiplexer, which is in turn transmitted through the 900 MHz transmitter. Once the timer reaches ten seconds, the input select on the multiplexer changes, and the GPS information begins transmitting through the 900 MHz transmitter. After ten minutes, the multiplexer input select changes back, effectively shutting down the GPS data transmission. Computer Interface
During the course of our project design, various conditions for the usage of our product were considered. These considerations led to the selection of the types of transmitters and receivers, microcontrollers, and speech chip used to ensure optimal product reliability and efficiency. The design decisions for each component will be discussed, followed by the discussion of the type of software interface we chose to complement the circuit. 2.1 Hardware Components 2.1.1 Transmitters and Receivers With the resources provided, our choices for transmitter/receiver pairs were limited to the 315 MHz, 433.92 MHz, and 900 MHz Linx modules. The 418 MHz pair was not available. We decided to use the 315 MHz and 900 MHz pairs for the switch module and GPS module, respectively, because we wanted to eliminate the possibility that the two frequencies would interfere with each other. The 315 MHz pair was chosen for the switch module because of its low power consumption and for its relatively shorter range than the 900 MHz pair. Since the purpose of the GPS module is to track the user’s location, it would defeat the purpose of the product if we needed a range greater than 300 ft. The 900 MHz pair was chosen for the GPS module for its much greater range and also for its direct serial interface. Since the purpose of the GPS module was for sending digital information reliably through great distances, the 900 MHz pair was the right solution for our design. 2.1.2 Microcontrollers The two microcontrollers considered were the Motorola 68HC912B32 and Basic X-24. The Basic X- was chosen for many reasons. First of all, the Basic X’s price was approximately half the price of the HC12. Also, Basic X is physically smaller than HC12. This was an important factor as the switch module will be made into a key chain size module. The language used to code the Basic X-24 was Basic, which is a lot easier than Assembly language, which is used to code the HC12. The HC12’s processor speed is faster than Basic X-24 but it’s not a significant factor as the program is not very complex. The number of instructions was not very big. For the purpose of our project Basic X-24 was sufficient. For both microcontrollers’ outputs, a byte was outputted serially. This is to comply with the data transfer between the Linx transmitter receiver pair as it is done serially. Although we only have 3 different choices, we decided to output a full byte instead of two bits that are needed to correctly distinguish between the three choices. Since the serial data transfers are done by 8 bits or 1 byte anyway, it would be essentially same to send out a byte instead of three bits. Also, by using 8 bits, conversion from 3 bits to 8 bits is unnecessary. 2.1.3 Speech Chip The speech module is comprised of three components. The first component is the ATmega16L, which is 6MHz microcontroller. The microcontroller can be programmed in the C language which provides the user a greater flexibility to add extra features and easier debugging methods. It is the same price as the Basic X-24, but more reliable.
The next module is the SPO256-AL2, which is the heart of the speech module. The SPO256 or speech processor is a single chip N-Channel MOS LSI device that is able to synthesize speech or complex sounds using its stored program. The achievable output is equivalent to a flat frequency response ranging from 0 to 5 kHz and a signal to noise ratio of approximately 35 dB. It provides natural speech abilities. It stands alone with inexpensive support component and a sentence library with an expandable ROM option of up to 491 K. Finally, it has a pulse width modulator that creates a digital output, which is converted to an analog signal when filtered by a low pass filter. The last component of the speech module is the low audio amplifier, LM386N-1. The LM386N-1 is a power amplifier designed for low voltage consumer applications. It has a gain that ranges from 20 to
processed. When an allophone is being processed, the LRQ pin goes from low to high, and the SBY pin goes from high to low. When an allophone is processed, the speech chip sends out a digital output through its Digital Output pin. The digital signal is converted to an analog signal through the low pass filter, which is then received by the LM386N-1. The microprocessor then resets the SPO256 by sending a pulse to the RESET and SBYRESET pins at the same time once an allophone is processed. Once the speech chip is retuned, it is ready to accept another allophone. 3.1.2 Software To program the codes, syntax in language reference file [1] was used. Table 3.3 Functions used in the System Library Functions [2] Category Function Name Descriptions Queues GetQueue Reads data from a queue OpenQueue (^) Defines an array as a queue PutQueue (^) Writes data to a queue StatusQueue Determines if a queue has data available for reading Real Time Clock Timer (^) Returns floating point seconds since midnight Pin I/O PutPin Configures a pin to 1 of 4 input or output states Communications Debug.Print (^) Sends string to Com1 serial port DefineCom3 (^) Defines parameters for serial I/O on arbitrary pin OpenCom (^) Opens a serial port To make use of the data received from the GPS unit, a special software interface is needed to manipulate the data. The flowchart for this process is shown in Figure 3.5. The flow is designed run down both the left path and the right path at the same time, but because of the way the Basic X-24 in the GPS module is timed, the right path will finish running before the left path starts. Both processes terminate by pressing the Stop button and begin again when the Start button is pressed. Using Visual Basic, a program was designed to match the processes of the flow chart. It automatically detects when and where an emergency occurs, as well as what type of emergency it is. This keeps the emergency response operator from having to manually check for emergencies, and it also alerts the operator at the instant an emergency occurs. Automatically detecting the data can easily be implemented with the MSComm Active X control which can be found at Young’s website [3]. A list of the MSComm functions used in our software is shown in Table 3.4. Table 3.4 List of MSComm functions used in software interface Function Description PortOpen/PortClose Enables/Disables the serial port Input Reads the data in from the input buffer OnComm() Function that runs when an event has occurred at the serial port comEvReceive Triggers the OnComm function when the input buffer has been filled up RThreshold (= value) The number of bits that is read into the input buffer before signaling an OnComm event InputLen (= value) The number of bytes read from the input buffer at a time
3.2 Diagrams 1 2 3 4 5 6 7 8 9 10 11 12 24 23 22 21 20 19 18 17 16 15 14 13 27 26 25 BX 24 Microcontroller
Listen for incoming data into COM (GPS data) Listen for incoming data into COM (emergency type) START (click start button) Data detected? Data detected? NO NO YES YES Display connection data (com port, baud rate) Parse GPS data sentences to extract coordinates and display them Draw a square on the map corresponding to the triangulated position Decode the received byte and display the corresponding emergency Stop button clicked? NO YES Stop button clicked? YES NO END Visual Basic Interface Flowchart Figure 3.5 Visual Basic computer interface flowchart
4.1 Hardware Testing 4.1.1 Transmitter/Receiver Testing For the communication between the keychain switch module and the GPS module, a Linx 315 MHz transmitter/receiver pair was chosen. For the communication between the GPS module and the computer interface, a Linx 900 MHz transmitter/receiver pair was chosen. To test that the Linx pairs were working, the output of the function generator was connected to the Data In of the transmitter, and the oscilloscope was connected to the Data Out pin of the receiver. As shown in Fig. 4.1, the input is a 0 to 3 V square wave. The output is of the same frequency, but the output is scaled up to five volts, as can be seen in Fig. 4.2. This change in the amplitude is acceptable, because it is being sent as binary data which can be easily read and decoded by a computer. Note that Figs. 4.1 and 4.2 are shown in different scales. Figure 4.1 Data going into the TXM-900-HP-II Figure 4.2 Data coming out of the RXM-900-HP-II The range of the transmitters and receivers was tested separately. For the 315 MHz pair, to test the data transmission, the transmitter and the receiver were placed at opposite corners of the room, which is more than enough distance than needed for our application. The data sent into the transmitter was displayed on one oscilloscope, and the data coming out of the receiver was displayed on another oscilloscope, which matched. For the 900 MHz pair, the test was started the same way, but the effective range was never greater than the diagonal distance of the room. At such a distance, the data coming out of the receiver was incoherent. After replacing the 900 MHz pair with a different set, the new setup yielded the same result. For the design, such poor performance was acceptable, as long as the transmitter was set directly across the room from the receiver. If the project was to be further improved, a different transmitter and receiver would have to be considered. 4.1.2 Microcontroller Testing On the keychain switch module, a Basic X-24 microcontroller was used to distinguish the three different types of emergency pushbutton switches. For each emergency type, the microcontroller outputs a certain byte, as shown in Table 3.1. The switch module was tested to confirm that the byte output was correct. The method we used was:
Figure 4.6 Output of the Basic X-24 in the GPS module when each of the switches are pressed Table 4.1 ASCII characters representing binary data Byte ASCII representation 00000001b /1d ☺ 00000010b /2d ☻ 00000011b /3d ♥ Finally, we tested that the Basic X-24 in the GPS module correctly recognized the serial data coming from the switch module. The red LED on the Basic X turns on when the input from the 315 MHz receiver is equal to any of the three choices listed above. The Hyper Terminal was then used to check to output of the two Basic X’s working together. 4.1.3 GPS Data Output Testing To understand the NMEA (National Marine Electronics Association) format of the output from the GPS unit, we researched the meaning of the output at Piechulla’s NMEA website [4]. To verify that the output from the GPS device was the same, we used Hyper Terminal to see that the sentences were in the correct form. The sentence we cared about which had the preceding address of $GPGGA, was located in the output. 4.1.4 Speech Chip Testing In order to debug the Speech Module, we needed to determine whether specific pins were producing the correct transitions. The green led on the ATmega16 turns on and off to show that address bits are being processed into the speech chip. Meanwhile, a logic analyzer on the pins located at Port B shows that the ATmega16 sends out different address bits to represent a specific allophone. While the addresses are being processed, a logic analyzer was also attached to the ALD, LRQ, SBY, RESET, and SBYRESET in order to show that each pin was behaving correctly. In theory, when the ALD pin goes low, the LRQ will immediately go high while the SBY goes low. An oscilloscope also showed that a pulse is sent to the RESET and SBYRESET in order to reset the whole chip. Pin 24 of the SPO256 must
produce a digital output, which will turn into a small analog circuit after the low pass filter. This small analog signal will be processed and amplified through the LM386N-1 to the 8 Ω speaker. Figure 4.7 Output taken from the Logic Analyzer shows that the SPO256 was producing the right signal transitions 4.2 Software Testing In the debugging phase of the software design, we needed to show that the program automatically detected the data, the correct emergency type was displayed, and that the received coordinates were being parsed correctly. The output of the GPS unit and the output of the Basic X-24 in the GPS module were connected directly to the computer through com ports 1 and 2 directly. This eliminated any chance of a bad signal being sent through the 900 MHz transmitter. When the police switch was pressed, the word “Police” appeared in the software window. The other two switches were tested in the same way and confirmed to be correct. After the button press, ten seconds passed before the program started acquiring GPS data. This result agreed with our timing requirement. The GPS data was shown to be correctly parsed as a small rectangle appeared in the correct location on the map we defined in the program. 4.3 Conclusion In order to test the overall performance of the device, each individual module was connected to each other. Only with the hardware could the system as well as the software be verified for operational use. Tests were performed mainly on the switch and GPS data transmission and on the computer interface. The speech module can perform on itself alone and its functionality if based on its interaction with its microprocessor and wire stability. The distance range between the two sets of Linx transmitter/receiver varied and had a great impact on the data transmitted to the computer interface. The Linx 315 MHz transmitter/receiver has a smaller distance range compared to the Linx 900 MHz transmitter/receiver. The timing issues were also a factor when it came to the data transmission. The ten seconds allotted for the switch data transfer may have limited the Linx 900 MHz receiver’s ability to look for the proper data and transfer it to the computer interface. As a result, the switch data transfer is not consistent. GPS data acquisition was also a factor in the success of the device. The GPS unit can only acquire data outside of buildings from specific satellites. When testing was done inside the building, the computer interface was unable to acquire the correct location of the GPS unit. Unless in simulation mode, the received by the computer interface were irrelevant. Through the use of Hyper Terminal, we were able to determine if we were actually receiving switch information, GPS coordinates, or random information.