Grove - PH Sensor Kit (E-201C-Blue) Raspberry pi Zero

@DocDrum That is the same board I have. As @jimrh explained, Grove is simply a style of connector wired in a certain pinout. The Grove board just makes it simple to plug things in to the pi and provide Digital/Analog/I2C/PWM/UART connections easily. Yes these are all already built into the pi. It just provides an easy way to connect things.

I am successfully using the TDS and temp sensors provided by SEEED. Their pH probe never gave me accurate readings. I believe it was a problem specific to the probe. I have used their probe on multiple manufacturers boards now and have had similar results. I believe my issue stemmed from the fact that the probe was shipped to me in the middle of Winter and likely experienced sub zero temperatures. I also believe the probe dried out (which will cause faulty readings). To exasperate things, the probe also never would ā€œcalibrateā€ properly as the voltage readings were never stable. If I get time, Iā€™ll test my new probe on the arduino and test my therory.

That said, I DID get the AnyLeaf sensor and probe to work this morning on a raspberry pi zero. The developer is currently fixing the code for the arduino for the AnyLeaf sensor. For more information on AnyLeaf sensors, check this link out. AnyLeaf sensors

I believe the code we had posted in this thread was working. I believe my issue with the faulty unstable readings was more of a function of a faulty sensor. Do give this a go. I think you may be able to get things working.

My project is at the tail end of things and I have now spent more time and money on to try and save a buck. I should have purchased either the Atlas or AnyLeaf sensor from the begining. Lesson learned, you get what you pay for.

I do wish you all the best of luck in your efforts. I do still have a ā€œworkingā€ version of the code. I can repost it here ifyou would like it.

1 Like

Quote from the package:
Supply Voltage 3.3V/5V
ā€žIt can work with both 3.3V and 5V systemā€œ

Output voltage is not mentioned anywhere. The Input ports on the HAT however are labeled 3.3V. Looks like Iā€˜ll have to risk it ā€¦

1 Like

When I connected things up I just plugged the hat into the GPIO pins on the pi. It has been up and running the sensors I mentioned for the past few months with zero issues.

1 Like

Thanks a lot, I would be grateful for a repost of the code. Iā€˜ll try to calibrate the probe, but without standardized buffer solutions this will be tricky. First go will be distilled water which should give a pH of 7. I wonā€™t spend that much money on this project, since itā€™s more of educational use to me. The aquarium I would like to monitor is a simple beginners fish tank, nothing exotic so no lives depend on an accurate pH there.

1 Like

Well, well, well ā€¦
Plugged everything together, took @cyclicalobsessive code from way above here and this is what I get from the buffer solution the electrode ships with:

Detecting PHā€¦
PH Value: 6.5
PH Value: 6.6
PH Value: 6.6
PH Value: 6.6
PH Value: 6.5
PH Value: 6.6
PH Value: 6.5
PH Value: 6.6
PH Value: 6.5
PH Value: 6.6
PH Value: 6.8

Exitingā€¦

Not to bad, I would say. Plus: number of fried Raspberry-Pis: zero :grinning:

Now where was that vinegar to do some testing of acidic solutions :thinking: ā€¦

OK, edit:

Tap Water (donā€™t have deonized or distilled water here) gives a straight 7.0
Adding a dash of vinegar: pH drops to 5.4
Washing Powder in Water: pH goes up to 7.8

The chemist in me is happy, I will get distilled water after the easter holidays or try to get my hands on some buffer solutions for finer calibration.

