Keywords

1 Introduction

With the development of technology, the location tracking was integrated into our daily life. At present, the positioning tracker in the market has a more miniature asset tracker [1,2,3]. This tracker was positioned by Wi-Fi, Bluetooth, and GPS, with high positioning accuracy and was generally used to track keys, valuables, and pets. A wearable type real-time location tracker by GSM wireless communication technology [4,5,6], such trackers generally only used GPS for real-time positioned, with high power consumption, and used the elderly and children for location tracking. Traditional logistics tracked was generally based on warehouse storage for location tracked by online registration [7]. Based on the positioning and tracking function of the above tracker, this design was based on the embedded system [8, 9] and used the STM32 chip as the primary control MCU. A vehicle asset tracker was designed with Internet reminder, intelligent anomaly identification, precise location tracking, convenient disassembly, and use.

2 The Overall Framework of the System

The research device receives the current environmental information through the peripheral sensor modules, including temperature and humidity information, light-sensing information, GPS information, network signal, and three-axis acceleration information. The data is then processed by MCU and packaged into an asset information package (AIP). The device accesses the Internet through the wireless communication module. Then the MCU packaged AIP was subscribed and published to the MQTT (Message Queuing Telemetry Transport) server through the MQTT. By subscribing to the same topic as MCU, the webserver can receive the AIP published by MCU, then parse, process, and store it. Finally, the device's current location and other related information were displayed on the web map. Figure 1 shows the overall block diagram of the system.

Fig. 1.
figure 1

Overall block diagram of the system

3 System Hardware Module Design

3.1 Overview of System Hardware

The hardware design of this research device was mainly composed of a light intensity sensor, temperature and humidity sensor, three-axis acceleration sensor, wireless communication module, GPS positioning module, power management control module and STM32F105 development board.

STM32 read the temperature and humidity sensor and three-axis acceleration information through I2C communication mode, the wireless communication module and GPS positioning module communicate and control through UART port and I/O port, the light intensity and battery information were obtained by ADC sampling, and the indicator LED was controlled by I/O port.

3.2 Peripheral Hardware Circuit Design

Temperature and Humidity Sensor Module.

This module used an SHTC3 temperature and humidity sensor to detect the temperature and humidity of the environment where the device was located. SHTC3 is a digital humidity and temperature sensor integrated with a complete sensor system. Figure 2 shows the circuit diagram of the temperature and humidity module.

Fig. 2.
figure 2

Temperature and humidity module circuit diagram

Three-Axis Accelerometer Module.

This module used LIS3DH three-axis linear accelerometer to collect the current three-axis acceleration information of the device. The LIS3DH has a dynamic user-selectable complete scale of ± 2g/ ± 4g/ ± 8g/ ± 16g, can measure acceleration at an output data rate of 1 Hz to 5.3 kHz, and has 6D/4D direction detection, free-fall detection, and motion detection. Figure 3 shows the circuit diagram of the three-axis accelerometer module.

Fig. 3.
figure 3

Three-axis accelerometer module circuit diagram

Wireless Communication Module.

This module used the BG95 module to access the wireless network and obtain GPS location information. BG95 is a series of multimode LTE-Cat M1/Cat-NB2/EGPRS modules with an integrated GNSS function developed by Quectel. Figure 4 shows the circuit diagram of the wireless communication module.

Fig. 4.
figure 4

Circuit diagram of the wireless communication module

4 System Software Design

The main body of the system software design was divided into four parts: system architecture design, sensor data processing algorithm, data transmission control, and web data processing.

4.1 System Architecture Design

The design architecture of the research software was that after the device is powered on, MCU initializes and self-tests each module, obtains the relevant information of the device, and uploads it to the server. After receiving the server's feedback, the device enters a dormant state and continues to monitor the status through each module. When the regular wake-up time arrived, or each module detected an abnormal state of the device, the device was awakened. It then enters the normal tracking process of hibernation-work-hibernation.

The data collected by this research device were detected and processed by the following program modules: light sensing data detection and processing, temperature and humidity data detection and processing, GPS positioning information acquisition, sensor data detection, and processing.

Program Design for Detection and Processing of Light-sensitive Data.

The light-sensing data acquisition only needs to collect the current of the I/O port connected by the photosensitive sensor then compare it with the light characteristic curve of the sensor. The luminance of the current environment can be obtained.

STM32 collected the current of the light-sensitive sensor many times and calculated the average value ils. According to the optical characteristic curve, a light-sensitive abnormal threshold was iabn. When ils > iabn, the light perception is abnormal; otherwise, it is normal.

Program Design for Temperature and Humidity Data Detection and Processing.

The temperature and humidity data acquisition was written to the reading address of the SHTC3 device by MCU, and collected many times, and calculated that the average values of the current ambient temperature and humidity data were Tcur and Hcur, respectively, and determined the standard temperature threshold Tmin, Tmax and humidity threshold Hmax. When Tmin ≤ Tcur ≤ Tmax, the current ambient temperature is normal; otherwise, it is abnormal; when Hcur ≤ Hmax, the current ambient humidity is normal, and vice versa.

Program Design for Obtaining GPS Location Information. GPS positioning information was based on the BG95 module for transceiver and collection. Suppose N pieces of GPS information are obtained, each GPS information is expressed as Bi = {Lati, Loni}, i = 1,…, N, where Lati and Loni are latitude and longitude, respectively. At this time, taking B1 as the initial point, the distance di between each point and point B1 is calculated according to Eq. (1).

$$ {\text{haversin}} (\frac{d}{R}) = {\text{haversin}} (Lat_{2} - Lat_{1} ) + \cos (Lat_{1} )\cos (Lat_{2} ){\text{haversin}} (|Lon_{2} - Lon_{1} |) $$
(1)

