Design and Application of Modular Transportation Status Monitoring System

In this paper, combined with the actual engineering, a modular transportation status monitoring system is designed, which can be used to measure environmental conditions such as vibration, inclination, temperature and humidity during the process of transportation. The system consists of a main control module, a storage module, a data acquisition module, a real-time clock module, a power management module and an alarm module. The design scheme has high development efficiency and strong practicability. The measurement device used in the experiment for environmental monitoring during transportation process performs well, and can be a typical application case of innovative practice teaching


Introduction
With the continuous improvement of my country's transportation efficiency,logistics transportation has generally penetrated into people's daily life. Especially in the industrial field, transportation is the most critical link of logistics distribution. Due to the possibility of various accidents in the process of transportation, various unpredictable consequences may occur. The design and development of a special system that can monitor the status information during transportation will play an active role in the guarantee and supervision of the transportation process. On the one hand, this device can provide reliable basis for the analysis of logistics accidents, on the other hand, it can provide reference information for improving the management mechanism of logistics transportation.

Overall scheme design of transportation monitoring system
The transportation condition monitoring system is mainly composed of main control module, storage module, data acquisition module, real-time clock module, power management module, and alarm module. And the data acquisition module is mainly composed of a threedimensional acceleration acquisition unit, an inclination acquisition unit, and a temperature and humidity acquisition unit [1][2][3] . The overall design scheme is shown in Figure 1. The main control module is the core of the monitoring system, which is used to coordinate the various modules to complete the data collection of the surrounding environmental, storage and alarm functions. The main function of the storage module is to store various environmental data information collected by the data collection modul. And it also has the functions of automatically updating, storing and generating data files, which is convenient for data analysis after the transportation task.
The data acquisition module is mainly composed of a three-dimensional acceleration acquisition unit, an inclination acquisition unit and a temperature and humidity acquisition unit, which is used to monitor environmental information during transportation and provide traceable raw data for subsequent data analysis; The real-time clock module is responsible for providing E3S Web of Conferences 233, 04035 (2021) IAECST 2020 https://doi.org/10.1051/e3sconf/202123304035 the time reference to generating time information, and can provide timing function for the timer interruption of data acquisition; The power management module is mainly responsible for providing power for the entire monitoring device, and the battery voltage is converted to the working voltage which is required by each chip in the circuit; The main function of the alarm module is to remind the surrounding personnel whether the surrounding environment is abnormal. The alarm module will immediately alarm to remind the surrounding personnel to check or adjust if an abnormal situation occurs.
3 Hardware design of transportation monitoring system

The design of the main control circuit
The main control chip, STM32F103VET6, is the 32-bit microcontroller developed by the company of STMicroelectronics. The STM32F1 series chip has the characteristics of high integration, strong timeliness, low power consumption and low development cost [4,5] .The chip architecture is shown in Figure 2.
In the transportation monitoring equipment, the main function of this chip is to coordinate other module chips, complete data exchange between each other, and realize the normal operation of the entire monitoring equipment.

The design of three-dimensional vibration acquisition circuit
The three-dimensional vibration sensor adopts a MEMS accelerometer (ADXL372) with small volume, which has ultra-low power consumption and very wide measurement range (±200g).The power consumption of vibration sensor is only 22 ȝA when the sampling frequency is 3200Hz. In addition, ADXL372 removes the cycle function of the front-end power for avoiding the risk of aliasing output.In addition to ultra-low power consumption, ADXL372 can also perform impact detection. The sensor has multiple condition monitoring modes and can also capture the peak data of impact events by setting thresholds. The threedimensional vibration sensor uses the Linked Mode for data acquisition during transportation. In this mode, activity and inactivity detection are interlinked so that only one function can be activated at any time. Once the transportation activity is detected as moving, the search for the activity item is stopped and the inactive item is treated as the next event. When the static transport state is detected, the expected activity will be the next event. In the link mode, each interrupt must be handled by the host processor before the next interrupt can be enabled. The operation process of this mode is shown in Figure 3.

Design of acquisition circuit for three-axis angle sensor
The three-axis angle sensor adopts the L3GD20H, which is a low-power angle sensor and includes a sensing element and an IC interface. The interface can provide the measured angle to the outside through the digital interface. The sensor element is manufactured using the special processing technology developed by STMicroelectronics, which can produce inertial sensors and actuators on silicon wafer. The IC interface is manufactured using CMOS technology, which can better match the characteristics of sensor elements by designing special circuit. The full scale of L3GD20H is ±245/±500/±2000dps, and it can measure rate with the bandwidth selected by the user. The chip is packaged with plastic land grid array(LGA), which can work in the temperature range from -40 ႏ to +85 ႏ. The sensor has the characteristics of fast start and wake up mode, 16 bit rate data output, and its working voltage is 2.2V to 3.8V. The users can interact with the data through the serial data communication interface SPI or IIC. The L3GD20H is embedded with thirty-two 16-bit data FIFO slots in each of the three output channels of yaw angle, pitch angle and roll angle. The main processor can wake up according to the actual situation and export data from FIFO, which can save the system power consumption. The diagram of acquisition circuit is shown in Figure 4.

