Application of atmospheric pressure sensor TP015P in altitude measurement

Publisher:和谐相伴Latest update time:2012-07-04 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

O Introduction

For people who are in the wild, a question that they are more concerned about is the altitude of the place where they are. However, there are very few such products on the market, and generally only high-end products have this function. Although some mechanical altimeters are relatively cheap, their accuracy is too low. Therefore, it is urgent to develop an altimeter with high accuracy and low price to meet the needs of mass consumption. There are two common methods for measuring altitude. One is the GPS global positioning system; the other is to indirectly obtain the altitude by measuring the atmospheric pressure. The former method is more expensive and difficult, while the latter method has a wider range of device selection, so the cost can be minimized.

1. The overall design idea of ​​the multifunctional altitude meter

This paper adopts the method of measuring atmospheric pressure to indirectly obtain the altitude. The voltage signal representing the atmospheric pressure is obtained through the atmospheric pressure sensor . The signal is passed through the amplification circuit and the filtering circuit, and then A/D conversion is performed. The single-chip microcomputer, as the control unit of this system, mainly completes three functions: the first is to convert the data converted by MD to obtain the accurate value of the altitude; the second is to control the temperature sensor ; the third is to control the LCD display to display the accurate values ​​of the altitude and temperature on the LCD. The system principle block diagram is shown in Figure 1.

System Block Diagram

The theoretical basis of this article's altitude measurement is that the relationship between atmospheric pressure and altitude satisfies the Boltzmann formula:

Boltzmann formula

Among them, P is the atmospheric pressure at a height of Z, P0 is the atmospheric pressure at sea level, μ is the molar mass of air, R is the universal gas constant, and T is the temperature of the gas. In fact, the Boltzmann formula is derived under the assumption that T is a constant, but in actual situations. The temperature of the atmosphere has a certain relationship with the altitude. When calculating the altitude through the value of atmospheric pressure, the temperature factor must be considered, so certain compensation measures must be taken. This system uses temperature compensation and software methods to greatly reduce the influence of temperature on the measured value.

2 Hardware Circuit

2.1 Atmospheric pressure sensor and temperature compensation circuit

This instrument uses the TP015P atmospheric pressure sensor of APM Company, which has a measurement range of 0 to 100 kPa. The operating temperature range is -40℃ to 125℃, and the static accuracy is <±0.2%FS0. From the test results of the atmospheric pressure sensor at the same temperature, its output value is basically linear with the atmospheric pressure. However, in order to remove the error caused by temperature, temperature compensation must be added. Commonly used temperature compensation methods include adding diodes, transistors, thermistors and software compensation (such as neural networks, etc.). After measurement and calculation, this article uses NTC thermistors for temperature compensation, and its circuit is shown in Figure 2.

Circuit diagram

2.2 Amplification and filtering circuit

The operational amplifier used in this instrument is the AD620 instrument amplifier from the American AD company . The amplifier's amplification factor can be determined by the external resistor RG. The specific amplification factor calculation formula is as follows Magnification calculation formula . The core of AD620 is a three- circuit operation, and it has a high common-mode rejection ratio, good temperature stability, wide amplification bandwidth, small noise factor, and convenient adjustment. Since the output of the atmospheric pressure sensor TP015 is 10-150 mV, and the signal input range of the A/D chip MCP3221 is 0-3 V, the amplification factor of AD620 is set to about 30 times. The principle of its amplification and filtering circuit is shown in Figure 3.

Amplification and filtering circuit principle

2.3 A/D conversion circuit

