pH probes, optical polyaniline sensors, and conductivity measurement for chemistry, biology, and water-quality monitoring.

Acidity and alkalinity of a solution are measured in a unit called pH (potential of hydrogen). It is measured on a scale of 0 to 14 with 0 being the most acidic, 7 being neutral, and 14 being the most alkaline. This scale is a logarithmic scale, meaning a pH level of 4 is 10 times more acidic than a pH level of 5. This characteristic is measured based on the content of hydrogen (hence the name) in a solution. The more hydrogen present, the more conductive the solution is and therefore the greater electric potential it can produce. Based on this characteristic, a simple method for determining pH can easily be implemented, and that would be through measuring the voltage of a solution.
The sensor that does just that is known as a pH probe. Within the probe is contained both a positive and negative probe, which collectively work as the main probe overall. When the sensor is placed in a solution, a complete circuit is created by the presence of the positive probe, the solution, and the negative probe. Then, based on the voltage produced by the circuit, the pH of the solution is easily determined.
The sensor does not come, however, knowing immediately how to correlate voltage with pH. Therefore, it must be calibrated, and this is done by placing the probe in various solutions of known pH. Once calibrated, the probe is ready to be used in neutral, room temperature conditions. If other variables are introduced to the system, such as pressure and heat, recalibration is
Another form of pH sensing comes through a somewhat newly-developed sensor, which determines pH of a solution optically by use of a polyaniline film. Optical detection of a fixed pH is achieved by observing the amount of absorption of the film at a fixed wavelength of light through the solution, or by varying the wavelength to determine the maximum wavelength absorbed. A change in pH corresponds to a change in the color of the film.8
8 Su, Yongxuan, et al. “An improved optical pH sensor based on polyaniline.” Sensors and Actuators B: Chemical, Volume 71, Issues 1-2, Pages 118-122. 2000.
Recommended DAQ
Recommended DAQ: Nyquist 2
pH probes output mV-level signals that benefit from NQ2’s 24-bit resolution. Calibrate against known buffer solutions before logging in your application.
Code example
The DAQiFi Python SDK exposes a property-based API. Below is a minimal stream — discover the device, enable an analog-input channel, and print samples at 1 kS/s.
from daqifi import DAQiFiDevice
with DAQiFiDevice.discover_first() as dev:
dev.channels.ai0.enable()
for sample in dev.stream(rate_hz=1000):
print(sample)
For C#, Java, LabVIEW, or Node.js examples, see the open-source stack page or jump straight into the reference example app on GitHub.
← Back to Data Acquisition Wiki · Browse DAQiFi DAQ devices → · Open-source stack →