Design of acquisition circuit for temperature and humidity sensor
HTS221 is an ultra-compact sensor for relative humidity and temperature, which includes a sensing element and a mixed signal ASIC to provide measurement information through a digital serial interface. The sensor element is composed of a polymer dielectric planar capacitor structure which can detect the change of corresponding humidity and manufactured by a special STMicroelectronics process. HTS221 adopts HLGA package, which can work in the temperature range of -40ႏ to +120ႏ. Hts221, which includes built-in 16bit ADC, is designed with low power consumption and adopts IIC and three-wire SPI communication protocol. The relevant parameters of HTS221 are shown in Table 1. While the data output rate of 1HZ is selected, the sensor realizes a collection every 1 minute by enabling the basic timer interrupt because there is no sudden change in temperature and humidity and the requirement of sampling frequency is not high. The sensor uses IIC communication protocol to interact with the main control unit.The acquisition circuit is shown in Figure 5.

Storage module circuit design
The storage module is composed of internal FLASH and SD card storage. Due to the huge amount of data that needs to be stored for a long-distance transportation, the internal flash memory (W25Q64 8MB) of the STM32 is far from enough and an external SD card is required. The 32GB Kingston SD card is used to store vibration, angular velocity and temperature and humidity data during transportation. The main control unit can read and write the SD card through SPI interface or SDIO interface. In the process of transportation, the amount of data collected is huge and the requirement of timeliness is high, so the SDIO interface is selected as the communication interface. The SDIO communication protocol has a greater advantage over SPI in transmission speed. The maximum FOD clock frequency is 400Hz in the identification card phase and the maximum frequency of the data transmission mode can reach 50MHz. The SD card acquisition circuit is shown in Figure 6.

Circuit design of alarm module
The alarm module selects the piezoelectric patch buzzer YP9020A01 as the alarm chip of the transportation monitoring device. When the environmental parameters such as temperature and humidity, acceleration and inclination angle exceed the threshold value in the transportation process, the alarm module can notify the transportation personnel to make timely adjustments for ensuring the safety of the transported goods. The alarm module circuit is shown in Figure 6.

Circuit design of real-time clock module
The real-time clock circuit module selects H8563, which is a low-power CMOS RTC clock chip.All data are transmitted through the IIC bus,and the transmission rate can reach 400kbits/s.The chip integrates an oscillation capacitor and a power-down detector, whose current can be as low as 0.25ȝA in low sleep mode. The RTC realtime clock is essentially a timer which continues to run after power failure,so it provides reference time with an external power supply.It realize the timestamp function by using the real-time time data as the file name,which records the time of the data stored in the file. The circuit design of real-time clock module is shown in Figure 7.

Circuit design of power management module
The power management module is the basis to ensure the stable operation of the whole system and meet the requirement of low power consumption. The dual low voltage regulator LP5996 is selected as the power management chip to provide relatively stable voltage for the three-dimensional acceleration sensor, the three-axis angular velocity sensor, the temperature and humidity sensor and the main control chip. The power management circuit is shown in Figure 8. The final design and development of the transport monitoring equipment is shown in Figure 9. The device is mainly used for monitoring environmental parameters during vehicle transportation, which is specifically installed in the packaging sensitive area or the inside wall of the packing box. In the process of transportation, the device can sense the impact, inclined load and environmental temperature and humidity because it is rigidly connected with the transported goods or the packing box and its working environment is the same as the transported good. The program development software uses Keil MDK V5, which is an integrated development tool for ARM microcontroller with Cortex-M core. The program development is based on the stm32 standard function library, which is an API function interface developed by ST to configure quickly the low-level registers. It has the advantages of fast program development, easy reading, easy operation and low maintenance cost. The STM32 standard function library is the code between the bottom register and user driver layer, which provides API interfaces for users upward and directly configures registers downward. The users only need to understand the purpose of the function and configuration methods, which reduces the programmer's development burden. Because of the rich development board peripheral resources, it will inevitably cause increased workload and complexity, slow speed of development, poor program readability and complex maintenance by configuring directly registers. Compared with the development of direct configuration registers, the development method of library functions has increased the amount of code, but STM32 has abundant resources. The modular programming development method of library function can greatly improve the development efficiency if the requirements of runtime are not extremely demanding. Therefore, the program development method based on STM32 library function is selected in the article.