The A/D circuit in this instrument uses the 12-bit low-power 模数转换\'); companyAdEvent.show(this,\'companyAdDiv\',[5,18])"> analog-to-digital converter MCP3221 from Microchip Technology. MCP3221 is a continuous approximation 12-bit successive approximation A/D converter . It uses a 2-wire serial and I2C compatible interface. MCP3221 uses a single power supply, so the circuit design can be simplified. The device can operate in a large voltage range (2.7-5.5 V). At the same time, it also has a sample-and-hold circuit and a self-timing conversion function on the chip. Its acquisition time and conversion can be timed by the internal clock. After each conversion, the result can be stored in a 12-bit register, and the A/D conversion value can be read according to the I2C bus timing. When MCP3221 uses fast conversion mode and the clock rate is 400 kHz, its maximum sampling rate can reach 22.3 ksps. In the hardware circuit, the power supply voltage of MCP3221 must have a small ripple and remain stable, so that the A/D error will be small. The SCL and SDA pins of MCP3221 need to be pulled up with 10 kΩ resistors before connecting to the microcontroller I/O. The interface circuit between MCP3221 and 8051 microcontroller is shown in Figure 4.

Interface circuit between MCP3221 and 8051 microcontroller

2.4 Temperature acquisition circuit

The temperature acquisition circuit of the altitude measuring instrument introduced in this article uses the one-line digital temperature sensor DS18B20 from Dallas Semiconductor. The digital temperature sensor DS1820 is the world's first temperature sensor that supports the "one-line bus" interface. It can use one signal line to realize bidirectional signal transmission, and has the advantages of simple interface, saving I/O port lines, and easy expansion and maintenance. The measurement temperature range of DS18B20 is -55~+125℃, and its accuracy is ±0.5℃ within the range of -10~+85℃. The field temperature is directly transmitted in the digital mode of "one-line bus", which greatly improves the anti-interference ability of the system and is suitable for field temperature measurement in harsh environments. The interface circuit of DS18B20 and single-chip microcomputer 8051 is shown in Figure 5.

Interface circuit between DS18B20 and single-chip microcomputer 8051

2.5 Display Circuit

The 1601 character LCD module used in this instrument has the characteristics of small size, low power consumption, rich display content, etc. The working voltage of this module is 5 V, and it has functions such as character contrast adjustment and backlight. The interface circuit between the 1601 module and the single-chip microcomputer is shown in Figure 6.

Interface circuit between 1601 module and single chip microcomputer

[page]

3 Software Design

The instrument workflow is to initialize the microcontroller, character LCD and DS18B20 first; second, start the temperature conversion, send the DS18B20 matching command, and read out the temperature values ​​collected by each DS18B20 one by one; third, start the A/D conversion, collect the voltage values ​​of 8 atmospheric pressures, and calculate the average value; fourth, use the conversion algorithm to convert the voltage value into the actual altitude, and fifth, use the LCD to display the temperature and altitude. The system software flow chart is shown in Figure 7.

System software flow chart

In the whole system software design, the programming technology of the one-wire bus and I2C bus will be involved. The read and write timing operation, search algorithm and matching algorithm of the one-wire bus are the most important parts of the system software. In the one-wire bus program, the key is the implementation of the bus initialization, read data and write data timing of the one-wire bus. The software system of this instrument involves the command words of DS18B20 including search command (OxF0), temperature conversion command (0x44), read temperature command (0xBE) and match command (0x55).

4 Product test results analysis

Because the Boltzmann formula is derived under the assumption that the atmospheric temperature is constant. The actual situation is that the atmospheric temperature is related to the altitude. Therefore, based on the actual measurement (two instrument tests), MATLAB software can be used to analyze the experimental data. The analysis results are shown in Figure 8, so that the actual correspondence between the sensor output value and the altitude can be found. At present, this product has been measured at four different altitudes on Longquan Mountain in Chengdu, Sichuan Province. The comparison between the measured altitude and the actual altitude is listed in Table 1.

Comparison of measured height and actual height

5 Conclusion

The digital altimeter can accurately measure the atmospheric pressure and correctly display the altitude and temperature in digital form. After a large number of field measurements, the correctness of the altitude and atmospheric pressure conversion algorithm and the accuracy of the instrument have been verified. The instrument can be widely used in field surveys, tourism and other civil fields, and has broad market prospects.

Reference address:Application of atmospheric pressure sensor TP015P in altitude measurement

Previous article:Design of factory information monitoring system based on cloud computing
Next article:Design of Hall Sensor Performance Test System Based on VB

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号