Next steps: try to integrate this sensor into reef-pi (https://reef-pi.github.io/) or code something to record the values and show some nice dashboard.

4 Likes

The supply voltage tells you what the logic levels are. In this case you can use it on either a 3.3v system, (like the Pi), or a 5v system (like the Arduino).

So long as the ā€œsupply voltageā€ is the same, youā€™re golden.

I really do have to take a moment and endorse what @mountbaldybrewing said about ā€œgetting what you pay forā€. Ā If youā€™re doing this ā€œjust for the Sh*ts and Grinsā€ of it - then please experiment and let us know what happens. Ā However - if you really want to accomplish something and not just be jerking yourself around, you may want to go with a proven ā€œsolutionā€ (:wink: Ā Bad pun, given the context.)

I, myself, tend to go ā€œall lobsterā€ stubborn on a project, invest major time and money, only to find out that had I spent a few extra dollars at the inception of the project, it would have taken 30 minutes instead of three months.

Far be it from me to tell you what to do or how to do it, but - since you are at the project inception stage - you may want to take a step back, a few deep breaths, and think carefully about project goals before going down what may be a rabbit hole.

Of course, Iā€™m the pot calling the kettle black here with that one - I do the same thing all the time!

1 Like

Maybe this has nothing to do with it at all, or maybe it does, but (unfortunately) the Raspberry Pi Foundation isnā€™t exactly a Gold Medal Winner when it comes to compliance to established specā€™s.

Viz.:

The ā€œhardwareā€ i2c interface on the Raspberry Pi has been plagued with The Infamous Raspberry Pi Clock-Stretching Bug as noted above and is why Dexter/Modular Robotics wrote their own software-based i2c libraries.

Is it Raspberry Piā€™s fault? Ā Especially since this seems to go back to The Dawn Of Time with no hint of a resolution, this may actually be a Broadcomm hardware issue as opposed to a balls-up by the Raspberry Pi people. Ā Regardless of whoā€™s to blame, itā€™s something to be aware of when working with i2c on the Pi.

1 Like

Thanks for your thougths.

If youā€™re doing this ā€œjust for the Sh*ts and Grinsā€ of it - then please experiment and let us know what happens.

This wraps it up nicely, it is really just a fun project. If I end up with something: fine. If I donā€™t I sure will have learned a lot on the way.

2 Likes

I noticed this after I posted my reply. . . . Ā Sounds like youā€™ve got a winner!

(side note to @mountbaldybrewing: Ā I never knew that pH probes could ā€œfreezeā€ or ā€œdry outā€. Ā Thanks! Ā It appears yours did both - freeze-dried pH probes?)

You are obviously doing much better than he was, his readings were all over Hell and Half of Texas, and thatā€™s BEFORE he connected power! (:wink:)

Seriously, itā€™s nice to have someone to validate his assumptions and conclusions about his probe having issues. Ā Total respect and many thumbs up!

I donā€™t know where you are, (the interesting lower-and-upper quotes in one of your replies has my curiosity riz, as the mountain 'folks Iā€™m related to used to say. . .), but here in Russia they sell a nearly 80% ā€œvinegar acidā€ (acetic acid) in the grocery stores thatā€™s used in dilution for making pickles.

Just glad to hear you seem to have it knocked.

2 Likes

Here in germany (hence the lower/upper quotes) we call it Eisessig, but I think I donā€™t need that stuff. And from my studies of chemistry some 20 years ago I recall that pH-electrodes are at least sensitive to dry out, so maybe @mountbaldybrewing just had bad luck with his sensor.

2 Likes

OK, thought IĀ“d give you an update on my project, @jimrh + @aemee. Iā€™ve got my prototype up and running on a pi zero/w. What does it do?

  • collects data from a temperature and a pH sensor every 10 seconds
  • displays gathered values on a small LCD screen
  • LCD screen can be switched on/off with a small button
  • pushes gathered values to an adafruit.io stream
  • data can be viewed on a dashboard

Considering that i havenĀ“t done anything with GPIO / Python / Cloud data storage / Sensors and Soldering until some weeks ago I think this is quite OK.

Next steps:

  • check if the pH-electrode can be calibrated a bit better
  • build a housing for all that stuff
  • deploy into live aquarium, right now the AquaPi measures values in a cup on my windowsill
2 Likes

I think itā€™s absolutely FANTASTIC! A phenomenal job!

Pictures maybe? :wink:

That being true, is there a way to re-moisten them and make them work again? What happens if you need to store them?

Back in (U.S.) high school, (think early to middle '70ā€™s), as a senior project I wanted to investigate the relationship between electromotive potential and PH. Unfortunately, getting a platinum reference electrode - or a tank of hydrogen gas - wasnā€™t trivial for a high-school student. I also wanted to investigate the relationship between extreme cold and ā€œstandardā€ semiconductor components like transistors and such. Cryogenic fluids like liquid nitrogen were also difficult to come by.

Sigh.

At least my teachers were sufficiently impressed with both the ideas presented and the test protocol I proposed for the investigation that I totally aced, (got top marks), for the project.

Just out of curiosity,

Does the instructions say anything about the PH of the shipping solution?

If not, then I would suggest, (though I donā€™t know for a fact), that the shipping solution is just to keep the sensor moist with the correct chemicals and it may not be meant as a ā€œstandardā€ or ā€œreferenceā€ solution.

Perhaps @DocDrum can elaborate?

Pictures maybe?

Your wish is my command:

As I mentioned: ItĀ“s a prototype, but it works fine. I think I will replace the display and the switch for it with components with a grove-connector. This reduces wiring and after all I already spent the money for the hat, so why not use it?

As for the pH-electrode, this is what i found in seeeds wiki:

The pH electrode is the most sensitive component of your pH instrument. And the pH electrode cannot be allowed to dry out or freeze. The proper maintenance will provide years of reliable measurement. So the pH electrode care and maintenance is no less important than calibration. Please remember: when itā€™s not in use, you should wash and keep it in the 3mol Kcl container. The 3mol KCL need you to prepare.

So my guess would be that the shipping solution is 3mol KCL, which should be fairly neutral (fits with my mesurements, at least).

That being true, is there a way to re-moisten them and make them work again? What happens if you need to store them?

My days as a student of chemistry are long gone and electrochemistry never was my favourite subject. As far as I remember the electrodes we used were stored in a buffer solution. It should be possible to ā€œwaterā€ a dried electrode and make it work again, but I donā€™t know what would be the best way to do this. I also wonder how long my electrode will work if it is permanent use within an aquarium. With lots of organic substances in the water my guess would be that I should plan for maintenance and cleaning of the electrode ā€¦

4 Likes

HOLY SMOKES!

That is a TOTALLY righteous setup!

If youā€™re going to re-package it, how about a Pi with the 7" touch-screen and an Element-14 case.

Do you have a repo where you store code? Iā€™m sure there are more than a few people who want to see how you did it - especially that totally cool-beanies dashboard.

Maybe you should send in an article about it to MagPi magazine? Iā€™d read it in a heartbeat!

Oh, I donā€˜t deserve much kudos for the dashboard. Adafruit does the work here, all I do is post my values and do a little bit configuration and layout. Iā€˜ll stick with a LCD display for showing the values, a Touchscreen sounds nice but would really be over the top for now.
Unfortunately I donā€˜t have a repo for code, Iā€˜ll post it here after some refactoring and integrating the grove LCD and Button.

1 Like

What kind of LCD display is it? Does it run off of the Piā€™s display port?

Just a small 16x2 LCD Display as seen in the picture above. The current one is connected to the I2C-Ports on the GPIO, the new one will come with a grove connector, so that I can plug it into the hat and also runs via I2C. I will have to use the seeed-Libraries to print values on the display I think, but I have those installed anyway for the pH-electrode.

1 Like

Iā€™d still send to MagPi, and maybe even to Adafruit, they love this stuff.

Donā€™t knock yourself or your contributions. Builders donā€™t necessarily cut the wood or make the bricks, but they still build the house!

Which screen? Iā€™m looking for an i2c display for my 'bot.

Total props and respect for you!

P.S.
If youā€™re going to spend any time with this stuff experimenting, you will need to get yourself a GitHub repo. Itā€™s almost like the name-badge at a conference. . . :wink:

Not to mention itā€™s cheap insurance against the dreaded ā€œtype, type, type, OH SH**T!!!ā€ moments. :face_with_symbols_over_mouth: :face_with_symbols_over_mouth: :wink: :wink: :wink:

1 Like