Indoor formaldehyde testing system based on 51 single chip microcomputer

Publisher:beta13Latest update time:2011-10-06 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Formaldehyde is a colorless gas with a pungent odor. It is also a potential carcinogen that is harmful to human health. Many diseases are related to formaldehyde, such as asthma and leukemia. When the formaldehyde concentration reaches 0.06-0.07 mg/m3 per cubic meter of air, children will have mild asthma. When the formaldehyde content in indoor air is 0.1 mg/m3, there will be odor and discomfort. When it reaches 0.5 mg/m3, it can irritate the eyes and cause tears. Its harm to human health cannot be ignored. The single-chip microcomputer has outstanding advantages such as strong versatility, small size, low price, stability and reliability. It has been widely used in smart products, measurement and control systems and other fields. The tester designed in this paper can directly display the formaldehyde concentration value on site. When its concentration value is less than the standard value specified by the state (which can be modified by pressing the button), the green light is on and you can move in. When it exceeds the specified indoor living standard value, the red light starts to alarm and remind people not to move in temporarily.

1 Hardware Introduction

The indoor formaldehyde tester based on single-chip microcomputer consists of single-chip microcomputer system, display circuit, function keyboard, formaldehyde sensor, measurement circuit and 3.5-bit double integral A/D converter, alarm output circuit. The system structure is shown in Figure 1:

1.1 Measurement Circuit

The measurement circuit consists of a CH20/S-10 formaldehyde sensor, an I/U (current/voltage) converter RCV420 chip, a 5G14433A/D converter, etc., as shown in Figure 2.

The formaldehyde sensor consists of a formaldehyde probe and a CH20 sensor. When the air is absorbed by the internal sampling system, the generated current signal is connected to generate a current proportional to the formaldehyde concentration. The current is conditioned by the 4~20MA formaldehyde module and converted into a 0~5V voltage by the I/U converter RCV420 chip. The voltage is connected to the 8051 microcontroller through the 5G14433A/D converter, and the formaldehyde concentration value is displayed on the display. When it exceeds the national standard, an alarm is issued. The relevant parameters of CH20/S-10 are as follows: electrochemical working principle; range: 0-10PPM; maximum overload concentration: 50PPM; minimum resolution: ±0.05PPM; working life: 3 years; sensitivity: 1200±300nA/ppm, 4~20MA formaldehyde module; working temperature: -20~45, response time (T90): <50s.

The RCV420 precision I/U converter produced by Burr-Brown can convert 4~20mA loop current into 0~5V voltage output. As a monolithic integrated circuit, it has reliable performance and very low cost. In addition to the precision op amp and resistor network, it also integrates a 10V reference voltage source. Without the need for external adjustment, a common mode rejection ratio of 86dB and a common mode voltage input of 40V can be obtained. The input impedance has only a 1.5V voltage drop within the full range, and it has a good conversion capability for the loop current. The chip pin distribution and internal structure are shown in Figures 2 and 3.

During use, pins 10, 11 and 12 are connected, pins 2, 5 and 13 are connected to ground, and pins 14 and 15 are connected as the output end of the 0~5V voltage signal. When the gain needs to be adjusted, a potentiometer is connected between pins 14 and 15 to adjust the gain, but this will reduce the common-mode rejection ratio. The reduction is that the gain increases by 1%, and the common-mode rejection ratio will be reduced by 6dB. Therefore, when using it, we usually short-circuit pins 14 and 15 directly, leave pins 7 and 8 floating, connect a 1μF capacitor to ground on pins 4 and 16 respectively, and connect the input current signal to the IN+ or IN- terminal. Generally, only one end is used. The specific end to be used depends on the polarity of the input signal and the polarity of the required output voltage. During use, we use the IN+ terminal.


[page]

1.2 5G14433 A/D converter

The 5G14433A/D converter is the most popular and typical domestically produced dual-integral 3.5-bit A/D converter. It has good anti-interference performance, high conversion accuracy (equivalent to 11-bit binary numbers), automatic zero calibration, automatic polarity output, automatic range control signal output, dynamic word scanning BCD code output, single reference voltage, few external components, and low price. However, its conversion speed is slow, about 1 to 10 times/second in situations where high-speed conversion is not required. The pin parameters of the 5G14433 chip and its connection with the microcontroller are as follows:

