Gas detection instruments are used in a wide range of applications ranging from home air quality measurement devices to industrial solutions for detecting toxic gases. Many of these instruments use electrochemical gas sensors. This sensor technology requires specialized front-end circuitry for biasing and measurement.
By utilizing built-in diagnostics features (such as impedance spectroscopy or bias voltage pulsing and ramping) it is possible to inspect sensor health, compensate for accuracy drift due to aging or temperature, and estimate the remaining lifetime of the sensor right at the edge of the sensor network without user intervention. This functionality allows smart, accurate sensor replacement at the individual edge nodes. An integrated, ultra low power microcontroller directly biases the electrochemical gas sensor and runs onboard diagnostic algorithms.
The CN0429 circuit shows how an electrochemical gas sensor is connected to the potentiostat circuit and how it is biased and measured. Common 2-lead, 3-lead, and 4-lead electrochemical gas sensors can be used interchangeably. The integration of this signal chain dramatically reduces cost, size, complexity, and power consumption at the sensor node.
Following are the boards used:
To set up the circuit for evaluation, consider the following steps:
The CN0429 is compatible with electrochemical gas sensors in “4-series” form factor. 2-, 3- and 4-electrode sensors are supported. See the drawing below for form factor dimensions.
The CN0429 gas sensor daughter board includes IDT HS3002 temperature & humidity sensor. This sensor is connected to a virtual I2C bus of the ADuCM355 microcontroller. Temperature and humidity values could be used to implement compensation techniques for an electrochemical gas sensors. For more information about how to obtain sensor data, please refer to the Software section.
Connector P1 is used for interfacing with the CN0429 board. It is used to provide power to the board and also to communicate with it using I2C, SPI or UART interfaces. There is also one GPIO available, which can be used as an interrupt input to wake-up the ADuCM355 or provide any other interrupt function.
P1 connector pinout
The connector used on the CN0429 board is Samtec SFM-107-02-L-D. The mating connector for it is either TFM-107-02-L-D (surface mount) or TFM-107-01-L-D (through hole).
There as two switches present on the EVAL-M355–ARDZ–INT board, namely switches S1 and S2.
There are 5 switches present on the EVAL–ADICUP3029 board, namely switches S1, S2, S3, S4 and S5.
The ADICUP3029 board must be programmed with a gas sensing application firmware. The source code for this firmware is open-source and can be downloaded here. The project contains a compiled firmware binary file, which can be downloaded directly onto the ADICUP3029 board. The user does not have to install any IDE to get started with the system. However, if any modifications to the firmware are needed, the installation of an IDE will be required.
To download the binary file onto the ADICUP3029 board, follow this procedure:
The EVAL-CN0429-EBZ board and EVAL–ADICUP3029 board come with a pre-installed base code. The user needs to install a serial terminal software on their PC to communicate with the board. The recommended software is PuTTY which is easily available over the internet for free installation. Once PuTTY is installed, user needs to go to the Device Manager terminal through the Start option in Windows. The Device Manager terminal opens as follows:
The user is then advised to plug in the EVAL–ADICUP3029 board into the PC using the USB cable that goes into the USB port. As soon as the board is detected by the PC, the Device Manager displays the board and the port it is connected to.
The new options that appear in the Device Manager window, as shown in the picture above, shows that the PC has detected the EVAL–ADICUP3029 board. The user is then advised to note the port number of the USB Serial Device (COM5 as seen above). With a right click on the USB Serial Device (COM5), the user can then access the properties of the board connected. Note the speed shown here is 115200.
Once these steps have been followed, the user can now to start the PuTTY application and enter certain values in the configuration window. The three important settings that needs to be defined in the configuration window are the Session settings, the Terminal settings and the Serial settings. In the Session window, the speed should be set at 115200 and the serial line is the port number taken from Device manager (COM5 in our case).
The user can save these settings by a particular name (we call it WaterQual_ADICUP3029) and load them whenever needed. Other important configurations include the terminal settings and the connection serial settings. They should be set as follows before launching the Putty application:
Once all the configurations have been defined, launch the PuTTY terminal by selecting the 'Open' option. After the PuTTY terminal launches, write 'help' ane press Enter to see the different commands in the PuTTY terminal for various gas measurements. See the Command Line Interface section for more details.
In this section, step by step instructions are provided to configure the system and the sensor for correct operation. It is recommended to always use this procedure.
Preparing the system
The EVAL-CN0429-EBZ boards come pre-programmed and pre-configured. Sensor configuration needs to be modified according to the datasheet of the sensor used. Refer to the Sensor Configuration section for more details.
The Eval-CN0429-EBZ board comes with a pre-loaded base code. However if the user wishes to modify the firmware for custom measurements, they need to download and install IAR ARM 8.30.2 (or above) workbench. Along with this the user also needs to download the ADuCM355 support package, cut traces for the Serial Wire Debug (SWD) line and use the included cable to connect the debugger to the shield board.
The CN0429 reference design is controlled using a command line interface. Any serial port terminal application can be used, e.g. Putty, TeraTerm. Configure the COM port to 115200/8N1 (115200 baud, 8 data bits, no parity bit and 1 stop bit). Once the system is programmed and connected to the PC, connect to it using the serial terminal application of your preference. The system is automatically initialized upon power-up and will print initialization report (example below).
Note: The gas sensor daughter boards require ~10 seconds to calibrate and start up properly. It is recommended that ~10 seconds after power is applied to the system, the RESET button S1 is pressed on the ADICUP3029 board to ensure proper initialization of the system.
The following table lists all available commands for the CN0429. Some of the commands are global – meaning they are applicable to all detected sensors at once. Others require user to first select a sensor and the command will then be used for the selected sensor only.
|help||Print command set help.||GLOBAL|
|defaultsensor <site>||<site> = 1 – 4||Select sensor site used by local commands.|
|sensorsconnected||Print list of detected sensors.|
|readconfigs||Read configuration of all sensors.|
|readsensors||Read sensor data of all sensors.|
|setupdaterate <time>||<time> = 1 – 3600||Set update rate for “readsensors” in seconds. Default = 1.|
|stopread||Stop sensor data reading.|
|readtemp||Read temperature from the on-board temperature sensor.||LOCAL Sensor site needs to be selected prior to using these commands|
|readhum||Read humidity from the on-board humidity sensor.|
|setmeastime <time>||<time> = 50 - 32000||Set ADC sampling time in milliseconds. The ADC performs average of 10 samples at configured interval Default = 500.|
|startmeas||Start ADC sampling at configured interval.|
|stopmeas||Stop ADC sampling the sensor.|
|setrtia <rtia>||<rtia> = 0 - 26||Select internal RTIA resistor to set TIA gain.|
|setrload <rload>||<rload> = 0 - 7||Select internal RLOAD resistor for the sensor.|
|setvbias <vbias>||<vbias> = -1100 – 1100||Set bias voltage of the sensor in mV.|
|setsensitivity <sens>||<sens> = nA/ppm||Set sensor sensitivity in nA/ppm.|
|runeis||Run Electrochemical Impedance Spectroscopy test (EIS).|
|readeis||Read results of EIS test.|
|readeisfull||Read full set of results of EIS test, including all impedances and magnitudes.|
|readrcal||Read value of internal 200R calibration resistor.|
|runpulse||Run the pulse test. Amplitude and Duration need to be set first!|
|readpulse||Read results of the pulse test.|
|pulseamplitude <ampl>||<ampl> = 1 – 3||Pulse test amplitude in mV (typically 1 mV).|
|pulseduration <dur>||<dur> = 1 - 199||Pulse test duration in milliseconds. Must be less than 200 msec.|
To be able to use any local command, a sensor needs to be selected first. Use following command to list all available (detected) sensors.
Afterwards, select the desired sensor, for example using:
This command selects the sensor site. When using local commands, these apply to the selected site only. When no sensor site is selected, or there is no sensor connected at the selected site, an ERROR message will be displayed when trying to execute a local command.
The ADuCM355 firmware comes with pre-programmed default gas sensor configuration. In order for the sensor to work correctly, this configuration needs to be changed according to the sensor specification which can be found in the sensor datasheet. Following configuration parameters need to be set using the command line interface:
Note: Select the correct sensor site prior to using any of the following commands.
Bias voltage is the voltage applied between RE and WE (SE) electrode of the gas sensor. Its value can be found in the sensor datasheet.
Example: setting bias voltage to 20 mV
Sensor sensitivity value is used to calculate the gas concentration from the measured current produced by the sensor. If the sensor datasheet only states a range of currents instead of an exact value, please contact the sensor manufacturer and ask for more accurate value.
Example: setting setsensitivity to 73 nA/ppm
The RTIA resistor value should be selected so that it maximizes the ADC input range of ±900 mV. The RTIA value is calculated using following equation:
0.9 V is ADC input range,
Sensitivity is defined as nA/ppm and
Max_Range is the sensor’s maximum range in ppm.
From the table below, select the closest lower value to the calculated RTIA value.
Example - CO sensor:
Sensitivity = 73 nA/ppm
Max_Range = 500 ppm
Closest lower value to 24.7 kΩ is 24 kΩ, i.e. <rtia> = 12.
The load resistor value can be obtained from the sensor datasheet. If there is no exact match between the datasheet value and table below, select the closest value.
Example - CO sensor:
Datasheet value is 47 Ω. The closest available value is 50 Ω:
The EC sensor is sampled by the ADC with a certain time period, at which it performs an average of 10 samples, each 2.2 ms long. Default value of this time period is 500 ms, but can be configured to in the range of 50 - 32 000 ms.
Example: setting measurement period to 1000 ms
Once the configuration has been performed, use the readconfigs command to verify that configuration is complete. This command reads configuration of all detected sensors.
Once all the sensors are configured, sensor data can be obtained. Temperature and humidity data from on-board sensor can be read one value at a time with dedicated commands. Gas data are read as a continuous stream with configurable update rate.
This local command instructs the ADC of selected sensor to start sampling the sensor at the time interval configured by the setmeastime command.
Note: It is not needed to run this command as a part of sensor initialization. ADC sampling starts automatically, default value of 500 ms is used.
This local command instructs the ADC of selected sensor to stop sampling the sensor.
Use this global command to start reading gas sensor data from all sensors.
The data is read back as a continuous stream in a following format:
Data stream can be stopped at any time using the stopread command.
The update rate of the data stream is configurable in the range of 1 – 3600 seconds. Stop the data stream before using this command.
Example: setting update rate to 5 seconds
This local command prints temperature value from the temperature & humidity sensor on gas sensor daughter board.
This local command prints humidity value from the temperature & humidity sensor on gas sensor daughter board.
This reference design supports two diagnostics measurements of electrochemical sensors:
The EIS test is a diagnostics method where sensor impedance is measured at various frequencies of AC signal injected into the electrochemical sensor itself. The default set of frequencies supported by the sensor daughter board firmware is:
1kHz, 5kHz, 10kHz, 20kHz, 30kHz, 40kHz, 50kHz, 60kHz, 70kHz, 90kHz, 160kHz and 200kHz.
Note: It is possible to add additional frequencies to the EIS test. However, this has to be accounted for in both gas sensor daughter board firmware and ADICUP3029 firmware.
The test is executed by following these steps:
The results of the EIS test are in a format shown below. The values are comma delimited to enable importing the data to Microsoft Excel or similar tool for further processing.
Bode magnitude and Bode phase values are printed for every measured frequency.
To obtain full set of results including all magnitudes and impedances, use the following command:
This diagnostics method can be used, for example, to detect open circuit, i.e. unplugged sensor. This proved to be a common issue with some portable instruments which can fall on the ground and sensor can disconnect from its socket.
The principle of this test is applying small voltage pulse (typically 1 mV for <200 ms) to the sensor electrodes and measuring the current response to this pulse.
Test execution procedure follows these steps:
Example: setting pulse amplitude to 1 mV
Example: setting pulse duration to 100 ms