The cn0357_example_noos is a toxic gas(CO) detector demo project for the EVAL-ADICUP3029 base board with additional EVAL-CN0357-ARDZ shield, created using the CrossCore Embedded Studio environment.
This user guide gives a detailed explanation about cn0357_example_noos toxic gas (CO) detection project for EVAL-ADICUP3029 base board and EVAL-CN0357-ARDZ gas sensor shield. The gas sensor shield consists of portable gas detector circuit.
The EVAL-CN0357-ARDZ shield circuit provides a potentiostatic circuit for biasing the electrochemical sensor and 16-bit Sigma-Delta ADC. The small currents passing in the sensor is being converted to a voltage that can be read by the ADC. The 16-bit ADC value is received via SPI interface of the EVAL-ADICUP3029 board, where the gas concentration is computed.
The cn0357_example_noos application configures the necessary components, processes ADC output value and make all necessary conversions in order to provide the gas concentration. A UART interface (38400 baud rate and 8-bits data length) is used to send the results to terminal window: CO Concentration in Parts Per Million(PPM) are the outputs provided in the terminal window.
At the start of the project, the software computes the necessary parameters and configure the digital rheostat(AD5270) . The required parameters are the sensor sensitivity and feedback resistor range. These can be modified by changing the values of the constants CN0357_SENSOR_SENSITIVITY and CN0357_FEEDBACK_RESISTOR found in the adi_cn0357.h header file of the project.
The following is a list of items needed in order to replicate this demo.
The CN0357 comes with a carbon monoxide sensor, and those default settings are programmed into the software. If you decide to use a different type of sensor, you will need to change the sensor sensitivity and feedback resistor.
In adi_cn0357.h header file the user can configure parameters:
#define CN0357_FEEDBACK_RESISTOR (9230.76)
#define CN0357_SENSOR_SENSITIVTY (0.0000000065)
In the cn0357_app.h header files you can configure the following parameters:
There are two basic ways to program the ADICUP3029 with the software for the CN0357.
Using the drag and drop method, the software is going to be a version that Analog Devices creates for testing and evaluation purposes. This is the EASIEST way to get started with the reference design
Importing the project into CrossCore is going to allow you to change parameters and customize the software to fit your needs, but will be a bit more advanced and will require you to download the CrossCore toolchain.
The software for the ADuCM3029_demo_cn0357 can be found here:
Pre-built CN0357 Hex File
Complete CN0357 Source Files
Once the hardware is setup and software is configured, user needs to select how they want to view the data coming from the gas sensor(CN0357).
There are three different ways to visualize the data:
Depending on how you want to operate the board and visualize the data, there are two different options that must be selected from. Below is a table outlining the general operation, and you need to click on which launch file you need to program onto the EVAL-ADICUP3029, and hit the <F5> key on your keyboard.
Data Output Destination | Connected to Debugger | Configuration File |
---|---|---|
CCES Console Window | Yes | ADICUP3029_Debug.launch |
PC/Laptop Serial Terminal | No | ADICUP3029_Release.launch |
IoTNode Smart App | Yes | ADICUP3029_Debug.launch |
IoTNode Smart App | No | ADICUP3029_Release.launch |
The data for this demo can be viewed in the serial terminal window (via UART) and by connecting to the Analog Devices iOS Smart Device App (for more information and installation directions check out the iOS Smart Device App page) or Android Smart Device App (for more information and installation directions check out the Android Smart Device App page)
Debug launch mode is used when connected to the debugger. In debug mode, all the outputs are directed to the console window of the CrossCore tools via semihosting. The data is also sent by default to the IoTNode smart app (ADI_APP_USE_BLUETOOTH =1), but can be turned of if desired by setting ADI_APP_USE_BLUETOOTH = 0.
Figure shows when ADI_APP_USE_BLUETOOTH is set to 1, sensor data is sent to the smart app and printed onto the console.
If you have the app installed on your phone, these figure shows the output on android device.
Do not try to connect directly (or pair) to the EVAL-ADICUP3029 from your phone.
Release launch mode is used for running without the debugger connected. When in release mode, console output is redirected to UART. Bluetooth is enabled, and sensor data is sent to android application. If disabled, sensor data is directed only to the UART. If you are using the UART to make print to the PC/laptop, here are the settings your TCP client must be set too. Following is the UART configuration.
Select COM Port Baud rate: 38400 Data: 8 bit Parity: none Stop: 1 bit Flow Control: none
Figure shows the UART terminal when ADI_APP_USE_BLUETOOTH is set to 1
iOS App and Android App display If you have the app installed on your phone, these figure shows the output on android device.
Do not try to connect directly (or pair) to the EVAL-ADICUP3029 from your phone.
The official tool we promote for use with the EVAL-ADICUP3029 is CrossCore Embedded Studio. For more information on downloading the tools and a quick start guide on how to use the tool basics, please check out the Tools Overview page.
For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to import existing projects into your workspace section.
A debug configuration must be set up for this project in order to have the possibility to program and to debug the ADICUP3029_CN0357 project. To do this, follow the instructions from How to configure the debug session section.
After completion of the steps above the program will be loaded onto the system FLASH and it will run by default every time the board is powered up.
The cn0357_example_noos project use ADuCM302x C/C++ Project structure.
This project contains: system initialization part - disabling watchdog, enabling clock for peripherals; port configuration for SPI0;SPI2;UART , SPI and UART initialisation, SPI, UART read/write functions, AD7790 control, AD5270 control and gas concentration computation, BLE initialization, packet formation and sending data .
The cn0357_app.cpp is the application file for the project. The ADuCM3029 folder consists of pinmux for SPI0, SPI2 and UART0.
The RTE folder contains ADuCM3029 Device Family Pack,Board Support Package files and Sensor Config files related to cn0357_example_noos project.
End of Document