VAG: The ground terminal (analog ground) of the measured voltage VX and the reference voltage VR.

VR: external input reference voltage (+2V or +200mv)

VX: Measured voltage input terminal.

R1, R1/C1, C1: External integration resistor and integration capacitor C1 component terminals, typical values ​​of external components:

When the range is 2V, C1=0.1μF, R1=470KΩ;

When the range is 200mV, C1=0.1μF, R1=27KΩ

C01, C02: External offset compensation capacitor C0 terminal, the typical value of C0 is 0.1μF.

DU: The input terminal for updating the output A/D conversion data result. When DU is connected to EOC, each A/D conversion result is updated.

CLKI and CLKO: The external resistor Rc of the clock oscillator. The typical value of Rc is 470kΩ, and the frequency decreases as Rc increases.

VEE: Negative power supply terminal of the analog part, connected to -5V

VSS: Low level reference (digital ground) for all output terminals except CLKO. When VSS is connected to VAGR (analog ground and digital ground are connected), the output voltage is VAG~VDD (0~+5V). When VSS is connected to VEE (-5V), the output voltage amplitude is VEE~VDD (-5~+5V), with an amplitude of 10V. In application, VSS is generally connected to VAG, that is, the analog ground and the digital ground are connected.

EOC: Conversion cycle end mark output. Whenever an A/D conversion cycle ends, the EOC terminal outputs a positive pulse with a width of half the clock cycle, and is connected to the P3.2 pin of the microcontroller together with DU.

DS1~DS4: Multiplex pulse output terminals, connected to the P1.4~P1.7 pins of the chip computer respectively. DS1 corresponds to the thousands place, and DS4 corresponds to the ones place.

Q0~Q3: BCD code data output lines, connected to the P1.0~P1.3 pins of the microcontroller respectively. Q0 is the lowest bit and Q3 is the highest bit. When DS2, DS3 and DS4 are selected, three complete BCD codes are output.

1.3 Function Keyboard

The keyboard is set as a 3*3 array keyboard, with function selection keys, alarm confirmation keys, enter (value confirmation) keys, value keys, keys, etc.

1.4 CD display unit

The CD display unit uses an OCM 4×16 character dot matrix LCD display module assembly, which mainly consists of an LCD display, a controller, a driver and a bias generating circuit. It is used to display the current measured temperature value, current output value, temperature alarm setting value, P setting value, TI setting value, TD setting value, deviation, alarm status and other information.

2 Software Design

The software adopts modular design. The whole software consists of main program, keyboard processing subroutine, data acquisition subroutine and alarm program. The main program is the core of control and management. After the system is powered on, it performs initialization and interrupt processing operations. Initialization mainly completes the setting and initial inspection of the alarm value, and disconnects the power supply of each electrical appliance. After the initialization is completed, the system starts to operate normally. Perform operations such as formaldehyde concentration detection and alarm. The flow chart of the main program is shown in Figure 3.

In order to improve the measurement accuracy, this paper adopts the median filter method, which is to sample the parameters N times (usually N is an odd number), and then sort the N sampling values ​​from large to small or from small to large in ascending or descending order, and then take the middle value as the current sampling value. Median filtering is more effective in removing fluctuations caused by accidental factors or errors caused by unstable sampling. As long as one of the N samplings is correct, the accuracy can be improved.

3 Conclusion

This paper makes a comprehensive description and analysis of the indoor formaldehyde concentration measurement using a single chip microcomputer. The formaldehyde concentration measurement system implemented in this paper has relatively comprehensive functions. The measurement system is easy to operate, cost-effective, reliable, and has high measurement accuracy. The system can also be appropriately modified according to specific needs.

Reference address:Indoor formaldehyde testing system based on 51 single chip microcomputer

Previous article:Using AT89C52 MCU as a multi-function peripheral device
Next article:Introduction to Keil C51 MCU Development Experience

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号