Design of GPS-GSM vehicle-mounted positioning terminal
2026-04-06 06:09:51··#1
1. Introduction With the increasing prevalence of vehicles in China, vehicle safety management has become a growing concern. Currently, many departments and systems in China lack orderly vehicle management, even exhibiting chaotic conditions. For example, in the postal system, the use of postal vehicles for smuggling goods is quite common. Similarly, in the public transportation, taxi, and passenger transport industries, there are requirements for vehicle coordination, management, dispatching, and monitoring. GPS vehicle positioning systems utilize the global positioning capability of GPS and the bidirectional data transmission capability of existing mobile communication networks (GSM or GPRS) to enable dispatch centers to track, locate, manage, dispatch, and monitor vehicles. A typical vehicle positioning system mainly consists of two parts: a positioning terminal and a monitoring center. The vehicle terminal is the key to the entire system design. This paper introduces the design of the vehicle positioning terminal in a GPS vehicle positioning system in which the author participated. This terminal has already been applied to some extent. The terminal adopts a novel dual-CPU design, effectively solving the problem of the terminal's inability to operate continuously for long periods. 2. System Hardware Structure The main functions of the vehicle-mounted terminal include two aspects: first, communication: the terminal can obtain various information from the monitoring center, most of which are instructions issued by the center to the terminal, and the terminal must be able to respond quickly to the center and provide reports; second, monitoring: after obtaining commands from the center, the terminal must be able to detect the vehicle's status according to the requirements of the instructions and control the vehicle when necessary. For the communication function, the terminal mainly uses an OEM industrial mobile phone module. This module not only meets this functional requirement, but also, in conjunction with a vehicle-mounted handle, can fully realize the functions of a vehicle-mounted mobile phone. Users can use the handle to send and receive text messages or make and receive calls, not just limited to communication between the terminal and the center. For the monitoring function, most of the information required by the center comes from a Global Positioning System (GPS) module on the terminal. This module can provide information such as the terminal's (i.e., the vehicle's) current time, geographical location, speed, and direction. The information required by the other part of the center is partly obtained through dedicated sensors, such as detecting the fuel level and usage in the fuel tank, and partly through a simple analog signal input port, such as the opening and closing of doors and whether the engine is running. The terminal controls the vehicle using a set of relays, controlling it by outputting different levels. The vehicle terminal designed by the author can also connect to various existing vehicle anti-theft devices on the market to further enhance vehicle monitoring and control functions. When the system's functions are slightly more complex, the terminal also integrates a memory module (usually a FLASH module) for storing fixed information and recording driving trajectories. It can read and write to the memory through an RS232 interface, which also saves on communication costs. The GSM module, GPS module, vehicle handle, anti-theft alarm, and FLASH mentioned above can all be fully controlled by a high-performance microcontroller. The controller uses a UART port to program and control the GSM, GPS, and handle, uses I/O ports for status input and control output, and achieves interconnection with the anti-theft alarm. It also uses an AD channel to connect to sensors. It should be noted that most microcontrollers have only one or two serial ports. This system, controlling three modules, requires three serial ports. Additionally, a 232 interface needs to be added for the FLASH memory. Therefore, it is necessary to expand the serial ports, or to implement this through multiplexing programming. The latter is slightly more difficult, and this system adopts the latter approach. A small CPU is also used to manage the system controller, which will be explained in detail later in the text. Figure 1 shows the hardware design block diagram of the vehicle-mounted positioning terminal designed by the author. [b]3 Hardware Selection[/b] 3.1 Controller Selection The MSP430F149 is a Flash-type ultra-low-power 16-bit microcontroller produced by TI. It features strong processing power, fast operating speed, and high reliability, making it suitable for industrial operating environments, especially for battery applications or handheld devices. Regarding controller resources, the MSP430F149 has two UART ports. UART0 is used for multiplexing GPS and the handset, and the extended RS232 interface also uses this serial port. UART1 is used for the GSM module. The MSP430F149 also has a 12-bit AD channel, which facilitates the design of analog signal interfaces. In summary, we chose the MSP430F149 as the main controller of the system. 3.2 GPS Module The GPS module used in this vehicle terminal is the Holux GR-85, which supports the NMEA0813 V2.2 data protocol, meaning the output data is in ASCII code. For specific meanings, please refer to its application manual. The data output format uses the recommended positioning statement: RMC statement. This positioning statement data includes parameters such as time, latitude and longitude, speed, direction, and whether the positioning data is valid. The positioning data refresh frequency is 1Hz. 3.3 GSM Module The terminal uses the Siemens TC35I industrial GSM module, which has a 40-pin ZIF connector interface. Its interface circuit mainly includes power and startup circuits, RS232 interface, SIM card connection port, voice interface, etc. In addition, the module has a 50Ω antenna connector. [b]4 Design Considerations[/b] 4.1 In the SIM card connection system, the TC35I module operates at 4.5V. After the system is powered on, a low level of more than 100ms must be applied to pin 15 (/IGT) of the ZIF connector, and the signal fall time should be less than 1ms; otherwise, the module cannot start normally. After startup, pin 15 should remain high. After startup, the terminal can send AT commands to the module's serial port to control the module and implement functions such as initialization, SMS sending, and voice calls. The module provides a SIM interface compatible with the ISO 7816-3 IC Card standard. An additional CCIN pin is used to indicate whether the SIM card is connected. Since the SIM cards provided by mobile operators do not currently provide this signal, CCIN is connected to CCVCC in the circuit design. Considering the impact on voice quality, the CCGND terminal of the SIM card is coupled to the GSM ground through a capacitor and an inductor to provide an isolation ground for the SIM card, so as to shield the influence of other signal lines on the SIM card. Figure 2 shows the SIM card connection circuit. 4.2 Dual-CPU Design GPS terminals operate in vehicle conditions, drawing power from the vehicle's battery. They are frequently subjected to significant impacts during ignition and shutdown. For concealment and theft prevention, terminals are often placed inside the vehicle's front console or deep in the trunk, resulting in severe electromagnetic interference from the vehicle's electrical circuits and high ambient temperatures. To prevent system crashes under such harsh conditions, certain measures must be taken. This system employs a dual-CPU design, with a slave CPU chip managing the MSP430F149. Its functions are: 1. Acting as a hardware watchdog: if it cannot establish a connection with the master CPU within a set time, the system restarts; 2. Managing the power supply of the entire system; this slave CPU can cut off or connect the power to other parts of the system; 3. During long-term system operation, it periodically power-offs and restarts the system when idle conditions are detected to maintain long-term system stability. [b]5 System Software Design[/b] 5.1 Module Software Control The microcontroller controls the GSM module TC35I by sending AT commands to its serial port. Each module has a corresponding AT command set. The microcontroller sends ASCII codes for specific AT commands via its UART port. For example, to send a text message containing "ABCD" to a message center number set to AT+CSCA="+8613800731500", first set the message sending mode to Text mode (AT+CMGF=1), then send the recipient number (AT+CMGS="XXXX (destination number)"). After the module returns the correct information, send the message content "ABCD". In this system, except when sending Chinese text messages using a vehicle-mounted handset (which requires PDU mode), most commands and data transmission and reception do not involve Chinese characters; therefore, Text mode is used. The microcontroller's control of GPS is not complex. It only needs to read positioning data from the module's serial port periodically or when needed. The positioning data uses the default recommended positioning information $GPRMC format statement, specifically in the form $GPRMC,<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<11>,<12>*hh, where <1> to <12> are the information content, including longitude, latitude, speed, direction, etc., separated by commas, and hh is the checksum of the entire statement. If the system needs GPS information, it will read the valid information portion when the RMC statement is detected. 5.2 Terminal System Software Design The terminal software design is closely related to the functions implemented by the terminal. The functions designed in this system are relatively complex. The general process followed by the system software is as follows: initialization → voice function processing → SMS command reading → handset command acquisition → command execution → vehicle status monitoring → SMS report sending. In other words, after initialization, the system continuously monitors the usage status of the voice channel and the delivery of SMS and handset commands. Once a voice request (or interruption request), SMS command, or handset command is detected, the system executes the command and reports back to the center. Some commands may require cyclic execution, such as reporting location information to the center 500 times per minute at regular intervals or recording driving trajectories to the FLASH memory at regular intervals. Therefore, even when no command is delivered, the system continues to execute or terminates previously received commands based on status flags. The system is also responsible for monitoring the vehicle's safety and driving status. For example, when the fence function is enabled, the vehicle must report to the center when entering or leaving a fenced area; when the route function is enabled, the vehicle must report to the center if it deviates from the route, and so on. In addition, the terminal must implement a series of functions that are not easily expressed in a simple flowchart. For example, when an external command requests to read historical trajectory data from the FLASH memory, or when an external computer writes fence and route data to the terminal's FLASH memory, the terminal may pause the execution of other functions until these functions are completed. The overall system flow is too long to describe here, so only one module is given: the functional flow of the initialization module, as shown in Figure 3. 6 Conclusion GPS vehicle positioning system has been applied to a certain extent. This technology, combined with geographic information technology (GIS) and database technology, can realize visual monitoring of vehicles by the monitoring center. The location and various statuses of each vehicle can be clearly displayed on the electronic map of the center. The concept of "visual" is being further deepened in the future. Terminals equipped with cameras can realize true visual monitoring by using GPRS data transmission technology. In addition, the anti-theft function of the terminal is becoming more and more perfect, and there is a trend of further expansion in the application market of private cars. This design has been extensively verified to be feasible. Based on the GPS-GSM architecture, this paper presents an effective, reliable and low-cost solution for the design of vehicle terminal. [b]References:[/b] 1. Hu Dake. MSP430 series FLASH type ultra-low power 16-bit single-chip microcontroller. Beijing University of Aeronautics and Astronautics Press. 2001 2. Liu Tao, Zhang Chunye, Han Xudong, et al. A Microcontroller-Based Short Message System Based on TC35 Mobile Phone Module. Electronic Technology. 2003. 3. Elliott D Kaplan. GPS Principles and Applications. Electronic Industry Press. 2001. 4. Feng Yue, Li Xiaomin, Feng Zhensheng. Application of GSM Technology in GPS Vehicle Monitoring System. Microcomputer Information. 1999. Author Biography: Fang He, male, born in May 1984, is a master's student at the School of Mechanical and Electrical Engineering and Automation, National University of Defense Technology, Changsha. His main research direction is modern sensor technology and systems. Editor: He Shiping