This article describes an intelligent instrument that supports the measurement, display and remote transmission of laboratory temperature and humidity. This instrument is different from many similar products on the market. It can well meet the requirements of high precision, high resolution and network transmission on site.
lHardware design of temperature and humidity display instrument
The hardware circuit of this instrument mainly consists of independent power supply circuits for temperature and humidity channels, temperature and humidity sampling circuits, signal conditioning circuits, analog-to-digital conversion circuits, photoelectric isolation circuits, and processors using AT89S52 single-chip microcomputers . It also has LED display circuits, communication circuits, keyboard circuits, etc. Its structure is shown in Figure 1. The following will introduce the circuits of each part accordingly.
1.1 Temperature and humidity transmitter
The non-electrical temperature and humidity signals are converted into 4-20 mA electrical signals through the transmitter. This solution uses the high-performance temperature and humidity integrated transmitter EE10-FT6 from E+E of Austria.
EE10-FT6 Product Features:
(1) 24 V DC power supply;
(2) Temperature range: 0~50℃; Humidity range: 0~100%;
(3) Temperature accuracy: ±0.1°C; Humidity accuracy: 1.0%;
(4) Input impedance: ≤500 Ω;
(5) Wiring method: three wires (positive terminal of power supply, temperature output line, humidity output line).
1.2 Isolation Measurement Technology
Conventional temperature and humidity measurements often use a common ground for temperature and humidity signals and a set of measurement circuits.
The display instrument (front end) is then connected in series with the DDC (direct digital controller) back end to form a transmitter circuit. The transmitter power is provided by the DDC. Therefore, the two common ground signals output by the transmitter need to be isolated and measured at the front end to eliminate the impact on the back end measurement. That is, the two ends are connected in series and a pair of common ground signals are measured simultaneously. For analog isolation measurement, the author has considered 3 sets of solutions:
Solution 1 is "virtual" isolation, which uses differential measurement technology to ground one end of the differential through an appropriate resistor. This solution has the lowest cost, but it has very strict requirements on the op amp and is not very stable.
Solution 2 uses linear optocoupler isolation, but linear optocouplers are difficult to debug, have large discreteness, require many peripheral components (operational amplifiers ) , and still require an isolated power supply at the front end of the optocoupler and an analog-to-digital converter at the back end.
Solution 3 uses two sets of independent measurement circuits, which are then interfaced with the processor through ordinary optocouplers. It requires two sets of isolated power supplies and two sets of measurement parts, which is slightly more expensive. However, this solution is the most reliable and easy to debug, so it was eventually adopted, as shown in Figure 2.
1.3 4~20 mA current measurement
The sampling resistor uses a 125Ω/0.1% precision resistor, so that only 0.5~2.5V voltage signal needs to be measured.
1.4 Amplifier and ADC Application
The analog signal conversion of this temperature and humidity display instrument adopts TI's rail-to-rail operational amplifier TLC2252. The biggest features of this amplifier are that the output can reach the full range of the power supply, and the offset voltage is small, 0.5 mV, and the price is low, which is suitable for this instrument application. [page]
The analog-to-digital converter (ADC) uses TI's ADS1286U, the main performance of this chip is:
(1) Resolution: 12 bits;
(2) Maximum sampling frequency: 20 kHz;
(3) INL: ±2LSB/max;
(4)DNL: ±1LSB/max;
(5) Interface mode: two-wire
(6) Reference voltage: external.
1.5 Resolution and Accuracy
The requirements that this instrument needs to meet are: in terms of resolution, the temperature display should be 0.01℃, and the humidity display should be 0.1%; in terms of accuracy, the absolute error between the DDC measurement value of the automatic control system should not be greater than ±0.03℃. Such stringent requirements require that the instrument must be very well done in terms of both software and hardware.
1.6 Digital Filtering Technology
In order to meet the above requirements of resolution and accuracy, in addition to selecting cost-effective components and high PCB board technology in hardware, a lot of work has been done in software. Because the temperature and humidity physical quantities are inertial links, the time constant is large and the value will not change suddenly, so the filtering time can be very long. This instrument adopts the method of multiple measurements, sorting and taking the median value and then performing first-order inertial filtering. The mathematical expression is as follows:
Among them, Xn-1 is the actual temperature and humidity value of the last time; Xn-2 is the median value obtained after sorting this time; Xn is the current temperature and humidity value; A is the filtering time constant, which serves as a coefficient.
The purpose of doing this is to prevent certain measurement mutations and to meet the measurement of inertial physical quantities so that the measured values do not jump frequently and can meet the needs.
1.7 Network Communication Technology
This instrument uses RS 485 communication, the communication protocol is MODBUS-RTU, and then communicates with Siemens DDC through MODBUS-PROFIBUS gateway, the baud rate is 38.4 kb/s. The bus adopts polling mode, and the background machine collects the temperature and humidity of each room as the basis for centralized monitoring of room temperature and humidity.
1.8 Precision calibration and parameters
This instrument has been calibrated before leaving the factory, but considering that after long-term operation, the aging of components and changes in ambient temperature may cause the instrument to have accuracy deviation, the instrument is equipped with an accuracy calibration function. During calibration, a standard 4-20 mA signal meter is required. According to the display prompts, adjust the signal source to each gear, and then the instrument will automatically calibrate, and the calibration coefficient value will be stored in the non-volatile memory.
This instrument has the function of on-site manual adjustment. Adjusting the potentiometer knob can make the temperature and humidity more accurate within a short range.
All parameter settings can be operated through the network or instrument buttons and will not be lost in the event of power failure.
2. Software Design of Temperature and Humidity Display Instrument
The main programs include: temperature measurement subroutine, humidity measurement subroutine, keyboard scanning and implementation subroutine, calibration subroutine, among which the measurement subroutine is embedded with analog-to-digital conversion, data processing, forming display data, etc.; the keyboard scanning and implementation subroutine is embedded with display page switching, parameter setting, calibration confirmation, etc.; the calibration subroutine is embedded with dual-channel switching calibration and calibration value storage, etc. The interrupt service program includes: timer interrupt (for display) subroutine, communication interrupt subroutine. The main program is executed in a loop in sequence, integrating external operations (keyboard) to realize multiple functions of the instrument; the interrupt service program can interrupt the execution of the main program at any time, and the two do not affect each other.
The analog-to-digital conversion is the key in this instrument. In addition to ensuring good signal processing in hardware, software processing is very important. The access program of the analog-to-digital converter ADS1286 is given below. The timing logic on the DATASHEET of this chip is only a basic process. To obtain reliable values, it is necessary to explore during debugging. This program is debugged by the author and the effect is good.
Note: The 12-bit AD value converted by this subroutine is stored in 02H/03H.
Note: This interrupt service program is a MODBUS slave response program. This instrument only uses MODBUS function codes 03 and 06, namely analog telemetry and parameter setting.
3 Conclusion
This instrument has been successfully applied in 400 laboratories of Shanghai Testing Center and is currently operating well. The absolute error between it and DDC does not exceed ±0.03℃.
Previous article:Quartz crystal sheet sorting system based on image processing
Next article:Digital pointer thermometer designed and debugged based on single chip microcomputer
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- A novice asks for advice on the MSP430 interrupt flag PxIFG
- ST MEMS sensor official Chinese technical documentation summary (continuously updated)
- What is 5G Super Uplink?
- Outsourcing of small brushless sensor driver
- Single-ended forward converter
- Bootloader issue of CH579
- SPI to USB CDC
- Battery Pack SOC
- Strange phenomenon of screen display and USB!
- 【Portable programmable instrument】Begin preparation for debugging