where R is the radius of the earth, the average value is 6371 km, d is the distance between two positions, and haversine is Eq. (2),

$$ {\text{haversin}} (\theta ) = \sin^{2} (\frac{\theta }{2}) = \frac{1 - \cos (\theta )}{2} $$
(2)

Figure 5 shows the block diagram of the GPS information processing algorithm, where dfen is the radius of the fence with B1 as the center. The distance di relative to the B1 point is calculated by Eqs. (1) and (2). Then through the comparison of di and dfen, we can get the number ns and nm of the above location information inside and outside the fence. η is a static factor. By comparing the magnitude of ns and N*η, we can judge whether the device is in a static state or a moving state.

Fig. 5.
figure 5

Program block diagram of GPS information processing algorithm

$$ C = \frac{{\sum\limits_{i = 0}^{{n_{s} }} {S_{{n_{s} }} } }}{{n_{s} }} $$
(3)

When the device is in a static state, the current position coordinate D0 of the device can be calculated by Eq. (3). All the current position information is linearly fitted when the device moves and the linear equation y = ax + b with B1 as the coordinate origin is obtained. Then H1, Hnm/2, and Hnm are substituted into the linear equation, and the position information D1, D2, and D3 are obtained.

4.2 Program Design for Acceleration Sensor Data Processing

In this study, Sensor data read three-axis data through the I2C communication module. In order to be compatible with the characteristics of portable disassembly and assembly and at the same time achieve simple and effective judgment and recognition, the average acceleration aave was used to reduce the complexity of the three-axis vector operation.

In order to filter out the occasional acceleration fluctuation, the average acceleration state Xt was processed by Kalman filter [10]:

$$ \left\{ \begin{gathered} \hat{X}_{t}^{ - } = A\hat{X}_{t - 1}^{{}} + Bu_{t - 1} \hfill \\ Z_{t} = H_{t} X_{t} + V_{t} \hfill \\ \end{gathered} \right. $$
(4)

The formula: Ht is the unit matrix, Vt is the measurement noise with mean 0 and variance R, ut−1 is discrete white noise with mean 0 and variance Q, \(\hat{X}_{t}^{ - }\) is the a priori estimation of time, Zt is the measured value of t-time.

From Eq. (4),

$$ P_{t}^{ - } = AP_{t - 1} A^{T} + Q $$
(5)
$$ K_{t} = P_{t}^{ - } H^{T} (HP_{t} H^{T} + R)^{ - 1} $$
(6)
$$ \hat{X}_{t} = \hat{X}_{t}^{ - } + K_{t} (Z_{t} + H\hat{X}_{t}^{ - } ) $$
(7)
$$ P_{t} = (I - K_{t} H)P_{t}^{ - } $$
(8)

The formula: \(\hat{X}_{t}\) is a posteriori estimate of t-time, Pt is a posteriori variance, \(P_{t}^{ - }\) is a priori variance, Kt is Kalman gain of t-time.

Through the analysis and processing of the posterior estimated value \(\hat{X}_{t}\), we can accurately judge whether the device is abnormal or not.

4.3 Program Design for Data Transmission Control

Data transmission was mainly based on the connection between the device and the server through the BG95 communication module, and the BG95 communication module connects to the network through 4G communication. The device SN number and IMEI number were used as the unique identification for the server to distinguish and register the device. Figure 6 shows the block diagram of the data transfer program.

Fig. 6.
figure 6

Block diagram of the data transmission program

4.4 Program Design for Web Data Processing

Web-side data processing was mainly operated by the webServlet class. Since the messages forwarded by the back-end server were mainly POST operations, the doPost() method was used in this class. The front-end web page used a JSP page and set up a form to determine that the parameter sleepTime that needed to be passed could be entered on the web page and then transferred to the background using submit().

In data processing at the back end, the Frameheader of the data string was used to determine the information category, verify it, and separate the registration, login, device information, logout, and other information categories. Figure 7 shows the block diagram of the web-side data processing flow.

Fig. 7.
figure 7

Data processing flow chart on web-side

5 System Testing

Through the tested of the device, after the device was powered on, it enters the work cycle of self-tested, uploaded data—dormant—awaken—self-tested, and uploaded data. Figure 8 shows the simulation results of GPS information processing. It could be seen that the processed positioned coordinates coincide with the actual coordinates. That was, the research device could read the positioned information more accurately.

Fig. 8.
figure 8

Result of GPS simulation

The Kalman filter processed the data collected by the acceleration sensor. Figure 9 shows the results of sensor data simulation. It could be seen that the filtered data could filter out most of the acceleration fluctuations, which was convenient for the device to identify the abnormal conditions.

Fig. 9.
figure 9

Sensor data simulation results

The data relating to the device's working time and timing wake-up time was obtained through the power consumption test. Table 1 shows the battery test data. The working days of the device in this study were proportional to the wake-up time interval, and the maximum working time could be up to 170 days.

Table 1. Battery test data

Through the above tests, this research device could be applied to all kinds of asset tracking.

6 Conclusion

Integrating the specificity, scalability, reliability, and power consumption of embedded systems, STM32 was used as the data processing core MCU, and other functional modules were used to design and implement an asset tracker device that automatically recognizes and reports abnormalities.

The main advantage of this design was that the device could automatically identify according to the surrounding environment and movement of the asset, display the relevant data on the web page, and support users to remotely modify the dormancy time of the device according to the situation—the data processing method of the accelerometer provides convenience for device installation. The GPS information processing method improves positioning accuracy without Wi-Fi and Bluetooth assistance. Acceleration sensor data and GPS information processing methods are not complex; STM32 could carry out related processing. The ultra-long life span enables the device to be used in all kinds of asset tracking.