Multi-channel temperature and humidity sensor calibration system based on AVR microcontroller

Publisher:csZhouLatest update time:2011-09-21 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
With the operation of ground automatic weather stations, more than 1,500 large-scale automatic weather stations and regional automatic weather stations in Shandong Province have been built, which has greatly improved the business level of our province. With the increase in business volume, new requirements have been put forward for the measurement and verification capabilities. However, in recent years, the verification of temperature and humidity sensors has largely remained in the manual verification stage. This verification method is time-consuming and inefficient, so it is urgent to design a system for automatic verification of temperature and humidity sensors. In order to improve this situation, the automatic station temperature and humidity sensor data acquisition and processing system was developed using MSComm communication controls and database technology in the VC 6.0 environment to achieve batch data acquisition of 8-way temperature and humidity sensors to improve the verification efficiency and accuracy of temperature and humidity sensors.

1 Overall structure and functional description of the system
This design is based on AVR microcontrollers and high-precision A/D conversion chip ADS1232, which can calibrate temperature and humidity sensors. The temperature and humidity sensor is a temperature and humidity integrated sensor. The principle of temperature detection is to use PT100 to measure the temperature. In this way, it is necessary to convert the platinum resistance signal into a voltage signal to realize temperature acquisition. This design uses REF200 to stimulate a constant current of 200μA. The humidity outputs a voltage of 0~1V, corresponding to 0%~100% humidity. In order to achieve high-precision acquisition of temperature and humidity values. A high-precision 24-bit A/D converter ADS1232 is used here to achieve this. This design detects the signal output by the temperature and humidity sensor to achieve the calibration of this temperature and humidity sensor. The sensor output information read by the microcontroller is sent to the computer through the serial port for display. The system structure block diagram is shown in Figure 1.

a.jpg



2 Hardware Design
2.1 System Hardware Overview
The system hardware circuit consists of a single-chip microcomputer circuit, a constant current source excitation circuit, an 8-way selection circuit, a high-precision A/D conversion circuit ADS1232 circuit, a serial communication circuit, etc.
2.2 System Control Core
The system uses an ATmeGA16 single-chip microcomputer. This single-chip microcomputer is a low-power 8-bit RISC instruction set single-chip microcomputer with rich on-chip peripherals, built-in 512 B E2PROM, and strong I/O driving capability. It is particularly suitable for the control of low-power instruments and meters.
The single-chip microcomputer collects information about the temperature and humidity of the sensor through the high-precision A/D conversion chip ADS1232, and compares it with the standard value, and realizes the calibration of the sensor to be calibrated through comparison.
The core circuit of the single-chip microcomputer is shown in Figure 2. In order to achieve the synchronization of communication between the single-chip microcomputer and the PC, an external 7.372 8 MHz crystal oscillator is used as the main clock.

b.jpg


2.3 Constant current source excitation circuit
In this design, REF200 is used to generate a 200μA constant current source excitation to excite PT100 to generate a voltage signal. The constant current source chip REF200 has a high precision of single-channel output (100±0.5)μA and an extremely low temperature drift of ±25 ppm/℃. This feature makes REF200 very suitable for the detection of PT100 in this temperature and humidity sensor. The constant current source excitation circuit is shown in Figure 3.
2.4 Temperature and humidity 8-channel channel selection circuit The
temperature and humidity 8-channel channel selection circuit uses a channel digital control analog electronic switch CD4051 to achieve 1~8 selection. The output current signal of REF200 is connected to pin 3 of CD4051, and the I/O port of the single-chip microcomputer outputs a control signal to control the A, B, and C pins of 4051 to realize the selection of X and X0~X7 channels respectively, as shown in Figure 4. [page]

2.5 High-precision A/D conversion circuit
This design uses the 24-bit A/D conversion chip ADS1232 to convert the voltage signals output by temperature and humidity. ADS1232 has two acquisition channels, so an ADS1232 can achieve simultaneous conversion of temperature and humidity. Its peripheral circuit is shown in Figure 5. The voltage signals of temperature and humidity are connected to AINP1, AINN and AINP2, AINN2 respectively to realize voltage acquisition. In order to obtain a higher voltage reference, the design uses REF3133 as the A/D conversion voltage reference of ADS1232.

c.jpg



3 System Program Design
3.1 MCU Program Main Flowchart
The main flow chart of the system is shown in Figure 6. After power-on, the main program initializes the registers (sets the input/output mode of the I/O port used, external interrupt registers, serial communication protocol, etc.), and finally turns on the serial port receive interrupt enable. When entering the serial port interrupt, it determines the number of sensors currently being calibrated, and then collects the temperature and humidity values ​​of each channel in turn, and sends the collected values ​​to the PC through the serial port for display by the host computer software.

d.jpg


3.2 Main functions and implementation of the software system
The system mainly collects data from temperature and humidity sensors to calibrate them. The system structure is shown in Figure 7. The entire system was developed under the Visual C++ 6.0 environment. It uses serial communication technology to collect data in batches, uses database technology to store and query data in the SQL Server database, uses DataGrid controls, DataCombo controls, and ADO controls in VC to display data, query data, print calibration certificates, and verify certificates. VC calls Excel to output calibration data records. The verification flow chart is shown in Figure 8. [page]

3.3 Human-machine interface
3.3.1 Temperature and humidity sensor calibration interface
For ease of use and operation, Visual C++ designed the human-machine interface. Run the system and enter the main interface. The menu consists of file, test, query, and help. Click the test system to enter the temperature and humidity sensor test system. You can select different numbers of sensors (1 to 8) as needed. Fill in the test environment and temperature and humidity sensor information according to the test requirements, select and open the COM
port, and perform forward/reverse tests on 30%, 40%, 55%, 75%, and 95% from low to high and then from high to low, as shown in Figures 9 and 10.

f.jpg


3.3.2 Data Query
The query interface in this system consists of two parts: data query and test conclusion query. All data queries can be queried according to the sensor number or test date. Use two "Adodc" controls to provide data for the "DataCombo" control and the "DataGrid" control respectively. Use the SELECT statement to implement the query function. For example:
e.jpg
In the data query interface, you can export the data table to Excel and print the data.

4 Conclusion
This system is suitable for batch calibration of temperature and humidity sensors. It integrates data collection, data storage, and certificate printing. Compared with the calibration of temperature and humidity sensors in the laboratory through the automatic weather station collector, it has the advantages of convenient data storage, dynamic real-time data refresh, and automatic certificate printing, which greatly reduces the workload of calibration personnel and saves human resources.

Reference address:Multi-channel temperature and humidity sensor calibration system based on AVR microcontroller

Previous article:Design of high-precision electronic scale based on AVR microcontroller
Next article:Electric Scooter Controller Based on AVR Microcontroller

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号