Home >color lcd display module > Based on 51 single-chip test system for indoor formaldehyde
Based on 51 single-chip test system for indoor formaldehyde
2011-12-09 by seoer1

5G14433A / D converter is made of the most widely popular classic double points three and a half A / D converter which has anti-jamming performance, high-precision conversion (equivalent to 11-bit binary number), automatic zero, auto-pole of output, automatic range control signal output, dynamic word-bit BCD code output scan, a single reference voltage, external components, low price and so on. But the conversion is slow, about 1 to 10 times / second does not require high-speed conversion in the occasion. 5G14433 chip microcontroller pin parameters and their connection with the following:

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

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

VX: the measured voltage input.

R1, R1/C1, C1: external integral resistor and capacitor C1 component side, typical external components:

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

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

C01, C02: external side offset compensation capacitor C0, C0 is typically 0.1μF.

DU: Updated output of A / D conversion result data input. When a DU connection with the EOC, each A / D conversion results have been updated.

CLKI and CLKO: clock oscillator external resistor Rc side, Rc is typically 470kΩ, the frequency with Rc increases.

VEE: the analog part of the negative power supply terminal, then-5V

VSS: In addition to all but end CLKO low base output (digital ground). When the VSS connected VAGR analog and digital ground connected), the output voltage degree VAG ~ VDD (0 ~ +5 V): When the VSS connected VEE (-5V), the output voltage range of VEE ~ VDD (-5 ~ +5 V ), 10V amplitude. VSS application is generally connected VAG, that is connected to analog ground and digital ground.

EOC: end marker output conversion cycle. Whenever an A / D conversion cycle, EOC-ended output with a width of one-half clock cycle, the positive pulse width, then the microcontroller together with DU P3.2 pin.

DS1 ~ DS4: multi-strobe output, respectively, then power on-chip machine P1.4 ~ P1.7 pin. DS1 corresponds to one thousand, DS4 corresponding bits.

Q0 ~ Q3: BCD code data output line, respectively, then the microcontroller P1.0 ~ P1.3 pin. Where Q0 is the lowest bit, Q3 is highest. When DS2, DS3 and DS4 strobe period, the output of three full BCD.

1.3 Keyboard

Keyboard is set to 3 * 3 array keyboard, a function selection key, the alarm confirmation key, a carriage return (value confirmed) keys, numeric keys, keys, etc.

1.4 CD display unit

CD display unit use OCM 4 × 16 character dot matrix Color LCD module components, the main LCD display panels, controller, drive and bias generator circuit, used to display the current measured temperature value, the current output value, temperature alarm set value, P setting, TI setting, TD setting, deviation, alarm status and other information.

2 Software Design

Software is modular in design. All software is the main program, keyboard handling routines, data acquisition subroutine, alarm program components. Main program is to control and manage the core. The power-on initialization and interrupt handling. Initialization to complete the main alarm set value and the initial inspection, and disconnect all electrical power. After initialization, the system began to operate normally. The formaldehyde concentration detection and alarm operation, the main program flow chart shown in Figure 3.

In order to improve the measurement accuracy, we use median filtering method is the continuous sampling parameters N times (typically N is odd), then the value of N samples from small to big to small or large, in ascending or descending order, then take the median value for this sample. Median filter for removing causal factors of instability caused by fluctuations or sampling error resulting from more effective, in the N samples in time as long as there is right, you can improve accuracy.

3 Conclusion

In this paper, using MCU measuring indoor formaldehyde concentration was more comprehensive description and analysis of the concentration of formaldehyde in this paper to achieve a more comprehensive measurement system functions. The measuring system easy to operate, suitable for cost-effective, reliable operation, high accuracy, but also according to the specific needs of the system to be modified.

  keywords:color lcd display module