I don´t use arduino. My Hardware setup for pH-Measurement is
Raspberry pi zero/w
Grove Base Hat
seeed PH Sensor Kit (E-201C-Blue)
Using this setup it was nearly plug-and-play for the pH-Measurement.
For Temperature Measurement I use a DS18B20 Temperature Sensor, connected via 1-Wire to GPIO. LCD Display and Button are connected to I2C and GPIO, but will be replaced with grove-components and will be connected to the Base Hat in the next Version.
I was curious about the large tablet-like screen shown in your first picture. That looks awesome and if it uses i2c, that would be totally wizard for my 'bot.
The large screen is my iPad showing the dashboard , sorry to have to disappoint you there.
Ups, I just noticed that some of my posts are now hidden because I have a tendency to post links to the components I used. This seems to look like advertising for the forum community here. Sorry, I wasn´t aware of the guidelines and will stop including links from now on.
I reviewed the postings you created and, (IMHO), there’s absolutely nothing wrong with them. The comments and links were relevant, they referred to accessories you used to complete your project, and provided guidance about what you did and how you did it.
I would strongly suggest that these postings be un-flagged because they were not “blatant advertising” but were relevant links to materials used - no worse than links in earlier posts about the LIDAR units used on some of the GoPiGo robots, or books on ROS that people here acquired and are using for their own experiments.
I, myself, have included links to Adafruit’s site when discussing adding a RTC to the Pi. I provided both links to the product I used as well as instructions on how to configure it. This is essential information. How can you attempt to duplicate my work if you don’t know what materials, (or code), I used?
If there’s been a policy change, I don’t know about it and it hasn’t been advertised on the forum. (I monitor all new messages.)
I don’t know who flagged your postings, (I suspect they were flagged in error), and I am going to ask @cleoqc (et. al.) to step in and review them.
As it turns out, my probes were just fine. I don’t know why my readings have been so unstable. I can’t get any of the sensors to give me a stable calibrated reading. I’m anxoius to see how @DocDrum does with the pH referance solutions. I could get a steady reading with the Grove sensor with pH 7 but as soon as I tried pH 4 my readings were all wonky.
I do know that the probes have to be kept wet. As stated above by @DocDrum , they are in a KCL solution for storage and must be maintained in that when not in use. I was told that if they are dry, they will not maintain accurate readings.
As with my project, when you’re dealing with organics, you will need to recalibrate them on a semi-regular basis.
@DocDrum Thank you for continuing on with this! It gives me hope that I might be able to try going back to that device once I get things done. Also I apologize for not getting to post the code. The code you ended up finding was the code we used before. I also believe it was posted here too. Good luck!!
Maybe, just maybe, (as a previous poster said), the probes are environmentally sensitive. If they were allowed to get too cold and/or freeze, that’d explain everything.
Since your probes were all over everywhere, and @DocDrum’s readings were rock-solid, something has to be fishy somewhere. My first guess would be the probe.
first field test in the aquarium: if the fish survived what I measured they would be really tough. The pH readings were far to low (as low as 2.5), something is wrong here …
retesting with tap water: everything is fine (pH 7).
I know that pH is affected by temperature, the water in the aqarium is at about 28 degree celsius, but that can´t be the reason for this readings. I´ll contact an old colleague, he might still have access to the lab in the pharmaceutical company I worked once. Maybe he can get me some standard buffer solutions, I think I´ll have to try to calibrate the electrode.
You can go to a pool or aquarium shop and get a pH test kit. That should allow you to standardize solutions close enough for what you need. You can also test the aquarium water - who knows, it might really be that low!
P. S.
Get an aquarium ammonia test kit too. If the ammonia is too high, that could be throwing your readings off.
My Girlfriend tests the water regularly with test stripes (after all it´s her aquarium ) The pH is OK there, but I will see what I can get in our aquarium shop, good idea.
Don´t look to closely at the case, it was all hack and slash with a kitchen knive getting those cutouts made , I´m glad I still have all my fingers …
It could be a matter of changing the offset and slope of the PH curve.
Since 7 is right around the center, you could measure your tap-water with the PH kit, adjust offset to the correct value, and then measure at both ends, (vinegar and baking-soda should be good titration chemicals), use the PH strips as your standard, and adjust the slope to put both ends at (or near) to where they should be.
Since you appear to have a good probe, it should be nothing more than calibration to “standard” solutions.
And since you don’t need incredible amounts of accuracy, (this isn’t rocket science or drug research), commercially available test strips should be fine.
Is this fresh or salt water?
It’s been years since I had aquariums, (yes, plural), including a huge one with a gigantic Pacu in it that ate feeder goldfish. All mine were fresh water.
I am having the vendor (not Seeed) send me a new probe. I’m hoping that resolves it. I had ordered a new probe a while back but when I went to test it, I accidently broke the bulb in the bottom of the probe. The new probe SHOULD arrive free of cold weather and or other environmental factors that may interfere with it’s effectivacy. We’ll see what happens!
@DocDrum That’s a nice looking project. Great job!
Where’s it coming from? Hopefully if they fly it in it’s in a (at least somewhat) pressurized and heated cargo compartment!
Heck. . . they say “Third time’s the charm!”
My curiosity is riz, let me know what happens when it arrives.
You’re right about one thing, Doc’s rig there is one sharp looking cookie. Phenomenal job for what she thinks is a hack-job. I’ve seen commercial stuff do worse.
One BIG thing I forgot to mention that I discovered…
Did you know that the blue probe has a built in temp sensor? I bet you did not. It does! I put that probe on the board provided by the company I am using now and it reads temperature just fine and is accurate.
They use the voltage reading to calculate temperature. If you go to the Github page provided above you will see how they do this. It may be handy for some folks to do. He has options in his code to read temperature from an additional sensor as well. It’s all worth a look.
I’ll let you know what I discover here later in the week.
@mountbaldybrewing : Well I never knew that, this is well worth a deeper look, thank you for the link. I will try that.
This fits nicely with my discoveries: as soon as there are changes in the temperature my pH-readings go haywire and I thought about coding some corrective factors for temperature. My testing cup stands on my window sill and as soon as the sun comes round and heats the water the pH-values tend to become unstable. As I said, I know pH is sensitive to temperature, but not in the amounts I saw when testing in the aquarium. So all in all thanks for your appreciation of my project, but the usability in the aquarium seems to be still far away.
In my search for a good way to calibrate my electrode I stumbled over pH-teststripes, testkits containing universal indicators and finally a digital pH testing device for less than 20 Euros which comes with a temparature compensation and calibration solutions . Plus: it can be used to measure the pH of beer . I tend to buy this gadget, just to have a reference for the readings of my probe. So I will end up with two cheap chinese pH electrodes and spend more money, but this project is more of a how-the-hell-works-this-nature anyway .
Edit: just had a quick look at the anyleaf code. I´m curious if this will work when the pH-Probe-board is connected via the grove-hat? As far as I can see the code expects a direct connection to the I2C-Ports, but I really had just a glimpse of the code.
More edit: as far as I understand the anyleaf code the temperature sensor is on their board and not on the electrode itself. Furthermore the datasheet states that they do temperature compensation in the software with a coefficient which is what I thought of too. Have to dig deeper into this …
Last edit : feel free to have a look of my data at IO - Adafruit. You can observe nicley how jittery the pH-readings become when there are temparature changes …
I never knew that pH was so sensitive to temperature. If that’s the case, than how do pH test strips and test solutions, (like the kind for testing pool water), work?
Obviously you don’t test in the dead of night during a frigid Siberian winter where the solutions have icicles, nor do you test the steam coming off of the solution in the middle of a hot Saudi summer, but for us mere mortals in more temperate climates, it shouldn’t be rocket-science. Neither should it require ±0.001° temperature accuracy to get a stable reading.
Correct me if I am wrong, but the last time I used test strips, or test solutions, they didn’t come with a small temperature probe hanging off the side.
That’s exactly my point: the relationship between pH and temperature is not that strong as I observe with my probe. Under normal circumstances (test strips for example) you do not have to bother about the temperature. Just to give you an idea: at 25 degree celsius the pH of neutral water should be 7. At 10 degree Celsius it is about 7.27, at 100 degree Celsius it is about 6.13. I was once able to calculate this, nowadays I better look it up in a table . The reason for this is that the equilibrium of the autodissocation of watermolecules depends on the temperature. OK, enough of chemical mumbojumbo, fact is: my electrode does strange things when the temperature changes.
Maybe there’s something wrong with me, but that makes perfect sense!
(And is what I would have imagined too.)
I can see three obvious possibilities here, (maybe there are more. . .), which are
This particular probe, for whatever reason, needs to be temperature compensated and only works correctly with a calculated temperature offset.
There is something screwy with the way you’re reading it.
There’s something wrong with the probe.
Solutions:
Create “standardized” solutions, (with buffers if possible), and take readings with both the test kit and your probe at several different temperatures for each solution. Then, create a table of offsets or derive a offset function (ft), that will correct the readings.
Figure out what you’re doing wrong, if anything.
Get a better probe, (assuming you’re using the Seeed Studio probe @mountbaldybrewing used)
As I have mentioned before, and I’ll say it again, I don’t trust Seeed Studio any further than I can throw Vladimir Putin under water.
I avoid them like the Coronavirus if at all possible, and if they are the ONLY source for something I need, I still think five or six times before buying it. Maybe I’m being a bit anal about them, but given my choice of paying $5 for something from them, or $25 for the same thing from someone like Adafruit or SparkFun, I’ll spring for the $25, since I know I’ll get a good product with excellent support.
In Germany we have a saying, I think it translates to something like: buy cheap, buy twice. I´m aware that the seeed probe I´m using is one of the cheapest around and therefore I shouldn´t expect high quality lab equipment. But it should still be possible to get some results at a constant temperature, so I wil start with calibrating the electrode with different solutions of known pH (test strips will be accurate enough for me) at a constant temperature.
Once this is done I will see if I can measure a neutral solution at different temperatures to get the correction factor for temperature.
All of this is more or less just for fun and interest, since I found this page today:
Here someone has built more or less the device I´m trying to build, complete with a nifty web-based frontend . Most interesting on this page is this
It is somewhat tricky to measure pH in volumes where immersed appliances leak direct electric current into the liquid. Due to the very high input impedance of the pH-probes these currents, even small, may impact the measurement and result in unstable or shifted pH value. This is the case with aquariums where immersed air or water pumps, heaters and lighting leak small electric currents through their insulating shells.
Aquarium owners or hydroponics enthusiasts interested in on-line pH-measurement may benefit of the functionality added by our HomeLab isolator module. When coupled with HomeLab-pH it assists the pH measurement by effectively filtering the interfering currents of the environment.
This might just be the effect I observe when putting my probe into the aquarium. I will check this by taking a sample of the aquarium water and testing it outside the aquarium where no freaky currents can interfere.
After all this is done I will see if it makes any sense to continue with this project or just tell my gilfriend that the test strips she is using right now are the best method anyway
If you can get a 1-1 isolation transformer, you can check that quickly, or - using your idea, take water out of the aquarium to test, you should know quickly if subtle currents are your problem.
Hey! @mountbaldybrewing, I wonder if you were experiencing the same issue?
And yes, in the U.S. we have a saying “buy nice or buy twice”. Russia says “Are we so rich that we can afford to buy cheap things?”
I took a deeper dive into the python code I found here and took the time to take some measurements. Got some pH strips from the pharmacy which only measure between 5.6 and 8 but for a first shot they are OK.
I changed my code so that it takes 20 measurements with 50 msec pause between the readings. The values become more stable but measuring an alkaline solution of household soda (pH according to test strips: > 8) is a complete desaster. If I just look at the raw values the sensor kit reads and don’t hassle with calculating voltages and whatnots I can easily see that the values returned when the probe is in tap water or in a solution of soda are nearly identical. Acidic solutions work better, I will do more testing when I have better pH strips with a wider range next week. These things are somehow hard to come by, stuff that stupid pandemic.
Conclusion: as @jimrh does’t get tired to say: you get what you pay for and this electrode only does half the job if any. It’s time for a beer I think, no make that two …