Design ideas of infrared detection system based on CAN bus interface

Publisher:ZhenxiangLatest update time:2013-05-21 Source: dzsc 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.


  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.



  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:


  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 with temperature T as the independent variable (n


  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



  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.

[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.



  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.

References:

[1]. MSP430 datasheet http://www.dzsc.com/datasheet/MSP430_490166.html.
[2]. MSP430F449 datasheet http://www.dzsc.com/datasheet/MSP430F449_html.
[3]. SJA1000 datasheet http://www.dzsc.com/datasheet/SJA1000_609075.html.
[4]. TJA1050 datasheet http://www.dzsc.com/datasheet/TJA1050_649182.html.
[5]. RS232 datasheet http://www.dzsc.com/datasheet/RS232_585128.html.
[6]. RS485 datasheet http://www.dzsc.com/datasheet/RS485_585289.html.

Reference address:Design ideas of infrared detection system based on CAN bus interface

Previous article:Design of ultra-low altitude distributed multi-sensor detection node
Next article:Design of Wireless M-Bus Communication System Based on Si1000

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号