Wiki

This version (20 Feb 2019 22:11) was approved by Brandon.The Previously approved version (08 Feb 2019 22:25) is available.Diff

Turbidity Measurement Demo (with EVAL-CN0409-ARDZ)

General description

The EVAL-CN0409-ARDZ shield is a low to high level water turbidity measurement system in combination with the EVAL-ADICUP360. It uses the ADPD105's ambient light rejection feature to make it ideal for applications where accurate, robust and non-contact turbidity measurements are critical.

Setting up the hardware

  1. To program the base board, set the jumpers/switches as shown in the next figure. The important jumpers/switches are highlighted in red.
  2. Connect the EVAL-CN0409-ARDZ to the Arduino connectors P2, P5, P6, P7, P8 of the EVAL-ADICUP360 board.
  3. Plug in the USB cable from the PC to the EVAL-ADICUP360 base board via the Debug USB.(P14)

Calibration procedure

When the project is being run for the first time a calibration procedure is required in order to achieve high accuracy results. The user must follow the steps described in the UART terminal when the application is started.

The user has the option to modify the solutions that are used for calibrating the device. Any values can be used for the points that are used for calibration, but a proper distribution along the 0 - 1000 NTU range must be taken into account.

These values can be edited in CN0409.h file inside the include folder within the project structure.

After the calibration sequence is done at least once, the calibration coefficients are saved in the controller flash memory and will be used the next time when a calibration is not done. The calibration can be repeated as desired. If the program is run for the first time and a calibration routine is not done, the program will prompt the user to manually input calibration coefficients.

Demo Requirements

The following is a list of items needed in order to replicate this demo.

  • Hardware
    • EVAL-ADICUP360
    • EVAL-CN0409-ARDZ Evaluation Board
    • Mirco USB to USB cable
    • PC or Laptop with a USB port
    • Test Vials
    • Turbidity Calibration Solutions (0.02FTU,100FTU and 800FTU)
    • Turbidity Solutions (10FTU,15FTU,10FTU,100FTU and 1000FTU)

The turbidity calibration solutions used in the evaluation are the HI88703-11,Oakton T100 and Cole Parmer kit


  • Software
    • ADuCM360_demo_cn0409 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

Test Setup Functional Block Diagram

Test Vial Considerations

To obtain a most accurate results when taking measurements, process below should take into considerations:

  1. Test vials must be meticulously cleaned. Cleaning involves washing the vials with soap and deionized water, soaking the sample vial in Hydrochloric Acid solution, rinsing with ultra-filtered deionized water, and polishing with silicone oil.
  2. Test vials must also be indexed. After the cleaning process, the vial is used to measure a very low turbidity solution. The position with the lowest measured turbidity should be indexed and this position should be used for succeeding measurements.
  3. Remove bubbles in the solution. This can be done by letting the solution stand for several minutes to allow the bubbles to vacate.
  4. If possible, use one properly indexed test vial.

It is recommended to use LaMotte Test Vial as the size fits into the on board vial holder

Serial Terminal Setup

A serial terminal is an application that runs on a PC or laptop that is used to display data and interact with a connected device (including many of the Circuits from the Lab reference designs). The device's UART peripheral is most often connected to a UART to USB interface IC, which appears as a traditional COM port on the host PC/ laptop. (Traditionally, the device's UART port would have been connected to an RS-232 line driver / receiver and connected to the PC via a 9-pin or 25-pin serial port.) There are many open-source applications, and while there are many choices, typically we use one of the following:

Before continuing, please make sure you download and install one of the above programs.

