Design of CO infrared detection system based on CAN bus and MSP430

Publisher:平和的心态Latest update time:2010-03-16 Source: 电子设计工程Keywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

Carbon monoxide (CO) is a highly toxic gas. When inhaled by humans, it causes hypoxia in human tissues and cells, leading to poisoning and suffocation. In coal mines, CO is also one of the main gases that cause gas explosions. CO causes huge damage to both industrial production and humans. Therefore, CO detection is particularly important, especially in coal mines. The Coal Mine Safety Regulations stipulate that the CO concentration in underground workplaces should be controlled below 0.002 4%. Therefore, real-time and accurate measurement of underground CO gas concentration is of great significance to ensuring safe production in the coal mine industry.

At present, the main methods for detecting CO include chemical method, electrochemical method, gas chromatography, etc. These methods generally have problems such as high price, poor universality, and low measurement accuracy. Here, a new detection system is designed, which uses infrared CO sensor and MSP430 single-chip microcomputer as the core signal processing circuit, combined with digital filtering and temperature compensation operation. It has the advantages of wide detection concentration range and long service life. The CAN bus has the characteristics of long communication distance and high reliability. By expanding the CAN bus interface, the detector has remote communication capability, which can be easily connected with the monitoring center, effectively reducing the accident rate, and has promotion and application value.

2 System composition and hardware design

The system consists of an infrared CO gas sensor, an MSP430 single-chip microcomputer, a CAN bus interface, and a remote monitoring system. The system processes the detected data, controls the LCD display, and the sound and light alarms through the single-chip microcomputer at the detection site. It is also equipped with a CAN bus controller, which can easily obtain relevant information such as concentration, temperature, and alarm records, realizing intelligent industrial site and remote simultaneous monitoring functions. The system block diagram is shown in Figure 1.

System block diagram

2.1 Principle and selection of sensors

Each substance has a specific absorption spectrum (for example, CO gas has a very strong absorption peak at a wavelength of 4.5 μm), and this characteristic can be used for measurement. The concentration of the gas can be determined based on the changes in the absorption peaks at certain specific wavelengths on the spectrum curves of various gases. When infrared light passes through the gas to be measured, these gas molecules absorb infrared light of a specific wavelength, and the absorption law follows the Lambert-Beer law.

formula

Where, I is the energy of the transmitted light, L/mol·cm; Io is the energy of infrared radiation absorbed by the gas, L/mol·cm; K is a constant related to the gas and the wavelength of radiation, L/mol·cm; C is the concentration of the measured gas, mol/L; L is the thickness of the gas layer through which the radiation passes, cm.

From formula (1), we can know that by detecting the radiation intensity of infrared radiation after being absorbed by the gas, the concentration of the measured gas can be calculated. Using SM-C0 H/M sensor, this series of analog output CO adopts double-beam non-dispersive infrared (NDIR) detection technology. It has the advantages of anti-interference from other gases, simple maintenance, good stability, built-in temperature compensation, Modbus ASCII protocol digital output and analog output. It is suitable for leak alarm, on-site construction protection, simple gas analysis, online monitoring, industrial process analysis and other occasions. [page]

2.2 Working principle and data processing of MSP430 microcontroller

The MSP430 microcontroller is an ultra-low power Flash 16-bit microcontroller produced by Texas Instruments (TI). According to the system functions and peripheral circuit interface requirements, the MSP430F449 microcontroller is selected. The microcontroller has rich internal hardware resources; the built-in temperature sensor is used to detect the ambient temperature and compensate the data detected by the infrared sensor; its built-in A/D converter is used to convert the analog quantity output by the sensor into a digital quantity; through the hardware multiplier, high-speed digital filtering and temperature compensation operations are performed on the measured A/D sampling data. The digital filtering method adopts the extreme value average filtering method. In situations where pulse interference is more serious, if the general average method is used, the interference will be averaged into the result, and it is not easy to eliminate the error caused by the interference. First, the IV sampling values ​​are arranged in order of size, and the "bubble sort method" is used to remove the maximum and minimum values ​​of the N data, and then the average value of (N-2) data is calculated, which is the extreme value average filtering method. The processing method of temperature compensation; when the static characteristics of the sensor are linear, the characteristics before temperature compensation can be expressed as:

formula

Where x is the input of the sensor, y is the output, Y is the intercept of the characteristic curve on the y-axis (i.e., the output gain caused by ambient temperature), and k is the proportional coefficient.

