Design of a Portable Carbon Dioxide Monitor Based on STM32

The detection methods of CO2 concentration are roughly divided into chemical methods and physical methods. CO2 concentration detection methods include titration method, thermal catalysis method, gas-sensing method, and electrochemical method. These belong to chemical methods. These methods generally have problems such as high price, poor universality, and low measurement accuracy. The physical methods include ultrasonic method, gas chromatography and many methods to achieve detection by means of optics. There are also chemical and physical methods like photoacoustic spectroscopy. The basis of absorption spectroscopy is that gas molecules of different chemical structures absorb radiation of different wavelengths differently, and CO2 gas molecules have strong absorption of infrared light of specific wavelengths.

The detection methods of CO2 concentration are roughly divided into chemical methods and physical methods. CO2 concentration detection methods include titration method, thermal catalysis method, gas-sensing method, and electrochemical method. These belong to chemical methods. These methods generally have problems such as high price, poor universality, and low measurement accuracy. The physical methods include ultrasonic method, gas chromatography and many methods to achieve detection by means of optics. There are also chemical and physical methods like photoacoustic spectroscopy. The basis of absorption spectroscopy is that gas molecules of different chemical structures absorb radiation of different wavelengths differently, and CO2 gas molecules have strong absorption of infrared light of specific wavelengths.

At present, various CO2 sensors for detection mainly include solid electrolyte type, barium titanate composite oxide capacitive type, conductance change type thick film type, etc. These sensors have poor selectivity to gas, are prone to false alarms, require frequent calibration, use Short lifespan, etc. The infrared absorption CO2 sensor has the characteristics of wide measurement range, high sensitivity, fast response time, good selectivity, and strong anti-interference ability. Therefore, this design uses an infrared absorption CO2 sensor.

1 Sensing principle

The infrared absorption type CO2 gas sensor is based on the principle that the absorption spectrum of gas varies with different substances. Different gas molecules have different chemical structures, and absorb different wavelengths of infrared radiation differently. Therefore, when infrared radiation of different wavelengths is irradiated to the sample material in turn, the radiation of certain wavelengths can be selectively absorbed by the sample material and become weaker, resulting in infrared radiation. Therefore, when the infrared absorption spectrum of a certain substance is known, the absorption peak of the substance in the infrared region can be obtained from it.

When the same substance has different concentrations, there are different absorption intensities at the same absorption peak position, and the absorption intensity is proportional to the concentration. Therefore, by detecting the effect of the gas on the wavelength and intensity of light, the concentration of the gas can be determined.

According to Beer-Lambert’s law, the relationship between the output light luminous intensity I, the input light luminous intensity I0 and the gas concentration c is

I=I0exp(-αmLc) (1)

In the formula: αm is the molar absorption coefficient; c is the concentration of the gas to be measured; L is the action length (sensing length) of light and gas. Transforming formula (1), we get:

Design of a Portable Carbon Dioxide Monitor Based on STM32

2 Instrument Design Block Diagram

The digital signal output by the front-end sensor communicates with STM32 by serial port. The instrument is designed for three-channel acquisition, and the sensor channel is selected by the relay circuit. The STM32 displays the concentration value on the LCD screen, which has a touch function. By writing LCD Display interface, call related key programs, select sensor channels and save as U disk data and other functions. The block diagram is shown in Figure 1.

Design of a Portable Carbon Dioxide Monitor Based on STM32

3 Sensor selection

The premier carbon dioxide sensor from DYNAMENT was selected. This sensor uses the principle of non-dispersive infrared to detect gas. It includes a long-life tungsten infrared light source, an optical channel for diffusing gas to enter, a pair of temperature-compensated infrared principle thermoelectric exchange detection elements, and semiconductor temperature. The sensor and the Electronic circuit processing the signal of the infrared thermoelectric exchange detector are convenient and quick to use.

Design of a Portable Carbon Dioxide Monitor Based on STM32

4 Hardware circuit design

The instrument is designed to collect carbon dioxide sensors with 3 channels, and select the on-off of the sensor through 3 relays. Figure 3 shows the relay control circuit.

Design of a Portable Carbon Dioxide Monitor Based on STM32

Using low-power microcontroller STM32F103RE, the core is: ARM 32-bitCortex-M3 CPU, the size is: 10mmx10 mm, with 4 serial ports, in the design of this instrument, 3 serial ports are used, one communicates with the sensor, and the other communicates with the sensor. The LCD communicates and one communicates with the USB storage module. Figure 4 shows the minimum system of the controller.

Design of a Portable Carbon Dioxide Monitor Based on STM32

Select the LCD of Diwen Technology Co., Ltd., the model is DMT32240C035_02W, the basic parameters are: 3.5 inches, M100 core, 65K color serial LCD human-machine interface. This LCD has a touch function. When designing the system, there is no need to add a button circuit. You only need to write the LCD button program to realize the button function, and simply realize the functions of parameter setting, data saving, gear switching and so on.

5 Software Design

After the instrument is turned on, enter the LCD program interface, select the sensor channel, enter the data acquisition program, Display the current carbon dioxide concentration value on the LCD screen, and click the save button on the LCD display interface to save the current carbon dioxide concentration value. The overall design process of the instrument software is shown in Figure 5.

Design of a Portable Carbon Dioxide Monitor Based on STM32

Design of a Portable Carbon Dioxide Monitor Based on STM32

6 Indoor experiments

The indoor test experiment was carried out using the assembled portable carbon dioxide monitor. Table 1 shows the test data of carbon dioxide concentration in the same environment for 3 channels, and each channel was tested 10 times. From the test data, the test data of each channel is relatively stable. And it is close to the theoretical concentration of carbon dioxide in the air.

Design of a Portable Carbon Dioxide Monitor Based on STM32

7 Conclusion

The development of this instrument is mainly for carbon dioxide storage projects, monitoring carbon dioxide leakage, for the situation that the concentration range of the leaked carbon dioxide is indeterminate, the instrument has designed three channels, and tested the data acquisition of the three channels through experiments, and the test results Indicates that the instrument is operating normally.

The Links:   HSD150SX82-A 7MBP100NA060