This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | resources:eval:user-guides:eval-adicup360:reference_designs:demo_cn0395 [12 Dec 2017 21:43] – Brandon Bushey | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Volatile Organic Compounds (VOC) Measurement Demo====== | ||
+ | The **ADuCM360_demo_cn0395** is a volatile organic compounds (VOC) detector demo project for the EVAL-ADICUP360 base board with additional [[http:// | ||
+ | |||
+ | \\ | ||
+ | ===== General description ===== | ||
+ | \\ | ||
+ | |||
+ | This project is a good example for how to use [[resources: | ||
+ | \\ | ||
+ | \\ | ||
+ | The **ADuCM360_demo_cn0395** project uses the [[http:// | ||
+ | |||
+ | {{ : | ||
+ | \\ | ||
+ | \\ | ||
+ | The TGS8100 sensor requires two voltage inputs: heater voltage (VH) and circuit voltage (VC). The heater voltage (VH) is applied to the integrated heater in order to maintain the sensing element at a specific temperature which is optimal for sensing. The [[http:// | ||
+ | |||
+ | The hardware also allows for two main modes of operation: <fc # | ||
+ | |||
+ | Moreover, the hardware includes a gain select circuit which can add additional overlapping ranges if needed when performing a resistance sensor measurement. [[adi> | ||
+ | |||
+ | TGS8100 sensor has a temperature and humidity dependency, therefore temperature compensation is performed. The **ADuCM360_demo_cn0395** shield includes a temperature and humidity sensor (Sensirion SHT-30), which operates on I2C bus. | ||
+ | |||
+ | The **ADuCM360_demo_cn0395** uses a UART interface (9600 baud rate and 8-bits data length), as a command line interpreter, | ||
+ | |||
+ | ===== Demo Requirements ===== | ||
+ | |||
+ | The following is a list of items needed in order to replicate this demo. | ||
+ | * Hardware | ||
+ | * EVAL-ADICUP360 | ||
+ | * EVAL-CN0395-ARDZ | ||
+ | * Mirco USB to USB cable | ||
+ | * PC or Laptop with a USB port | ||
+ | * Software | ||
+ | * ADuCM360_demo_cn0395 software | ||
+ | * CrossCore Embedded Studio (2.7.0 or higher) | ||
+ | * ADuCM36x DFP (1.0.2 or higher) | ||
+ | * CMSIS ARM Pack (4.3.0 or higher) | ||
+ | * Serial Terminal Program | ||
+ | * Such as Putty or Tera Term | ||
+ | |||
+ | ===== Setting up the hardware ===== | ||
+ | |||
+ | - To program the base board, set the jumpers/ | ||
+ | - Connect the **EVAL-CN0395-ARDZ** to the Arduino connectors **P2, P5, P6, P7, P8** of the **EVAL-ADICUP360** board. | ||
+ | - Plug in the USB cable from the PC to the EVAL-ADICUP360 base board via the Debug USB.(P14) | ||
+ | |||
+ | ===== Obtaining the source code ===== | ||
+ | |||
+ | We recommend not opening the project directly, but rather import it into CCESand make a local copy in your workspace. | ||
+ | |||
+ | The source code and include files of the **ADuCM360_demo_cn0395** can be found on Github: | ||
+ | |||
+ | <WRAP round 80% download> | ||
+ | \\ | ||
+ | CrossCore Embedded Studio Application Source Code: | ||
+ | \\ | ||
+ | \\ | ||
+ | [[https:// | ||
+ | </ | ||
+ | |||
+ | <WRAP center round info 80%> | ||
+ | For more information on importing, debugging, or other tools related questions, please see the [[https:// | ||
+ | </ | ||
+ | |||
+ | ===== Configuring the Software Parameters ===== | ||
+ | |||
+ | There are no configurations needed for this demo example. | ||
+ | |||
+ | ===== Outputting Data ===== | ||
+ | |||
+ | ==== Serial Terminal Output ==== | ||
+ | |||
+ | - In order to view the data, you must flash the program to the EVAL-ADICUP360. | ||
+ | - Once complete you will need to switch the USB cable from the DEBUG USB (P14) to the USER USB (P13). | ||
+ | - Then follow the UART settings below with the serial terminal program. | ||
+ | \\ | ||
+ | |||
+ | Following is the UART configuration. | ||
+ | Select COM Port | ||
+ | Baud rate: 9600 | ||
+ | Data: 8 bit | ||
+ | Parity: none | ||
+ | Stop: 1 bit | ||
+ | Flow Control: none | ||
+ | \\ | ||
+ | |||
+ | The application allows the user to select between the two modes of operation: | ||
+ | * Heater mode (RH) | ||
+ | * Sensor Resistance mode (RS) | ||
+ | |||
+ | ==== Heater Mode (RH) ==== | ||
+ | |||
+ | The user can further choose the subroutine which determines the heater current (IH): | ||
+ | {{ : | ||
+ | |||
+ | **voltage** is the routine for setting heater voltage to constant voltage VH (the default value is VH = 1.8V). The relationship between heater resistance RH and heater current IH or heater voltage VH is nonlinear. Therefore the software runs in background several iterations in order to get VH to the desired accuracy with a 0.5% max error. | ||
+ | |||
+ | **resistance** is the routine for setting the heater resistance to constant resistance RH (the default is RH = 225Ω). For a heater resistance RH, set IH = (RH – 110Ω)/ | ||
+ | |||
+ | **temperature** is the routine of setting the heater temperature to constant temperature TH (the default is TH = 360 C). This is done in three steps: | ||
+ | - The desired heater resistance RH_T is computed from RH_T = RH_A [ 1 + ALPHA*(RH_0/ | ||
+ | * RH_A is the heater ambient temperature (measured at power up) | ||
+ | * RH_0 is the default heater resistance (110Ω @ 20°C) | ||
+ | * T is the desired heater temperature (user input) | ||
+ | * T_A is the ambient temperature (measured at power up) | ||
+ | * ALPHA is the constant 0.003074 | ||
+ | - The resulted RH is used to calculate IH and VH with constant resistance routine. | ||
+ | - The resulted VH is further adjusted by using the constant heater voltage routine. | ||
+ | |||
+ | **current** simply sets the IDAC to the desired current. | ||
+ | |||
+ | After the completion of the routine, the application displays the measured values: RH_A (Ambient Heater Res | ||
+ | ), VH (heater voltage), IH (heater current), RH (heater resistance), | ||
+ | {{ : | ||
+ | |||
+ | At power up, the application starts in constant current mode and sets the default current to 8mA. Furthermore, | ||
+ | {{ : | ||
+ | |||
+ | ==== Sensor Resistance mode (RS) ==== | ||
+ | |||
+ | Sensor measurement is performed. The application can switch at any time to this mode by pressing the < | ||
+ | |||
+ | In background every time the application runs the gain-ranging algorithm and determines RS and the gas concentration (C) measured in PPM (parts per million): | ||
+ | {{ : | ||
+ | |||
+ | RS reading can also be performed by typing < | ||
+ | |||
+ | //**Factory Calibration**// | ||
+ | The IDAC current from the ADN8810 is 1% accurate, therefore a factory calibration must be performed. The routine loads code 4095 into ADN8810 and reads the ADC, which ideally should be 9.94mA × 71.5Ω = 0.71V, or code [0.71/ | ||
+ | - Type < | ||
+ | - Connect jumper P2 between P2-1 and P2-2, this connects the IOUT to the precision 71.5Ω resistor. | ||
+ | - Press <c> key when ready | ||
+ | - Power Off -> On | ||
+ | {{ : | ||
+ | |||
+ | From this point on, K1 is stored in permanent memory and applied to currents that are input. | ||
+ | To read the gain correction factor from memory, type < | ||
+ | {{ : | ||
+ | |||
+ | // | ||
+ | |||
+ | Type < | ||
+ | {{ : | ||
+ | |||
+ | ===== How to use the Tools ===== | ||
+ | |||
+ | The official tool we promote for use with the EVAL-ADICUP360 is CrossCore Embedded Studio. | ||
+ | |||
+ | ==== Importing ==== | ||
+ | |||
+ | For more detailed instructions on importing this application/ | ||
+ | |||
+ | ==== Debugging ==== | ||
+ | |||
+ | For more detailed instructions on importing this application/ | ||
+ | |||
+ | ===== Project structure ===== | ||
+ | \\ | ||
+ | The **ADuCM360_demo_cn0395** project use ADuCM36x C/C++ Project structure. | ||
+ | |||
+ | This project contains: system initialization part - disabling watchdog, setting system clock, enabling clock for peripherals; | ||
+ | |||
+ | In the **src** and **include** folders you will find the source and header files related to CN0395 software | ||
+ | \\ | ||
+ | |||
+ | {{: | ||
+ | \\ | ||
+ | The **RTE** folder contains device and system related files: | ||
+ | * **Device Folder** – contains low levels drivers for ADuCM360 microcontroller.(try not to edit these files) | ||
+ | * **system.rteconfig** - Allows the user to select the peripherial components they need, along with the startup and ARM cmsis files needed for the project. | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | // End of Document // |