Design Microcontroller Software for Data Processing of Infrared Gas Sensors

The recommended minimum requirements of the microcontroller software for controlling and processing the data provided by SGX Sensortech infrared gas sensors to obtain the concentration of target gas are discussed in this article. Figure 1 shows a flow diagram of the layout of the microcontroller software.

Figure 1. Flow diagram of software layout

Start-Up Routine

The start-up routine involves the following actions:

  • Lamp Interrupt Timer Setup for the control of lamp toggling and acquisition of detector voltages at a lamp pulse frequency of 4Hz. It is necessary to generate an interrupt every 125ms to get the lamp pulse frequency of 4Hz.
  • Loading of non-volatile memory data.
  • “Warm-up” timer is set to provide time for stabilization of the sensor subsequent to power-up; however, the output is not set relative to the estimated target gas concentrations.
  • All ports are set to the prescribed default settings identified by the software engineer.

The system can be maintained in the idle condition until the occurrence of a lamp interrupt (4Hz).

ADC Measurement Routine

The minimum and maximum signals arise from the detector after some time in response to the changes in the status of the lamp (Figure 2). At these signals, the ADC measurements have to be taken.

Flow diagram of software layout

Figure 2. Measurements in relation to the lamp drive voltage

Averaging Routine

Averaging the temperature readings and the values of the amplified detector signals must be performed separately to further lower cycle-to-cycle noise. To perform this digitally, the maximum and minimum A-D converted values of the outputs of the reference and active detectors are roll averaged. A 16-fold rolling average is adequate for the removal of most of the noise, without impinging on the sensors’ response time.

Superior low signal resolution may be obtained with higher averaging, but the response time will increase. Taking an average number of readings around the minimum and maximum signals is a better approach as there is no change in the response time. A software engineer will determine the amount of averaging based on the response time and stability.

Zero Calibration Routine

The zero calibration sequence starts when the user presses the “zero” switch on the hardware, exposing the sensors to a gas void of the target gas for a prescribed time. After triggering the sequence, the calibration zero is calculated and the temperature is recorded in Kelvin. The non-volatile memory is used to store both reading for all subsequent computations to estimate the concentration of the target gas.

Span Calibration Routine

The span calibration sequence is triggered when the user presses the “span” switch on the hardware, exposing the sensors to the target gas of predetermined concentration for a specific time. After triggering the sequence, the calibration span is calculated and the reading is saved in the non-volatile memory for all subsequent computations to estimate the concentration of the target gas.

DAC Update Routine

The DAC update routine is entered to get an update of the output signal pertaining to the concentration of the target gas. This routine must only be entered after the completion of the warm-up period because the output is typically set to a default value relative to zero concentration of the target gas during the start-up routine to prevent triggering any alarm during this period. Software engineers will determine the frequency of the DAC update. Updates of up to one second are considered as normal.

About SGX Sensortech (IS)

SGX Sensortech is a market leader in innovative sensor and detector devices that offer unrivalled performance, robustness and cost- effectiveness.

SGX have been designing and manufacturing gas sensors for use in industrial applications for over 50 years, offering excellent applications support for an extensive range of gas sensors and the expert capability for custom design or own label.

As an independent OEM supplier of gas sensors, we pride ourselves on providing customers with unrivalled product reliability and personal product support via specialist engineers.

SGX gas sensors are built to the highest standards with all pellistor and infrared gas sensors achieving ATEX and IECEx certification, SGX gas sensors are also UL and CSA approved.

Our product portfolio has continued to expand in technology and detectable gases used in a wide range of applications including:-

  • Mining
  • Oil and gas
  • Confined space entry
  • Indoor air quality
  • Industrial area protection
  • Leak detection

This information has been sourced, reviewed and adapted from materials provided by SGX Sensortech (IS) Ltd.

For more information on this source, please visit SGX Sensortech (IS) Ltd.

Ask A Question

Do you have a question you'd like to ask regarding this article?

Leave your feedback
Submit