introduction
This article refers to the address: http://
With the rapid development of the market economy, automobile transportation has become an indispensable part of the transportation process. In order to obtain more economic benefits, many truck companies usually adopt a double-driver shift system, that is, drivers take turns to stop and ensure that the vehicle is always on the road. However, there are also some special circumstances, such as the highway closed in foggy weather. At this time, many drivers will choose to find a place to park and rest, while some criminals take the opportunity to use the driver to steal fuel from the fuel tank of the truck. It brings economic losses to the driver and can cause the vehicle to be short of fuel and unable to drive.
This paper designs a vehicle fuel monitoring and alarming system based on the Beidou positioning system. Its main function is to actively send alarm information to the transportation company or driver when the fuel in the fuel tank of the vehicle is stolen. To attract the attention of the driver. The Beidou positioning system can locate the current position of the vehicle and provide location inquiry and driving track query for the transportation company or the owner.
1 system composition
The structural block diagram of the vehicle fuel monitoring and alarm system is shown in Figure 1. The system is mainly composed of a power conversion circuit, an emergency alarm button, a Beidou positioning module, a fuel level sensor and an alarm. The power conversion circuit converts the power of the vehicle battery into the 5 V power supply required by the single chip microcomputer; the Beidou positioning module provides the positioning information and the traveling speed of the vehicle; the fuel level sensor is used to detect the change of the fuel tank liquid level; the vehicle alarm device is installed in the cab. The alarm device can send a warning signal to the driver; the GSM alarm sends an alarm message to the designated number after detecting the abnormality of the fuel tank level. In addition, during the running of the vehicle, the current positioning and traveling speed of the vehicle can be transmitted to the server via the GPRS network.

2 system hardware design
2.1 MCU selection and power circuit design
Both the Beidou positioning module and the GSM alarm module of the system require a serial interface, and the liquid level sensor of the vehicle usually adopts an analog interface, so the selected single chip microcomputer should have at least two serial ports and an on-chip A/D converter. In this system, the STC15F2K61S2 produced by Hongjing Technology Co., Ltd. is selected. The MCU has 10 8-channel A/D converters and two independent serial ports. It can program the internal Flash memory in the system and has strong anti-interference ability. Figure 2 is a schematic diagram of the microcontroller and power supply of the system.

In order to meet the needs of 12 V and 24 V batteries, this system uses LM2576-5.0 to design a wide voltage input power circuit, which can work normally in the 8 ~ 36 V supply voltage range, the output current is up to 3 A.
2.2 Beidou positioning module
Beidou positioning system is a new generation navigation positioning system independently developed by China. In this system, BD-126 Beidou/GPS dual-mode positioning chip is selected. The chip can be freely switched between Beidou positioning and GPS positioning mode, so as to ensure the reliability of positioning to the greatest extent. The external output signals are GGA statement, GSV statement and VTG statement. The default baud rate setting is "9600, N. , 8, 1". The circuit principle is shown in Figure 3.

2.3 Fuel tank liquid level monitoring circuit
The selected level sensor model is S3-E225, which converts the tank level to a resistance of 0 to 190 Ω. Therefore, it is only necessary to apply a constant current source to the sensor to convert the resistance signal into a voltage signal. Since the microcontroller is powered by 5 V, the output current I of the constant current source is
. Considering the current and cost of the constant current source, the fuel level monitoring circuit designed by LM317 is shown in Figure 4. In the figure, R11 is the liquid level sensor, R10=
, use R10=47 Ω.

2.4 GSM alarm design
The GSM alarm in the system has 3 tasks:
1 transmitting vehicle positioning information and driving speed information to a remote server through a GPRS network;
2 When the fuel tank position is abnormal, send an alarm message to the designated mobile phone and make a call;
3 When the emergency alarm button of the cab is pressed, call the alarm and send a location message.
Based on the need, the model of the GSM module is SIM900A. In the design, the serial port of the single chip microcomputer is connected with the module, and the operation of the short message and the telephone call is completed through the corresponding AT command. The schematic diagram of the SIM900A circuit is shown in Figure 5.

3 system software design
The system can be functionally divided into fuel tank fuel monitoring and alarm, vehicle position and speed monitoring, and emergency alarm. According to the function, the program is divided into main program, sending SMS and calling program, fuel monitoring program and interrupt program in emergency.
3.1 System main program
The main program of the system mainly completes the functions of fuel level monitoring, alarm after abnormality detection, vehicle position and speed receiving, and sending to the server at certain time intervals. The program flow is shown in Figure 6.

3.2 Send SMS and call the program
The MCU can send and receive text messages and make calls by sending AT commands to the GSM module through the serial port. The flow chart of sending SMS is shown in Figure 7.
Its C51 program is:


It should be noted that when calculating the total length of the PDU (ie, the total length of the transmitted content), the information header and the number of the received short message need to be included, and the two-digit hexadecimal code counts one bit length. Taking the above procedure as an example, the information sent to the mobile phone number 1506335 4891 is “the fuel tank liquid level abnormalityâ€, and the complete contents thereof include:
â—† 08 SMS center number length (bytes), including the second paragraph (91) and the third paragraph (7 bytes).
â—† 91 number type, 91 indicates the number with the national code, and China is 86.
â—† 683108501305F0 SMS center number is 13800531500.
The above information does not have to set the SMS center number every time when sending a text message, so it can be replaced with 00 in the transmission, and the byte does not count the length of the information in the CMGS instruction. The information below is what is included in the program.
11 The transmission parameters (TP-MTI/VFP) do not need to be changed.
00 Message reference value (TP-MR), does not change.
0D The length of the target mobile number, excluding 91, excluding the added F.
91 number type, 91 indicates the number with the national code, and China is 86.
685160334598F1 The target number is 86160335433891.
00 protocol identification, 00 indicates the normal GSM type, point-to-point mode.
08 Encoding used for information content, UCS2 (16-bit) encoding, (Unicode) format.
A7 SMS validity period, 00 means 5 minutes, A7 means 24 hours.
0C The length of the message, that is, the number of bytes of the following message content (one byte per two characters). The calculation formula is: number of words × 2.
6CB9 7BB1 6DB2 4F4D 5F02 5E38 SMS content (Unicode code).
3.3 Fuel monitoring procedures
The fuel in the fuel tank is monitored by means of timed sampling with a sampling interval of 30 s. When the difference between this sampling and the last sampled value exceeds the set limit, it can be considered that the use of fuel is abnormal. In order to prevent false alarms, the arithmetic mean filtering method is adopted in the system, that is, 32 samplings are continuously performed in 1 s, and then the average value is obtained, and the obtained average value is taken as the current liquid level value.
Conclusion
After debugging, the vehicle fuel monitoring and alarm system based on the Beidou positioning system has realized the functions of vehicle fuel monitoring, emergency alarm, vehicle positioning and driving status monitoring. At present, it has achieved good results in the application of large trucks. The actual test shows that the system works stably and reliably and has a good market prospect.
High Frequency Power Supply Transformer
EE 30 abb transformer,RM6 frequency transformer,ETD44 power transformer,EFD20 high frequency transformer
IHUA INDUSTRIES CO.,LTD. , https://www.ihua-coil.com