Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
resources:eval:user-guides:eval-adicup3029:reference_designs:demo_cn0357 [23 Jul 2017 16:21] – [Project Structure] ANMOL Raykarresources:eval:user-guides:eval-adicup3029:reference_designs:demo_cn0357 [31 Jul 2017 19:40] – created Brandon Bushey
Line 1: Line 1:
 ======CO Toxic Gas Measurement Demo (with EVAL-CN0357-ARDZ)====== ======CO Toxic Gas Measurement Demo (with EVAL-CN0357-ARDZ)======
-\\ + 
-The **ADICUP3029_CN0357** is a toxic gas(CO) detector demo project for the EVAL-ADICUP3029 base board with additional [[http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-CN0357-ARDZ.html|EVAL-CN0357-ARDZ shield]], created using the CrossCore Embedded Studio environment. +The **cn0357_example_noos** is a toxic gas(CO) detector demo project for the EVAL-ADICUP3029 base board with additional [[http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-CN0357-ARDZ.html|EVAL-CN0357-ARDZ]] shield, created using the CrossCore Embedded Studio environment.
-\\+
 \\ \\
  
 +===== General Description/Overview =====
  
-===== General Description/Overview =====+This user guide gives a detailed explanation about **cn0357_example_noos** toxic gas (CO) detection project for [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029|EVAL-ADICUP3029]] base board and [[http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-CN0357-ARDZ.html|EVAL-CN0357-ARDZ]] gas sensor shield. The gas sensor shield consists of portable gas detector circuit.
 \\ \\