The steps of the temperature compensation formula method are as follows:

(1) Given (m+1) temperature values: T0, T1, T2, ..., Tn, ..., Tm, measure the intercepts Y0, Y1, Y2, ..., Yn, ...Ym of the static characteristic curve of the sensor on the y-axis at each temperature;

(2) Express Y as an nth-order algebraic polynomial (n

formula

Determine a0, a1, a2, …an using the least squares curve fitting method.

(3) When measuring each y value and the corresponding T value, first calculate the Y value, and then find the x value

formula

The use of digital filtering and temperature compensation algorithms can make the measurement more accurate and minimize the impact of ambient temperature.

2.3 Buttons, LCD display and alarm system

The buttons are used to set parameters such as system time, sound and light alarm values, and corresponding CAN bus communication addresses. If there are fewer buttons, one port corresponds to one button, and a capture interrupt is used. If there are more buttons, a row-column keyboard can be used to save port resources. The LCD display uses the LSD12864CT display module, which consists of a set of row drive signals IC3 and two sets of column drive signals IC2 (controlling the left half screen) and IC1 (controlling the right half screen). Its display dot matrix is ​​128x64 and can display graphics or Chinese characters. It integrates the interface of row and column drivers and display buffer RAM. At the same time, the hardware can set the structure of the display screen, data transmission mode, length and width of the display window, etc. The MSP430F449 has a built-in 60 KB Flash to record the time when the infrared measurement data exceeds the limit and the corresponding setting value, and save the relevant parameters of the CAN interface. When the CO concentration exceeds the set range, the sound and light alarm device reminds the underground staff.

2.4 CAN bus interface design

The CAN interface of this system consists of an independent CAN bus controller SJA1000 and a CAN data transceiver TJA1050. SJA1000 is an independent CAN controller, mainly used for mobile targets and regional network control in general industrial environments. AD0-AD7 of SJA1000 is connected to the P2 port of MSP430, and P3.4 and P3.5 control the read and write operations of SJA1000 respectively. MSP430 initializes SJA1000 and realizes data transmission and reception by controlling SJA1000. TJA1050 is the interface between the controller area network (CAN) protocol controller and the physical bus, and is a standard high-speed CAN transceiver. TJA1050 can provide differential transmission function for the bus and differential reception function for the CAN controller SJA1000. TJA1050 provides a CAN node interface to realize the transmission of CAN bus data. CANH and CANL are connected to the external CAN bus network. The connection circuit of MSP430, SJA1000 and TJA1050 is shown in Figure 2.

MSP430 [page]

3 System Software Design

After the system is powered on and reset, it is first initialized, mainly including system hardware initialization and reading CAN related parameters from MSP430 Flash and setting them; then the system performs key scanning: if a key is pressed, the corresponding operation is performed, such as setting the time and CO alarm concentration value, modifying CAN parameters, and checking alarm records; if no key is pressed, the CO concentration is collected and software processing is performed. The software processing includes digital filtering and temperature compensation to calibrate the concentration data. If the CO concentration exceeds the limit, the sound and light alarm will notify the underground staff and record the alarm time and alarm value in the memory. If the concentration is normal, the detection is cyclically detected and displayed. The system software flow is shown in Figure 3. The remote transmission of gas concentration data is completed by the CAN bus interface. When the host computer sends a message to the station, that is, when the station is required to transmit data, the system will transmit data to the host computer, which can reduce the burden on the microcontroller and reduce power consumption. Therefore, the CAN communication program flow is roughly as follows: when the detector receives a valid message, a receiving interrupt is generated. In the interrupt service subroutine, the C0 concentration data is sent in the form of a CAN message, and the message is sent in a non-interrupt manner. The specific workflow is shown in Figure 4.

System software process

The host computer uses a visual operation interface written in Delphi under Windows. Delphi is an event-driven, object-oriented visual high-level programming language. The communication software design of the system uses Delphi7.0. Among the many serial communication controls available in Delphi, the SPComm control is the simplest and most powerful one. This control has a wealth of properties and events closely related to serial port communication, and provides various operations on the serial port. Through the design of Delphi, the current time and gas concentration can be intuitively displayed in the host computer. Remote operations can also be performed through serial port communication. The sampling timer can be used to refresh the displayed data at regular intervals, so as to detect data changes in a timely manner.

4 Conclusion

Infrared optical sensors are used to replace traditional sensors. Safety is greatly improved; combined with CAN bus technology, it replaces traditional RS232 and RS485, greatly reducing the difficulty of system development and shortening the development cycle. Compared with other field buses, CAN bus has the characteristics of high communication rate, easy implementation, and high cost performance. TI's MSP430 microcontroller is used, which has more integrated peripherals, reduces the difficulty of development, and has ultra-low power consumption. It is conducive to energy saving.

The designed infrared CO detection system has a wide range of gas concentration detection and good equipment maintainability. The measurement precision is greatly improved by utilizing the low power consumption characteristics of MSP430F449 and its internally integrated A/D converter, multiplier, temperature sensor and other hardware resources. Through the CAN bus interface, the system can not only display real-time data on site, but also realize the long-distance, high-reliability communication function and remote monitoring of the instrument. Therefore, the system has a good application prospect.

Keywords:MSP430 Reference address:Design of CO infrared detection system based on CAN bus and MSP430

Previous article:Analysis of the complete solution of relay protection based on Blackfin processor
Next article:Design and implementation of full attitude stabilization control system for micro UAV

Recommended ReadingLatest update time:2024-11-16 22:52

MSP430 system clock
1. Clock source types LFXT1CLK low-frequency clock source - each MSP430 device has XT2CLK high-frequency clock source——available in X13X, X14X, X15X, X16X, X43X, X44X, etc. DCOCLK digitally controlled RC oscillator 2. Clock Source Description ACLK auxiliary clock: ACLK is obtained by dividing the LFXT1CLK (l
[Microcontroller]
MSP430 system clock
Ultra-low power 27MHz wireless mouse solution based on MSP430F1222
  The MSP430 series microcontrollers promoted by T1 are widely used in high-performance, low-power interface devices, such as wireless mice and keyboards. The wireless mouse solution introduced in this article uses the MSP430Fl222 MCU as the controller, the ultra-low-power ADNS-3040 light sensor from Avago Technologie
[Microcontroller]
Ultra-low power 27MHz wireless mouse solution based on MSP430F1222
Application of MSP430x09x series MCU in electric shavers
MSP430x09x is the industry's first true 0.9V microcontroller (MCU) launched by TI. Its appearance makes it possible to use a single battery to power portable devices, and will promote the development of single-cell powered, smaller and lower-cost portable products. Unlike existing MCUs that claim to be 0.9V technology,
[Microcontroller]
Application of MSP430x09x series MCU in electric shavers
Design of Wireless Sensor Network Based on MSP430
Design of Wireless Sensor Network Based on MSP430 introduction   Sensor testing technology is developing towards multifunctionality, miniaturization, intelligence, networking and wireless. As an emerging technology, self-organizing wireless sensor networks (Self Organizing Wireless Sensor Networks) are currently a
[Analog Electronics]
Design of Wireless Sensor Network Based on MSP430
MSP430 Learning - ADC12
          The ADC12 module of MSP430F2417 is more powerful and therefore more complex.           ADC12 has 8 analog input channels A0~A7, which share the same pins as the general IO ports P6.0~P6.7. Therefore, if you want to use a certain analog channel, you must first define the pin function, which is done by setti
[Microcontroller]
Definition of standard registers and bits of MSP430 MCU
1. Standard bit definition (STANDARD BITS)  :   WORD: word 15                  14                                                                                                          7                                                                        1                            0    
[Microcontroller]
RS232 interface program for msp430f449
#include "MSP430x44x.h"  void init_UART(void);  void uart_start(void);  void uart_send(void);  void uart_receive(void);  unsigned char RXDATA_BUF ,TXDATA_BUF ={0xbd,0x77,0x3d,0xc5,0xc6,0xf5,0x68,0x0d,0x6b,0xff};  unsigned int RX_count=0,TX_count=0,TXBUF_num=10,RXBUT_num=10,FLAG;  void main(void)  { init_uart();    
[Microcontroller]
Application of MSP430F in ETC
TI's MSP430 microcontroller product series has a 16-bit RSIC architecture and ultra-low power consumption. As the latest product series of MSP430, F5xxx uses 0.18um process for the first time, and the current consumed by 1MIPs is as low as an astonishing 160uA, and the main frequency reaches 25MIPs. At the same time
[Industrial Control]
Application of MSP430F in ETC
Latest Industrial Control Articles
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号