Development of the main program of the transportation monitoring system
In the process of program development, the main program is programmed with C language and the library functions of the sensor components are written for calling by the main program. The program state transition function of the monitoring system is shown in Figure 10.  Fig. 11. Program state transition diagram of monitoring device It will first enter the initialization state after the transportation monitoring equipment is powered on. The equipment will enter the ready state and initialize the relevant hardware through the import of configuration parameters and initialization of clock. The equipment will enter the respective working program to perform the next operation if the initialization is successful. Otherwise, the equipment will enter the standby state and the program will be interrupted. Then the program needs to be checked and further debugged. The environmental data acquisition hardware will enter the work mode to collect data of transportation environment and cooperate with the main E3S Web of Conferences 233, 04035 (2021) IAECST 2020 https://doi.org/10.1051/e3sconf/202123304035 processor to switch the work mode and transmit data after the initialization of equipment is successful. Meanwhile, the file system cooperates with the main processor to store the data in the storage program.

Modular program design of transport monitoring system
The normal operation of monitoring equipment requires the cooperation of hardware foundation and software program, which is divided into the following functional modules.

Program initialization
It initializes the clock as the time reference of the trigger and the basic timer to enable the time interruption. When the interrupt is triggered, the temperature and humidity sensor can collect data every user-set time. The LED port is initialized to be used as the identification of state transition and the alarm light. The serial communication is initialized to debug the program and set the relevant parameters by the upper computer. The three-dimensional acceleration sensor, the three-axis angular velocity sensor and the temperature and humidity sensor are initialized to enter the respective data acquisition program.

Acquisition program of environmental parameter
After initializing the three-dimensional acceleration sensor, it will enter the link mode and enable activity and inactivity detection to realize the motion sensing function of the device. The low-power design should be considered for the long-distance and long-time transportation process. The sleep wake-up function is added to the program to detect the movement with very low power consumption because the huge amount of data need to be collected by the three-dimensional acceleration sensor and the realtime acquisition is required. When the transportation stops and the inactive event is detected, the power supply of the part of the system can be turned off. And the sensor can enter the measurement mode to perform real-time data acquisition until the transportation resumes and the continuous activity event is detected.
After initializing the three-axis angular velocity sensor, it will enter the stream mode. The real-time data collected by the sensor is first stored in FIFO so that the main processor doesn't need to poll the angular velocity value all the time, and the main processor can read all the data in the FIFO at one time for reducing the resource consumption of the processor after the data overflow.
The data of temperature and humidity can be collected every one minute to reduce memory consumption in the program and stored in the SD card because the change of temperature and humidity is slow and the necessity of realtime acquisition is small.

Data storage program
The file system is mount on the external SPI Flash so that the SD card can manage the stored data and complete the initialization of the SPI device at the same time. Each kind of data is generated into a file every 7M and the data of the same day is saved in a folder by programming, which provides the data basis for the subsequent evaluation of transportation process based on condition monitoring.

Power management program
The system initializes the relevant pins of LP5996 to conduct parameter configuration and enters the power monitoring mode to ensure the stable operation of the system and realize the requirement of low power consumption.

Application analysis of transportation monitoring system
The developed monitoring system was installed on a longdistance vehicle transporting CNC machine tools in order to verify the actual effect of the developed transportation monitoring system. During the transportation process,the actual environmental signal data was collected for safety analysis of transportation and evaluation of transportation vehicles, including acceleration, roll angle, temperature and humidity signal data. As shown in Figure 11, the local time-domain signals of acceleration, roll angle, temperature and humidity collected by the system are shown in the figure 11, which shows the system can stably and reliably monitor the environmental conditions in the process of vehicle transportation and achieve the expected design purpose.

Conclusion
Aiming at the transportation monitoring system, this paper proposes a modular design scheme combining software and hardware and conducts experimental testing and analysis. The application results show that the designed E3S Web of Conferences 233, 04035 (2021) IAECST 2020 https://doi.org/10.1051/e3sconf/202123304035 transportation monitoring system has the advantages of modularity, small volume,easy disassembly and assembly, easy operation, stable and reliable measured signal data, which can provide a reference for the monitoring and evaluation research of the transportation process. At the same time, the relevant technologies in this paper are applied to the innovative practice teaching of undergraduate and graduate students in the way of open innovation experiment, which can exercise engineering practice skills of students and achieve good teaching effects.