Introduction and goals
This is a pH meter with temperature compensation and digital readout (but no microcontroller): plug a standard glass-electrode pH probe into the BNC jack and use it to measure the pH of a solution.
This project is part of Hackaday's 2023 Op-Amp Challenge to create some kind of precise, creative, or classic circuit that uses op-amps in 8 weeks. Here we use an lmv358a op-amp to amplify the signal from a pH probe and then display it on an LCD via an 7106 "3 1/2 Digit A/D Converter". No software.
Two potentiometers allow for 2-point calibration of the probe. An optional temperature probe (just an NTC soldered to a 1/8" audio plug) provides some temperature compensation. The prototype PCB (drawn in KiCad and manufactured by JCLPCB) fits into a nice off-the-shelf enclosure from Polycase complete with 9V battery holder.
The up-to-date KiCad schematic and other files are available on github:
Rendering of top and bottom of PCB (see below for some photographs):
What is all this pH stuff anyhow?
pH is a standard scale from 0 to 14 that measures the acidity (hydrogen ion activity) of a solution. Low values are acidic, high values are basic, and a pH of 7 is neutral (like pure water). The pH is defined as the negative log of the hydrogen ion activity, so each pH value indicates 10 times greater hydrogen ion activity than the next biggest integer value. For example, a pH 6 indicates 100 times the hydrogen ion activity of a pH 8.
pH has a wide range of applications in industry and DIY experimenting. In my case I have a garden bed that I mulch every year with pine needles from a nearby pine tree, which I've heard can make the soil more acidic. The idea that pine needles can measurably alter the soil acidity is apparently a common misconception, but either way I'm curious to measure the pH of my garden.
See also Wikipedia's Soil pH.
The standard way to measure pH is with two electrodes: one kept at a reference pH and a lithium-implanted glass electrode put in contact with the solution to test. The hydrogen ions interact with the glass electrode and the voltage generated between the electrodes is (inversely) proportional to the pH of the test solution:
pH is pH of test solution
V is voltage across the probe electrodes
F is the Faraday constant = 9.648533e4 C/mol
R is the molar gas constant: 8.314510 J/K*mol
T is temperature in K: 273 + degrees C
This means that at 25C, each change in pH is proportional to 59.13mV for a full-scale input of +/- 414mV.
Additionally, the relationship between pH and voltage changes with temperature (at higher temperatures the same pH produces higher magnitude voltages). Figure 2 of the app note AN-1852 Designing With pH Electrodes illustrates the relationship between voltage and pH well:
Another useful app note is CN-0326 Isolated Low Power pH Monitor with Temperature Compensation
pH probes can be expensive and even good probes need to be calibrated regularly and only last for a few years of use. More expensive probes are more sensitive (faster response time), more accurate (better reference electrode), and are built to last longer. The probe I bought to test my pH meter with is the "Lab Grade pH Probe" form Atlas Scientific. However, less expensive probes are available from places like amazon.com and probably fine for most home and hobbyist use cases.
A pH meter takes the voltage from a pH probe and displays it to the user as a pH value. This usually involves amplifying the voltage, reading it into a microcontroller via an ADC, calculating the equivalent pH, performing calibration and temperature compensation on the value, then displaying it to the user.
In keeping with the analog-centric nature of the op-amp challenge, I thought it would be fun to avoid microcontrollers for this project. This often means saving time on writing code and spending more time learning how to...Read more »