This is an old revision of the document!
The ADuCM3029_demo_cn0326 is a pH monitor with automatic temperature compensation demo project, for the EVAL-ADICUP3029 base board with additional EVAL-CN0326-PMDZ PMod, created using the CrossCore Embedded Studio with GNU ARM compiler.
This project is a good example for how to use EVAL-ADICUP3029 in different combinations with pmod boards. It expand the list of possible applications that can be done with the base board.
The ADuCM3029_demo_cn0326 project uses the EVAL-CN0326-PMDZ pmod which is a pH sensor signal conditioner and digitizer with automatic temperature compensation.
The CN0326 circuit provides a complete solution for pH sensors with internal resistance between 1 MΩ and several GΩ. It consist of pH probe buffer, Pt1000 RTD for temperature compensation and 24-bits ADC with 3 differential analog inputs.
The pH probe consists of a glass measuring electrode and a reference electrode, which is analogous to a battery. When the probe is place in a solution, the measuring electrode generates a voltage depending on the hydrogen activity of the solution, which is compared to the potential of the reference electrode. As the solution becomes more acidic (pH < 7) the potential of the glass electrode becomes more positive (+mV) in comparison to the reference electrode; and as the solution becomes more alkaline (pH > 7) the potential of the glass electrode becomes more negative (−mV) in comparison to the reference electrode.
The change in temperature of the solution changes the activity of its hydrogen ions. When the solution is heated, the hydrogen ions move faster which result in an increase in potential difference across the two electrodes. In addition, when the solution is cooled, the hydrogen activity decreases causing a decrease in the potential difference. Electrodes are designed ideally to produce a zero volt (0 V) potential when placed in a buffer solution with a pH of 7 (neutral pH).
The EVAL-CN0326-PMDZ comes with an evaluation software which can help you to test and to calibrate your pmod before you use it.
The potential changes are outputted as ADC 24-bits value which is received via SPI interface of the EVAL-ADICUP3039 board. The ADC analog differential channels are:
The ADuCM3029_demo_cn0326 application purchase ADC outputs from input channels, calculates voltage, temperature and pH values. You can choose to use internal excitation current of the ADC (IOUT2) or calculate bias current of the circuit (see USE_IOUT2 parameter).
A UART interface (9600 baud rate and 8-bits data length) is used, as a command line interpreter, to send the results to terminal window: temperature and ph values. Beside this two the interpreter process other three commands: help, calibrate channel/channels and ADC reset.
To start the command line interpreter you need to press ENTER key (CR) from the keyboard and after that just type in <help> to see available commands. The output data are send via UART using semihosting.
The project uses below formula to determine output ADC code for an input voltage on either channel:
AIN - analog input voltage
GAIN - gain value in the in-amp setting
N - ADC resolution (24)
The temperature value is calculated using RTD resistance value and it varies from 0°C (1000 Ω) to 100°C (1385 Ω):
Rrtd - RTD resistance at T°C
Rmin - RTD resistance at 0°C
α - temperature coefficient (0.00385 Ω/Ω/°C)
To calculate pH value is used Nernst equation:
E - voltage of the hydrogen electrode with unknown activity
α - zero point tolerance (±30 mV)
T - ambient temperature in °C
n - valence, number of charges on ion (1 at 25 °C)
F - Faraday constant (96485 coulombs/mol)
R - Avogadro's number (8314 mV-coulombs /°K mol)
pHiso - reference hydrogen ion concentration (7)
The following is a list of items needed in order to replicate this demo.
There are two basic ways to program the ADICUP3029 with the software for the CN0326.
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_cn0326 can be found here:
Pre-built CN0326 Hex File
Complete CN0326 Source Files
For more information on importing, debugging, or other tools related questions, please see the tools user guide.
#define AD7793_GAIN AD7793_GAIN_1
#define USE_IOUT2 NO
#define TOLERANCE 0
Following is the UART configuration.
Select COM Port Baud rate: 9600 Data: 8 bit Parity: none Stop: 1 bit Flow Control: none
|help||Display available commands|
|calibrate|| Calibrate selected channels or all channels
<ch> = AIN1, AIN2, AIN3, or all
|ph||Display pH value|
|temperature||Display temperature value|
|reset||Reset ADC converter|
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.
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.
End of Document