The CN0396_example is a dual toxic gas detector demo project, for the Arduino Uno base board with additional EVAL-CN0396-ARDZ shield, created using the Arduino IDE.
The CN0396_example project uses the EVAL-CN0396-ARDZ shield which is a single-supply, low noise, portable gas detector, using a 4-electrode electrochemical sensor, for simultaneous detection of two distinct gases - for this example is used the Alphasense COH-A2 sensor, which detects carbon monoxide(CO) and hydrogen sulfide(H2S).
The EVAL-CN0396-ARDZ board provides a potentiostatic circuit for biasing the electrochemical sensor, along with dual programmable TIA's and 16-bit Sigma-Delta ADC. The TIA's convert the small currents passing in the sensor to a voltage that can be read by the AD7798 a 3-channel, low noise, low power 16-bit ADC that converts the analog voltage into digital data. The 16-bit ADC outputs are received via SPI interface of the EVAL-ADICUP360 board. An ADT7310 digital temperature sensor is also included to measure ambient temperature in order for correction of temperature effects.
The CN0396_example application reads temperature value from ADT7310 and ADC values for each gas channel (CO and H2S), processes the values and make all necessary conversions in order to provide the gas concentrations. A UART interface (9600 baud rate and 8-bits data length) is used to send the results to terminal window. The output data will be displayed continuously considering a data refresh parameter (see DISPLAY_REFRESH).
Based on the maximum sensor sensitivity for each gas the system should be configured before using it. The application will calculate the gas concentration using sensor gas sensitivity and then compensate these values using measured temperature value.
The following is a list of items needed in order to replicate this demo.
The source code and include files of the CN0396_example can be found here:
The Arduino Sketch is used to open the example into Arduino IDE. The project is composed of three main parts:
Configure the ADC gain value in CN0396.h file.
#define ADC_GAIN AD7798_GAIN_1
Configure the ADC samples/second value in the CN0396.h file.
#define ADC_SPS 0x05 //50SPS
Set the refres time in the CN0396.h file. This is how often to display output values on terminal.(in ms)
#define DISPLAY_REFRESH 500 //[msec]
Set CO range for the sensor in the CN0396.h file.
#define MAX_CO_SENS (100 * pow(10, -9)) #define CO_SENS (75 * pow(10, -9)) /* Sensitivity nA/ppm CO 50 to 100 */ #define CO_RANGE 1000 /* Range ppm CO limit of performance warranty 1,000 */
Set H2S range for the sensor in the CN0396.h file.
#define MAX_H2S_SENS (1000 * pow(10, -9)) #define H2S_SENS (800 * pow(10, -9)) /* Sensitivity nA/ppm H2S 450 to 900 */ #define H2S_RANGE 200 /* Range ppm H2S limit of performance warranty 200 */
These two steps can also be done using the quick buttons on the Arduino sketch. Check out the image below for locations of the quick buttons.
Data is output using the USB cable from the Arduino to the PC. The USB port acts as a serial terminal to display the data being transmitted via UART. Opening the serial terminal window from the Arduino IDE is very easy, simply click on the button shown in the picture below.
You may need to configure the serial terminal depending on the current settings of the Arduino IDE. Make sure the settings are as follows:
Select COM Port Baud rate: 9600 Data: 8 bit Parity: none Stop: 1 bit Flow Control: none
The Arduino tools are easy to use, and there are many tutorials and users guides to help learn how to use the Arduino IDE.
For more information on how to use the tool basics, please check out the Arduino tutorials page.
To download the Arduino tools, check out the Arduino software page.
End of Document