There are several parameters on all serial terminal programs that must be setup properly in order for the PC and the connected device to communicate. Below are the common settings that must match on both the PC side and the connected UART device.

  1. COM Port - This is the physical connection made to your PC or Laptop, typically made through a USB cable but can be any serial communications cable. You can determine the COM port assigned to your device by visiting the device manager on your computer. Another method for identifying which COM port is associated with a USB-based device is to look at which COM ports are present before plugging in your device, then plug in your device, and look for a new COM port.
  2. Baud Rate - This is the speed at which data is being transferred from the connected device to your PC. These parameters must be the same on both devices or data will be corrupted.
  3. Data Bits - The number of data bits per transfer. Typically UART transmits ASCII codes back to the serial port so by default this is almost always set to 8-Bits.
  4. Stop Bits - The number of “stop” conditions per transmission. This usually set to 1, but can be set to 2 for redundancy.
  5. Parity - Is a way to check for errors during the UART transmission. Unless otherwise specified, set parity to “none”.
  6. Flow Control - Is a way to ensure that data lose between fast and slow devices on the same UART bus are not lost during transmission. This is typically not implemented in a simple system, and unless otherwise specified, set to “none”.

In many instances there are other options that each of the different serial terminal applications provide, such as local line echo or local line editing, and features like this can be turned on or off depending on your preferences. This setup guide will not go over all the options of each tool, but just the minor features that will make it easier to read back data from the connected devices.

Example setup using Putty

  1. Plug in your connected device using a USB cable or other serial cable.
  2. Wait for the device driver of the connected device to install on your PC or Laptop.
  3. Open your device manager, and find out which COM port was assigned to your device.
  4. Open up your serial terminal program (Putty for this example)
  5. Click on the serial configuration tab or window, and input the settings to match the requirements of your connected device.
  6. Ensure that local echo and line editing are enabled, so that you can see what you type and are able to correct mistakes. (Some devices may echo typed characters - if so, you will see each typed character twice. If this happens, turn off local echo.)
  7. Click on the open button, and as long as your connected device and serial terminal program are setup the same, than you should see data displaying.

Measurement Procedure

  1. Fill a clean test vial up to 10mL of the solution under test
  2. Allow sufficient time for bubbles to escape before placing the cap
  3. Wipe the test vial with a lint free cloth before inserting into the on board test vial holder to make sure it is free from fingerprints.
  4. Open putty software and hit reset button on EVAL-ADICUP360. Follow on screen prompt for the calibration as shown below.

For first time use, it is required to perform calibration by typing y key. For the succeeding measurements, just hit n key to skip calibration

  1. 3-point calibration will perform using 0.02FTU,100 FTU and 800 FTU. Wait for the onscreen prompt before placing each solution.
  2. After calibration, place the solution required to measure turbidity as prompted on the screen.
  3. For more details on the software, visit CN0409 Software User Guide.

Make sure you are holding on the test vial cap when placing on the holder

Obtaining the source code

We recommend not opening the project directly, but rather import it into CCES and make a local copy in your workspace.

The source code and include files of the ADuCM360_demo_cn0409 can be found on Github:


CrossCore Embedded Studio Application Source Code:

AduCM360_demo_cn0409 at Github

For more information on importing, debugging, or other tools related questions, please see the tools user guide.

Outputting Data

Serial Terminal Output

  1. In order to view the data, you must flash the program to the EVAL-ADICUP360.
  2. Once complete you will need to switch the USB cable from the DEBUG USB (P14) to the USER USB (P13).
  3. 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
  Start: 1 bit
  Stop: 2 bit
  Flow Control: none


How to use the Tools

The official tool we promote for use with the EVAL-ADICUP360 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.

Importing

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.

Debugging

For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to configure the debug session section.

Project structure

The ADuCM360_demo_cn0409 is a C++ project that uses ADuCM36x C/C++ Project structure.


This project contains: system initialization part, setting system clock, enabling clock for peripherals; i2c interface, UART via P0.6/P0.7; UART read/write functions; Memory read/write functions; turbidity calculations;


In the src and include folders you will find the source and header files related to CN0409 software application. The Communication.cpp/h files contain UART and I2C specific data, meanwhile the CN0409.cpp/h files contain the calculation part and Flash.cpp/h provide memory management. .

End of Document

resources/eval/user-guides/eval-adicup360/reference_designs/demo_cn0409.txt · Last modified: 20 Feb 2019 22:11 by Brandon