Show HN: AnyLeaf – PH Sensor for Microcontrollers
anyleaf.org
anyleaf.org
Their datasheets are spectacularly well designed and clear! https://www.atlas-scientific.com/files/pH_EZO_Datasheet.pdf
Same with ADCs; the signal in not particularly high-frequency.
What am I missing?
MSFET3330 for example is a pH sensor, but try finding someone to sell you one.
Short of a system that takes samples and feeds the probe, and can calibrate automatically, how do you measure pH in-system long term? Is there a special kind of probe that stays in calibration for longer?
There might be a clever way around this, like with a tech other than glass electrode, or some type of automation system with motors that raise and lower the probe into calibration solutions.
Something interesting: pH electrode response is nearly linear, and you can make the transfer function using entirely 2 (or 3 to compensate for non-linearity) calibration points. (voltage, pH, temp) No arbitrary coefficient required, other than maybe temp compensation.
Edit: I wonder if your sampling idea could kill 2 birds with one stone, if implemented well: By sampling using a mechanical system, you could measure regularly, and calibrate. Auto calibration, and avoid the lifetime reduction from immersion. Eg some type of motor/pump system connected to the electrode.
An additional problem I've seen is that the temperature sensor for compensation is almost always supposed to be on the circuit rather than in the probe or external. Which is fine in some applications but useless for example for heated aquariums.
If you don't want to recalibrate the probe all the time you probably need to figure out a solution to have the probe in a compartment that gets flooded with clean water vs sample fluid.
Probably too expensive to be practical.
For temp compensation: I'm not sure the best approach. Temp dependence is loose, so you can get away with a reasonable temperature error for most applications. I went with on-circuit air temp sensor, with the ability in the drivers to feed in an offboard value. This is a reasonable approximation in many cases, but as you point out, for heated tanks, large ones, in-ground ones, or open bodies of water etc, you need to measure water temp directly.
Edit: Did not notice you were OP! Do you have more clarity on the calibration? Is there a buffer solution you can recommend?
I don't have a specific recommendation, but have been using this myself. More expensive than ideal: https://www.amazon.com/Biopharm-Calibration-Solution-Standar.... The packets are cheaper, but require you to have distilled water.
[1] https://www.amazon.com/DIY-Hydroponic-Gardens-Inexpensive-Gr... [2] https://www.lettucegrow.com/
I suggest you take the three benefits you have below the headline (affordable, precise, easy to use) and rewrite the copy by expanding on the benefits. Also use the examples listed. Like, how is this a great buy for a home brewer?
I don't need perfect accuracy, and checking it manually isn't overly time-consuming. It IS tedious enough that I only check it about once a week though, and I'd prefer to be checking it more often. And bonus points for being able to automatically track it & easily graph it, too!
I’m hoping these will be good enough.
How would you do that with the example code?
With the example code, you'd insert into the buffer solution, then run (for example, in Python) ``` # place in buffer of nominal ph of 10 V1, T1 = sensor.calibrate(CalSlot.ONE, 10, OnBoard()) # place in buffer of nominal ph of 7 V2, T2 = sensor.calibrate(CalSlot.TWO, 7, OnBoard())
Then save V1, T1, and the buffers you used to a file, your database etc. Or just write them to your `py file.` The MyCodo version, for example, handles that automatically.
Then next time you run, load sensor.calibrate_all( CalPt(0.,7., 23), CalPt(-0.17, 10., 23) ) If you just edited the file. Or those values would be loaded from a db.
I'm using it for a basic application and only roughly calibrated it with paper tests using tapwater and vinegar. I'm only measuring between ph 5-8 and my application doesn't really require precision.
For hydroponics (where 0.1 pH is plenty of precision and pH range should be inside 5-8), I was quite happy with the $14 version below.
https://www.aliexpress.com/item/32957428276.html?spm=a2g0s.9...
The latest data: Comparing two probes manufactured in the same batch, one immersed in a hydroponic solution, and one with periodic measurements. 3 months in, the immersed one has drifted by about 0.3 pH after the first 2 months; fixed by calibration. Another 0.1 in the third month. I don't have a good answer for long-term life, but hope an immersed one will last at least a year, and one used for periodic measurements for several. Older probes require more frequent calibration, have slower response, and might experience jitter.
https://metrohm.blog/2020/01/27/common-mistakes-ph/
https://metrohm.blog/2020/07/06/best-practice-sensors/
Notice the Separate pH Electrode is properly stored in distilled water:
https://www.metrohm.com/en/products-overview/60150100
The corresponding Separate Reference Electrode is properly stored in the same fluid as its internal electrolyte:
https://www.metrohm.com/en/products-overview/60733100
Neither of these storage fluids are an actual pH buffer.
Stored separately like this to maintain readiness while unpowered, the electrode pair is repeatedly rinsed and handled using referee technique to freshly update its electronics and/or software to reflect the response of that particular pair to agreed aqueous pH values by comparison to standard buffers.
This can be considered a _neutral_ baseline from which dissimilar sample matrices can give a most reproducible lab reading, regardless of the functional interference of the specific matrix with absolute accuracy over the short term or the long term.
Ideally under laboratory conditions the referee electrode pair's response shows insignificant drift beyond the needed precision over a longer-than-needed term, and the electronics an order of magnitude better at least.
It's not impossible to have good reliable readings over a year's period with clean samples in industrial use, without need to recalibrate.
A combination electrode can be handled in a referee way for good performance too, but they are usually stored in a buffer, so instead a separate glass sensor living most of its life in DI water is the theoretically better baseline device to achieve commonality between labs, especially with unknown or matrix-affected samples.
Once your laboratory technique, referee electrodes, and calibrated electronics can be operated as your most reliable _reference instrument_, then representative samples of the process fluid can be taken to the reference lab the regular way.
It is not usually preferred to remove a process electrode and calibrate for it the laboratory way.
Just correct for any deviation the continuously immersed electrode shows at that time when responding to the same particular fluid as the Reference Instrument does to a representative sample.
The Reference Instrument is calibrated against the Primary Standard (the Standard buffers).
The working process instrument is calibrated against the Secondary Standard (the Reference Instrument). Specific provisions can be made to validate beyond the process range.
Routine continuous service process electrodes do not have to be the high-dollar research kind, and referee lab work can be be done with less costly electrodes than Metrohm.
An aged continuous process electrode, well stabilized by a limited-harm matrix can be more stable than a brand new replacement even if, or sometimes especially if its responsivity has been reduced compared to a new replacement. However there needs to be enough quality analog gain to compensate, and to further reduce jitter appropriate high-impedance shielding and vulnerable removable connections having electrochemically compatible metals or platings without harmful corrosion. Metrohm electrodes and their removable cables are both gold plated at the electrode and have o-rings which protect from laboratory vapors once connected. The other end of the cable where it conects to the instrument matters too. Lag from old electrodes can still sometimes be a problem but also sometimes the least of your problems.