I love the formatting, pictures, and cautions. Good visual flow too. I'm a bit surprised it doesn't go into the technical aspects of what's going on with the transfer functions, which op-amps/ADC are used etc.
Aren't op amps sort of interchangeable here? Provided the correct temperature compensation, they all are highly linear, have a few MOhm input impedance, etc.
Same with ADCs; the signal in not particularly high-frequency.
OP, I realise AnyLeaf uses an electrode, but you're probably well-placed having considered it to answer my Ask HN [0] that didn't get any traction: why aren't (seemingly) ISFETs/BioFETs available to hobbyist/small-scale customers?
MSFET3330 for example is a pH sensor, but try finding someone to sell you one.
Haven't worked with these specific sensors before but I've worked with some microfluidics and other exotic ICs and in my experience, most niche sensors usually need to sell thousands to break even on the support cost of getting even one customer up and running with just a tweaked reference design because the engineers have a lot of competing responsibilities. Oftentimes these manufacturers are also competing for fab time against ICs with a cheaper setup cost and higher volume so theres extra pressure to get together as many big orders as you can, otherwise the extra setup overhead drives the cost through the roof. Hobbyists and small customers would drive most of these niche fabless companies to bankruptcy
I wonder if there could be an open source support option for some of these. Sell small lots for 1000% of fab cost, provide only a datasheet and host a forum. A reseller willing to take on some inventory risk could easily do this.
Maybe someone with more experience than myself can chime in. At a previous startup we used regular pH sensors, from Atlas Scientific (exactly like the ones in the article), submerged in a tank of nutrient water. After a few days (a week tops) they would drift out of spec, and would need to be taken out, re-calibrated, and put back into the process.
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?
I don't think there's a way around periodic calibration if you want precise measurements. At least not with normal glass electrodes. If the precision requirements are loose, you could go months between calibration. If you're trying to get within 0.1pH, every few weeks or so. For anything that's going in a scientific paper, calibration before every use is important.
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.
No idea. Sounds awesome. Might be a higher quality probe, or one designed with low drift rate in mind, given its marketed as an industrial probe. That length doesn't specify how much drift is expected, so it's unclear what tolerances that has in mind.
I don't think it's the quality of the probe so much as whatever is in the fluid you are measuring. There are simple reactions going on and much less simple ones, including biological stuff accumulating.
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.
I'm wondering how feasible it would be to make a system with 3 pumps, and holders for ion-selective probes (pH, ORP etc). In an automated process, flood with sample; measure; evacutate; flood with water to clean; evacuate; flood with KCL to store.
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.
Kind of excited for this because I wanted to get into hydroponics but a huge deterrent was an affordable and accurate PH sensor. Would be cool to see an example of this being pushed to some "IoT platform" like Adafruit IoT.
I'm working with the creator of [Mycodo](https://kizniche.github.io/Mycodo/) on a PR to get it added there. I don't have much experience with Mycodo, but it seems like a nice consolidated platform for measuring things and sending outputs from a Raspberry Pi server. It's an open-source project mainly run by one guy, who's very attentive to issues and PRs.
This is so awesome! I really love the nonsoldering setup (it's not hard to solder, just annoying in a small apartment with kids). I'm going to see if they're equivalent parts with Qwiic / STEMMA connectors instead of header breakout.
Edit: Did not notice you were OP! Do you have more clarity on the calibration? Is there a buffer solution you can recommend?
Hopefully my reply to xupybd above should share light on calibration. The device doesn't have onboard memory, so you use the software to get calibration data, then save it to either your program file, or save/load to a file, memory, db etc depending on your setup.
What's so hard about pushing this sensor reading to Adafruit/any other IoT dashboard? You're either sending a mqtt message or POST, regardless of where the sensor reading came from.
I should of clarified, it would of been nice to see an example using an ESP variant (since its cheaper and has wifi) pushing to an IoT dashboard. I haven't looked into the class file and how easy it is to port to micropython/cython.
I don't know about micropython, but I've developed a commercial product with the ESP32 IDF. There's a ton of example code for mqtt and REST included in the SDK.
Haven't tested on ESP, but that would be a great idea, given its ease of use with IoT/connectivity. I've only tested on Arduino, Raspberry Pi, and STM32.
I really enjoyed this book as a beginner[1]. I was seriously thinking about getting this [2]. For the price, it seemed very reasonable compared to making my own. I would of gotten it if I live in a more permanent location. I got an Aerogarden to try out but the light is so damn bright. I don't have any place in my apartment that fits it without blinding us throughout the night.
I also considered a Lettuce Grow (beautiful industrial design). Ultimately, I went with a Mr Stacky Smart Farm instead, which is significantly cheaper: https://www.amazon.com/dp/B06VSHBNXS/ref=cm_sw_r_cp_apa_i_bH.... Would recommend it, have had great success so far.
This is such a nice thing to market because you can laser focus on niches. However, the copy on this landing page reads like a technical specs sheet.
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?
Another niche: swimming pool owners. Although it’s only worth it if I can link it to an action eg add acid but that feels a bit dangerous for diy project! Maybe a sms to add he acid and how much is good enough
FWIW, I purchased it for exactly this reason. My goal is to end up with a URL that I can hit on my LAN that tells me the PH of my pool.
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!
You might be right. What I might buy for say $50 or so is something that tests my water and tells me what to do. It’s need to be ready to go, not make it myself. This saves booking time to get the water tested at a shop. I don’t want to test using a kit as I don’t trust myself to sue it properly.
I have a fairly automated hydroponics system but I haven’t yet started with always submerged ph sensors due to the cost. I’ve seen cheap ones but from what I understand they are so inaccurate as to be useless. Most people seem to recommend atlas.
If you know the substance you're testing the pH of can't you infer the pH from some other property? Like maybe pH goes with the square of resistivity or something??
Inspired by the recently gone viral “digital pregnancy test just reads a pregnancy test strip,” I wonder if you can get around the calibration issue via some sort of electromechanical pH strip autoloader and analyzer.
Can someone explain the calibration code. They enter calibration points. Wouldn't you then need to calibrate the sensor with solutions at those PH levels?
Correct. You need solutions at those levels. As sovreign said, they're typically available at levels around 4, 7, and 10.
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.
Typically with ph sensors like this you also get three ph packets(4.01, 6.86, 9.18) which when mixed with distilled water get you a baseline ph for calibration.
I went deep down the Internet rabbithole on these HOCl cleaning solution machines (I still can’t figure out if it’s bs or not), but a big component was ph testing the solution you make. Now I kinda want to pick one of these up, some simple logic that measured ph and switched off power to the HOCl machine when it hit the right ph would probably sell extremely well
I was surprised that this doesn't seem to be the case - For example, I can't find any pH sensor on Adafruit. There is a model that's easy to find on eBay or Amazon, sold under various brands - I was unable to get this working, likely due to documentation or software issues.
I'm using "Aquarium Hydroponic PH Electrode Probe/Liquid PH Value Detection Sensor" on ebay for $36 with probe. It even came with example code.
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.
I picked this sensor somewhat randomly on Aliexpress and it seems to work well (with calibration on both, tracks closely to my commercial Nutra-Dip Trimeter).
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.
Unknown - I'm testing them, but can't provide data longer than the time since start. They're double-junction, which helps with logevity by slowing contamination of the internal KCl solution. My intent is to have them used for continuous immersion.
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.
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.
I can post the design if you'd like, although it's easy to tell from the datasheet, which lists the main parts. It uses a pair of AD8603 op amps feeding the differential input of a TI ADS1115 ADC. The intent is to use the op amps in a unity gain config, to deal with the probe's high impedance.
Their datasheets are spectacularly well designed and clear! https://www.atlas-scientific.com/files/pH_EZO_Datasheet.pdf