-This userguide gives a detailed explanation about  ADICUP3029_CN0357  toxic gas (CO) detection project for [[https://wiki.analog.com/resources/eval/user-guides/eval-adicup3029/hardware/adicup3029|EVAL-ADICUP3029]] base board and [[http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-CN0357-ARDZ.html|EVAL-CN0357-ARDZ]] gas sensor shield. The gas sensor shield consists of portable gas detector circuit.+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:picture1.jpg?500 |}}
 \\ \\
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:picture1.jpg?500 |}} +The [[http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-CN0357-ARDZ.html|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 [[http://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/EVAL-CN0357-ARDZ.html|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 **ADICUP3029_CN0357** 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.+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 sensor range. These can be modified by changing the values of the constants **SENSOR_SENSITIVITY** and **SENSOR_RANGE** found in the **CN0357.h** header file of the project.  See the "//Project Structure//" section for more details.+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.  
 \\ \\
 \\ \\
 +
 +===== Demo Requirements  =====
 +
 +The following is a list of items needed in order to replicate this demo.
 +  * Hardware
 +    * EVAL-ADICUP3029
 +    * EVAL-CN0357-ARDZ
 +    * Mirco USB to USB cable
 +    * PC or Laptop with a USB port
 +    * 7V - 12V DC power supply (only if you have Rev B of the CN0357)
 +  * Software
 +    * cn0357_example_noos software
 +      * Inside Sensor_Sw Pack (1.0.0 or higher)
 +    * CrossCore Embedded Studio (2.6.0 or higher)
 +    * ADuCM302x DFP (2.0.0 or higher)
 +    * ADICUP3029 BSP (1.0.0 or higher)
 +    * Android IoTNode App (optional)
 +      * Either Android or iOS version
 +    * Serial Terminal Program (Required for running in release mode only)
 +      * Such as Putty or Tera Term
  
 ===== Setting up the hardware ===== ===== Setting up the hardware =====
-\\ 
  
-<note important>Extremely important to plug in an acceptable power supply to the barrel jack **P11** to supply power for the **EVAL-CN0357-ARDZ Rev B**.  The boards will not work if you try only to power it from the DEBUG_USB or the USER_USB. The external power supply is not required for **EVAL-CN0357-ARDZ Rev C**. </note>+  - Make sure that Carbon Monoxide sensor **CO-AX** is properly placed on the **EVAL-CN0357-ARDZ** sensor shield () 
 +  - Ensure the jumper **AD5720_CS** has a shunt across Pin 3 and Pin 4 of the **EVAL-CN0357-ARDZ** 
 +  - Ensure the jumper **AD7790_CS** has a shunt across Pin 1 and Pin 2 of the **EVAL-CN0357-ARDZ**{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:jumper_cn0357.png?500 |}} 
 +  - Place the **(S5)** switch position to read "Wall/USB", and the **(S2)** switch position to read "USB" on the **EVAL-ADICUP3029**.{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:jumper_ble.png?500 |}} 
 +  - Mount **EVAL-CN0357-ARDZ** on the **EVAL-ADICUP3029** base board such that **DIGI1** and **DIGI0** of the        EVAL-CN0357-ARDZ are connected to the **P6** and **P7** on the EVAL-ADICUP3029 board respectively. 
 +  - Plug in the micro USB cable into the **(P10)** USB port on the **EVAL-ADICUP3029**, and the other end into the PC or laptop. 
 + 
 +<note important>Extremely important to plug in an acceptable power supply to the barrel jack **P2** of the EVAL-ADICUP3029 to supply power for the **EVAL-CN0357-ARDZ Rev B**.  The boards will not work if you try only to power it from the USB. The external power supply is not required for **EVAL-CN0357-ARDZ Rev C**. </note> 
 +\\  
 +  
 +===== Configuring the Software ===== 
 + 
 +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:
  
-  - Make sure that Carbon Monoxide sensor **CO-AX** is properly placed on the **EVAL-CN0357** sensor shield +    * **CN0357_FEEDBACK_RESISTOR** - <fc #008000>CN0357_FEEDBACK_RESISTOR</fc> -This is the value that the rheostat needs to be configured to for proper operation (ohms). This value is dervied from equation 2 (located on page 2) on the CN0357 datasheet 
-   Mount **EVAL-CN0357-ARDZ** on the **EVAL-ADICUP3029** base board such that **DIGI1** and **DIGI0** of the sensor shield are connected to the **P6** and **P7** on the EVAL-ADICUP3029 board respectively+<code> 
-  - Insert the **DEBUG USB** in **P10** of EVAL-ADICUP3029 base board+    #define CN0357_FEEDBACK_RESISTOR (9230.76) 
 +</code> 
 + 
 +  * **CN0357_SENSOR_SENSITIVTY** - <fc #008000>CN0357_SENSOR_SENSITIVTY</fc> - sensitivity (nA/ppm) of the electrochemical sensor being used. 
 +<code> 
 +    #define CN0357_SENSOR_SENSITIVTY (0.0000000065)    
 +</code>
 \\ \\
-The ADuCM3029_demo_cn0357 uses **UART** connection via **P0.10/P0.11** and **SPI0** channel of the ADuCM3029 to communicate with EVAL-CN0357-ARDZ board.  
-\\ 
-\\ 
-==== Jumper and Switch Settings ==== 
-\\ 
-  - Place the jumper on P18 (Arduino Power Rails) on the EVAL-ADICUP3029 base board. 
-  - Check the direction of the switch S2 for the proper working of the UART and S5 for USB/Wall power supply. 
-  - Place the jumper on P15 on the EVAL-ADICUP3029 base board to power the BLE.  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:jumper_ble.png?500 |}} 
- - Similarly the jumper settings for EVAL-CN0357-ARDZ Rev C are as follows 
  
-{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:jumper_cn0357.png?500 |}}+In the //cn0357_app.h// header files you can configure the following parameters:
 \\ \\
 +    * **ADI_APP_DISPATCH_TIMEOUT** - //DISPATCH TIMEOUT// will define how often the data is sent over Bluetooth.
 +    * **ADI_APP_USE_BLUETOOTH ** - //ENABLE BLUETOOTH// parameter - will either use Bluetooth or will have the option to print to console window in debug mode or terminal in release mode.
 +
 +\\ 
 +
 ===== Obtaining the source code ===== ===== Obtaining the source code =====
-\\+
 We recommend not opening the project directly, but rather import it into CrossCore Embedded Studio and make a local copy in your workspace.  We recommend not opening the project directly, but rather import it into CrossCore Embedded Studio and make a local copy in your workspace. 
 \\ \\
  
-The source code and include files of the **ADICUP3029_CN0357** can be found on Github+The source code and include files of the **cn0357_example_noos** can be found below
-<WRAP round 40% download>+<WRAP round 60% download>
  
