As the world navigates the impacts of climate change and environmental shifts, access to vital resources like clean
water and healthy soil remains an important global concern. According to the United Nations, over 40% of the global
population still faces challenges in accessing safe drinking water and adequate sanitation services.
As we have already embarked on the artificial intelligence (AI) era, it is inevitable to ask the question “How AI
could
possibly help resolve the water challenges”. With the advent of edge AI, real-time resource quality monitoring is
possible with high-quality data and superior ML inference engines. AI-powered sensors and data analytics enable
real-time monitoring of water parameters and automatic control of water systems, optimizing water allocation and
usage
in response to changing conditions. These AI-powered systems improve operational efficiency, reduce water losses,
and facilitates
adaptive
water management.
One parameter by which the quality of water can be analyzed, and one such use case that NXP enables is the pH
measurement. Knowing the pH value
is a
crucial step in assessing the quality of water or soil. Nearly every industry that handles liquids need a
measurement
system for pH. pH measurement is important in water quality analysis because it indicates the acidity or alkalinity
of
water, significantly impacting the solubility and bioavailability of chemicals like nutrients and heavy metals.
This analysis offers insights on how the water quality is directly affecting the health of aquatic life and the
overall environmental quality of a water body.
NXP enables the edge-AI-ready solution for pH metering, and NXP analog front ends (AFE) enable fast, accurate and
reliable pH meter data that can be used for real-time water monitoring using machine learning algorithms.
State-of-the-Art Water Quality Analysis Solution
The figure below is a high-level representation of the circuit that is used in both pH as well as conductivity
analysis
of water. This application comprises of 2 electrodes:
- The first electrode is a CE electrode as shown in figure 1 below. Using a DAC, a complex slow-speed waveform (10
Hz
to
100 Hz) is generated. Usually, a power amplifier after the DAC output is needed to drive this floating electrode
in an
electrolytic solution. The biased electrode generates a chemical reaction or hydrogen activity in the
electrolytic
solution
- The second electrode in the solution is a RE (reference) electrode as shown in figure 1 below. The reference
electrode
has a stable reference voltage and therefore it feeds back a bias signal that goes to the inverting input to the
Power
Amplifier
- The WE signal in the figure below is a current on the order of a few microamps that is a result of the hydrogen
activity or ion movements in the solution due to the electro-potential difference between the CE and RE
electrodes.
Using an op-amp as a transimpedance amplifier, the current is converted to a voltage in the 10 mV to 100 mV
range
where it
is processed by the ADC
Figure 1. The circuit is used for both pH and the conductivity analysis of water.
To better experience, download the
image.
Edge-AI-Enabled Water Conductivity Analysis Systems
High-Quality Data for Real-Time Monitoring and Predictive Maintenance
Machine learning inference engines provide optimal accuracy in quality and fault analysis when they are trained with
highly accurate and reliable data from pH meters. Stable output and diagnostics data helps to extract necessary
features
for profiling various water quality analysis parameters using machine learning algorithms.
- Stability: Drift with time and temperature are very important factors for edge AI enabled pH meter and
conductivity
meter design. Low and predictive drift enables supervised machine learning algorithms to predict or classify
unseen
future instances more accurately
- Effective Resolution and Noise Performance: To take full advantage of sensor dynamic range and receive accurate
readings,
low noise and high resolution should be taken into consideration during signal chain and power design,
especially for
laboratory instruments
- Accuracy: Majority of pH meters that are used in labs require at-least +/-0.1 pH accuracy for accurate
measurements in
different environments
- Diagnostics and calibration: For predictive maintenance and higher-quality measurements, the electrode
diagnostics
provide flexibility to understand when the electrode needs cleaning or calibration
Now, we can move on to understand how new NXP analog front end (AFE) will help to overcome the obstacles and
challenges involved with pH monitoring.
Building on NXP’s extensive portfolio of multi-channel universal analog input family, the NAFE33352 is a
software-configurable universal input and output AFE that meets high precision measurement or data
requirements for this edge-AI enabled pH meter application. The UIO-AFE integrates precision 14/16/18-bit DAC,
16/24-bit
ADC, low-drift voltage reference, low offset drift buffers, high-voltage high precision amplifiers with 70-volts
input
protection circuit for EMC and miswiring scenarios. The device has built-in diagnostic and protection circuits for
output, short circuit and open circuit detection. The analog input block has advanced diagnostic circuits for
condition
monitoring and ensures functional safety. The precise current and voltage readback enables advanced anomaly
detection
for predictive maintenance.
How the NAFE33352 AFE Enables Advanced Diagnostics for pH Monitoring
Stable ADC and DAC Data for Pattern Recognition
Input ADC Data
The typical data rate of ADC for this application is around 100 ksps. NAFE33352 offers superior
noise
performance as shown in the table below. The UIO AFE noise performance of the analog input depends on the device
configuration: data rate, PGA gain, digital filter order and settling mode configuration. Two significant
factors that
affect noise performance are data rate and PGA gain. Decreasing the data rate results in a proportional decrease
of
total noise because the equivalent noise bandwidth of the digital filter is reduced proportionally with the data
rate.
Increasing the gain reduces input referred noise because the noise of the PGA is lower than the noise of the
ADC. Noise
performance also depends on the shape of the digital filter because the order of the digital filter decreases
the
equivalent noise bandwidth which results in lower noise.
Table 1. Noise performance results. To better experience, download the
image.
Output DAC Data
NAFE33352’s DAC can be used to generate the complex waveform, required in such application. The
auto-DAC waveform generator can be triggered by the SPI host sending DAC command CMD_WGEN. All the waveform
parameters
can be programmed in different registers to get the desired output waveform.
NAFE33352 has integrated low-drift voltage reference and low-offset drift buffers that help to offer
stability
over both temperature and time. Its typical voltage and current input and output TUE drift over temperature is 3
ppm/C
(Maximum, 10 ppm/C).
This kind of highly accurate and stable data helps to tailor the dataset for machine learning model, improving
accuracy
and reliability. It ensures that algorithms draw correct interfaces as the accuracy of the machine learning
model is
directly proportional to high-quality data.
Smart Analog Integration
Another bigger advantage of NAFE33352 is the analog integration that would help to reduce the overall form factor
of
such industrial IoT devices. NAFE33352 integrates the DAC to create the complex waveform that is needed to bias
the
electrode in the solution. It also has a voltage sense amplifier that can read this voltage and then send the
bias
signal to the power amplifier, connected to the DAC.
The universal i/p or current sense amplifier can be used to read the current generated by an electrochemical
reaction,
eliminating the need for a transimpedance amplifier.
Figure 2: Diagram showing the analog integration, helpful for compact industrial
IoT devices.To better experience, download the
image.
Diagnostics and Calibration for Predictive Maintenance
NXP's NAFE family supports a variety of internal diagnostics to enhance the hardware fault tolerance. pH meters
require
real-time and intelligent sensor diagnostic and management for continuous and stable pH measurement. Predictive
calibration helps to identify when the pH sensor needs to be calibrated and its remaining lifetime.
NAFE33352 offers advanced diagnostics features for self-condition monitoring as well as system-level condition
monitoring. In addition to typical open and short detection, it offers input underrange and overrange detection,
voltage supplies range monitoring, thermal shutdown and monitoring with global alarms for different anomalies in
the
system.
This part is also supplemented with factory-calibrated coefficients (CAL). The coefficients will be calibrated at
the
NXP factory and stored in the nonvolatile memory. The user can perform end-to-end self-calibration.
Speed Up Design of Fully Software Configurable Ph Meters Using KITNAFE33352-EVB
KITNAFE33352-EVB a work in progress board that will be released soon, enables the quick evaluation of NXP’s Analog
Front End NAFE33352. This solution illustrates all
essential components for designing NAFE33352 based system designs. It speeds up your development cycle with readily
available LPC54S018 MCUXpresso SDK drivers and a GUI for evaluation.
The NAFE33352 evaluation possibilities will be soon expanded by the NAFE33352-UIOM which is a software configurable
input and output AFE Arduino® shield board. The shield board supports quick evaluation and plug-and-play
compatibility
with NXP's FRDM-MCX development boards. The FRDM-MCXN947 is a compact and scalable development board for rapid
prototyping of the MCX N94 or N54 MCUs. This NAFE33352-UIOM and FRDM-MCXN947 solution is unique as it illustrates a
compact system design approach.
Not limiting itself to only hardware flexibility, the NAFE33352-UIOM solution brings MCUXpresso SDK drivers and
reference applications to speed up your software development. MCUXpresso includes all the tools necessary to develop
high-quality embedded software applications. All the codes with detailed instruction guides are available at the
application code hub (ACH).
Longer term availability is crucial for industrial applications and the NAFE33352 series is part of the NXP
Product Longevity program.
Cleaner Water with NXP
In conclusion, having an ability to provide reliable, accurate data, software-configurable compact design, with
inherent
calibration support and diagnostic capabilities enables the most efficient next-gen edge-AI supported water quality
analysis designs. NXP's NAFE
family plays a key role in developing these types of edge-AI ready designs.