-The source code has to be inserted from the github+[[https://github.com/analogdevicesinc/sensor-sw-pack/tree/master/Boards/EVAL-ADICUP3029/Examples/gas/cn0357/noos| CN0357 + ADICUP3029 Source Code]]
    
 </WRAP> </WRAP>
 \\ \\
- 
  
 ===== Outputting Data ===== ===== Outputting Data =====
  
- When the ADICUP3029 is in advertising modeUART terminal would display+Once the hardware is setup and software is configureduser needs to select how they want to view the data coming from the gas sensor(CN0357).
  
-{{:resources:eval:user-guides:eval-adicup3029:reference_designs:advertising.png?300|}}+There are **three** different ways to visualize the data: 
 +  * CrossCore Embedded Studio Console Window (through semihosting) 
 +  * Serial Terminal Program (such as Putty or Tera Term) 
 +  * IoTNode Smart Device App
  
 +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.
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:adt7420_demo_launch_configurations.png?200|}}
 +\\ 
 +\\ 
  
- The ADI_CO_SENSOR node device found on iPAD+^ 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 [[resources:eval:user-guides:eval-adicup3029:smart_app:ios_app|iOS Smart Device App]] page) or Android Smart Device App (for more information and installation directions check out the [[resources:eval:user-guides:eval-adicup3029:smart_app:android_app|Android Smart Device App]] page)
  
-{{:resources:eval:user-guides:eval-adicup3029:reference_designs:ipad_connect.png?300|}} +==== Debug Launch Mode ====
-                           +
  
- The ADICUP3029 connected to BLE peripheral and sending the CO ppm concentration values+**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.  
 +\\ 
  
- {{:resources:eval:user-guides:eval-adicup3029:reference_designs:screenshot2.png?300|}}+Figure shows when ADI_APP_USE_BLUETOOTH is set to 1, sensor data is sent to the smart app and printed onto the console. 
 +{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0357:console_image.png?600 |}}
  
-The data transmission successful is indicated by green LED glow+If you have the app installed on your phone, these figure shows the output on android device. 
 +<WRAP center round important 80%> 
 +Do not try to connect directly (or pair) to the EVAL-ADICUP3029 from your phone.   
 +  - Simply open up the IoTNode application on your phone. 
 +  - "Scan" for nearby demos.   
 +  - Once you find your demo, click on it to open it up. 
 +</WRAP> 
 +  - **Android App display** 
 +  - **iOS App display**                                                      
 +{{:resources:eval:user-guides:eval-adicup3029:reference_designs:cn0357:appbef.png?390|}} {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0357:app.png?400|}} 
 +\\  
 +{{:resources:eval:user-guides:eval-adicup3029:reference_designs:ipad_connect.png?600|}} {{:resources:eval:user-guides:eval-adicup3029:reference_designs:co_val.png?600|}} 
 +\\
  
-{{:resources:eval:user-guides:eval-adicup3029:reference_designs:green_led_glow.png?300|}}+==== Release Launch Mode ====
  
-The data transmission un-successful is indicated by red LED glow +**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. 
-{{:resources:eval:user-guides:eval-adicup3029:reference_designs:red_led_glow.png?300|}}+    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 
 +\\  
 +{{:resources:eval:user-guides:eval-adicup3029:reference_designs:disco.png?300|}}
  
-The ppm concentration values displayed on ios+**iOS App and Android App display** 
 +If you have the app installed on your phone, these figure shows the output on android device. 
 +<WRAP center round important 80%> 
 +Do not try to connect directly (or pair) to the EVAL-ADICUP3029 from your phone.   
 +  - Simply open up the IoTNode application on your phone. 
 +  - "Scan" for nearby demos.   
 +  - Once you find your demo, click on it to open it up. 
 +</WRAP>
  
-{{:resources:eval:user-guides:eval-adicup3029:reference_designs:co_val.png?300|}} +  - **Android App display** 
- +  - **iOS App display**                                                      
-Graph displaying ppm values +{{:resources:eval:user-guides:eval-adicup3029:reference_designs:cn0357:appbef.png?390|}} {{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0357:app.png?400|}} 
- +\\  
-{{:resources:eval:user-guides:eval-adicup3029:reference_designs:graph.png?300|}} +{{:resources:eval:user-guides:eval-adicup3029:reference_designs:ipad_connect.png?600|}} {{:resources:eval:user-guides:eval-adicup3029:reference_designs:co_val.png?600|}} 
- +\\
-The ADICUP3029 disconnected to BLE peripheral +
- +
-{{:resources:eval:user-guides:eval-adicup3029:reference_designs:disco.png?300|}}+
  
 ===== How to use the Tools ===== ===== How to use the Tools =====
-\\ 
 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 [[resources:eval:user-guides:eval-adicup3029:tools|Tools Overview page.]] 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 [[resources:eval:user-guides:eval-adicup3029:tools|Tools Overview page.]]
 +\\
 \\ \\
 +
  
 ==== Importing  ==== ==== Importing  ====
-\\ 
 For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our [[resources:eval:user-guides:eval-adicup3029:tools:cces_user_guide#how_to_import_existing_projects_into_your_workspace|How to import existing projects into your workspace]] section. For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our [[resources:eval:user-guides:eval-adicup3029:tools:cces_user_guide#how_to_import_existing_projects_into_your_workspace|How to import existing projects into your workspace]] section.
 +\\
 \\ \\
  
  
 ==== Debugging ==== ==== Debugging ====
-\\ +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 [[resources:eval:user-guides:eval-adicup3029:tools:cces_user_guide#how_to_configure_the_debug_session_for_an_aducm3029_application|How to configure the debug session]] 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 [[resources:eval:user-guides:eval-adicup3029:tools:cces_user_guide#how_to_configure_the_debug_session_for_an_aducm3029_application|How to configure the debug session]] section.+
  
-        * Make sure the target board is connected to the computer (via **DEBUG USB**) and using the tool bar, navigate to the small Debug icon{{:resources:eval:user-guides:eval-aducm360-ardz:quickstart:bug.png?30|}} and select the debugging session you created. The application will programmed and the program execution will stop at the beginning of the main() function.+        * Make sure the target board is connected to workstation (via **USB** at P10) and using the tool bar, navigate to the small Debug icon{{:resources:eval:user-guides:eval-aducm360-ardz:quickstart:bug.png?30|}} and select the debugging session you created. The application will programmed and the program execution will stop at the beginning of the main() function.
   
  * Use step-by-step execution or directly run the program.  * Use step-by-step execution or directly run the program.
   
-After completion of the steps above the program will remain written into the system flash and it will run by default every time the board is powered up.+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.
  
-{{:resources:eval:user-guides:eval-adicup3029:reference_designs:debugging.png?500|}}+{{ :resources:eval:user-guides:eval-adicup3029:reference_designs:cn0357:debug_image.png?1000 |}}
 \\ \\
 +
  
  
  
 ==== Project Structure === ==== Project Structure ===
-\\ +The **cn0357_example_noos** project use ADuCM302x C/C++ Project structure.  
-The **ADICUP3029_CN0357** 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 . 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 .
  
-In the **src** and **include** folders you will find the source and header files related to CN0357 software  applicationThe //Communication.c/h// files contain SPI and UART specific data, the //AD7790.c/h// files contain the ADC control, the //AD5270.c/h// files contain the rheostat control, the //CN0357.c/h// files contain ppm computations specific to the gas detector application and the //CN0357.c/h//+{{:resources:eval:user-guides:eval-adicup3029:reference_designs:cn0357:project_struct.png?400 |}}
-\\+
  
-{{:resources:eval:user-guides:eval-adicup3029:reference_designs:project_structure.png?300|}} +The **cn0357_app.cpp** is the application file for the project. The **ADuCM3029** folder consists of pinmux for SPI0, SPI2 and UART0.
-\\ +
-In the appropriate header files you can **configure** next **parameters**+
-\\+
 \\ \\
  
-    * **Sensor Range** - <fc #008000>SENSOR_RANGE</fc> - maximum value of the gas conentration (ppm) that can be detected by the electrochemical gas sensor being used (//CN0357.h//). +The **RTE** folder contains ADuCM3029 Device Family Pack,Board Support Package files and Sensor Config files related to cn0357_example_noos project.
-<code> +
-    #define SENSOR_RANGE     2000  +
-</code> +
- +
-  * **Sensor Sensitivity** - <fc #008000>SENSOR_SENSITIVITY</fc> - sensitivity (nA/ppm) of the electrochemical sensor being used (//CN0357.h//). +
-<code> +
-    #define SENSOR_SENSITIVITY  65    +
-</code>+
  
 \\ \\
- 
- 
 \\ \\
  
 +// End of Document //
resources/eval/user-guides/eval-adicup3029/reference_designs/demo_cn0357.txt · Last modified: 04 Mar 2021 06:06 by Zuedmar Arceo