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

If you’re doing this as a fun exercise, for the S’s and G’s so to speak, that’s one thing and we all “go lobster” stubborn on projects from time to time.

In that case, enjoy learning about the finer details of process monitoring.

My concern was that this might be getting totally out-of-hand and you might be rapidly approaching the point of diminishing returns and potentially excessive risk and expense.

Maybe I’m missing something here, but it seems that this shouldn’t be this difficult.

Most of these sensors should be, more or less, plug-and-play - plug 'em in, perhaps do a bit of scaling in code to generate the precision you need, and away you go!

I fear that you may be wandering down that old bogus path, ultimately wasting time on something foredoomed to ignominious failure.

Another thought:
What is the spec’d voltage for this beastie? 3.3 or 5v DC? If it’s really-and-truly designed for +5v, 3.3v may be riding the ragged edge of inoperability. Sensors, especially A/D sensors, can be extremely sensitive to their power sources, doing bizarre and strange things as VCC drops.

Professional sensors go to great lengths to make sure voltages like VCC and Vref, (derived from VCC most of the time), are rock-solid, with generous filtering and decoupling.

Even if it is says 3.3v “should work”, if it wants, (or can use), +5, you might want to go with the higher voltage - if for no other reason than increased noise immunity and stability.

You might want to try running it at +5 and use a level-shifting i2c interface. I believe SparkFun has something that might work and plugs right in. Absent that, DigiKey or Mouser might be a good bet.

What say ye?

Hi all - I ordered this item this week for the PI given it said on the page it works, only to be informed by seeed support there’s no python for it! Surely it works if it works for arduino and it looks like you’ve had a good go at making it work. I’m told I can wire it straight to the pi with or without a hat but I dont see how it would work without a digital to analogue converter. I’m happy to experiment with code on mine as it’s a project not an industrial application so open to suggestions and hints

1 Like

Aemee,

The inference “if it works for Arduino, it must work for the Pi”, though technically correct does not mean that it’s a simple one-to-one substitution. Libraries may be vastly different. The version of Python, (or Wiring, which is what most Arduino sketches are written in), may be different or may implement various features differently than Python on the Raspberry Pi. In fact, if you want to code in a way that is closer to the way the Arduino programs, you may want to look into C/C++ and find a compatible compiler for the target processor on the board you’re programming.

Also!

“Grove” is simply a connector type with specific pins assigned to specific purposes. (i.e. Pin 1 is +V, pins 2 and 3 are signal inputs, and pin 4 is ground.) Not only that, but the value of +V, (for example), is defined by the board and circuitry it’s attached to. Likewise the two signal inputs. Some implementations may implement them as purely digital inputs, others may implement them as A/D inputs, and yet others may implement them as i2c signals. It all depends on the specific circuitry they’re attached to.

Another caveat is that, (in my humble opinion), Seeed Studios is not high on my list of “preferred vendors” as their compliance with established standards for interfaces and connectors is not always as good as other vendors.

Likewise, you have discovered that though Seeed Studios may produce interesting boards and such, their support is less than stellar - in many cases the actual coding and development is “left as an exercise for the student”.

It has been my experience that either Sparkfun or Adafruit supply both interesting circuits, and a wealth of support and learning. In fact, I was once told by one of the support people at Adafruit that the lady who runs Adafruit described her company as “. . .a school for makers and experimenters with a gift-shop at the end.”

Hopefully one of the people who have worked with this before will step in to help, but in great measure - especially with Seeed Studio materials - you may be on your own.

Feel free to try whatever you can, and report results - success or failure - and we will do the best we can to help you.

1 Like

@aemee

I was never able to get the SEEED Studio device to work properly. It works great for taking my temp humidity and TDS with those respective sensors. The pH sensor they have for pi is bunk and SEEED studio is no help.

On that note, I bought an Atlas OEM pH sensor… Do not do this unless you are an experienced engineer. I have been working on this now for the last month and a half trying to figure out how to get it to work right. Atlas is not any help with their OEM products. They are cheaper than the EZ products for a reason. You get no support. It’s meant for an OEM not a hobby engineer. LOL!

Do yourself a favor and buy an Atlas EZ pH sensor kit. You’ll thank me later. Or buy an Arduino and get your SEEED studio sensor to work right.

I really do wish I had better news!

Cheers!

Joe

2 Likes

I don’t trust seeed studio’s products either.  They are woefully under-documented and support is horrid.

As far as the Arduino is concerned, I have a handful of seeed studio products - specifically for the Arduino - and with the exception of a motor controller, I have not been able to get them to work.

Unless it is something ridiculously obvious, I avoid seeed at all costs.

Adafruit and Sparkfun might be a tad more expensive, but their products are robust and their support is stellar.

If you can find a pH sensor there, it’s well worth whatever the extra cost might be - and it’s usually not excessive.

Let us know what you find.

Another good thing about Adafruit and Sparkfun:  sometimes they release a module that they believe is particularly interesting before they’ve finished developing the libraries for it.  When they do that, they give you fair-warning that libraries are either incomplete or entirely missing - this way you can make an intelligent choice to challenge it or not.

1 Like

Thanks @jimrh @mountbaldybrewing

I cant send the damn thing back now as it’s on order from wherever (china I suppose). I will have a go at picking up where you left off. I’m not a great coder but I like to have a go so will at least have a play with it and report back

1 Like

just as an aside - I’ve never worked with an arduino. You can connect them to a raspi, maybe this is an option for this - get the arduino to read all the sensors and provide values back to the pi for use in other code?

2 Likes

Aemee,

As I said in an earlier post, if you are doing this just for the heck of it, (as I do most of the time), going all “lobster” stubborn on it is just fine.  Even if you fail, you will learn a lot.  (this goes for interfacing to the Arduino too)

On the other hand, if you really want to accomplish something, and there’s a need, (a hydrophonics business like @mountbaldybrewing), or a college thesis, or something else important, then you may want to cut your losses and go with a proven solution.  Again, I’d go with Sparkfun or Adafruit - and, (if I am not mistaken), they have distributors in the UK.  (I’m assuming that’s where you are, based on your grammatical constructions - but then again, you might be from Australia. . .)

Regardless of what option you choose, going “lobster” or going with a better solution, keep us in the loop!  (You have my curiosity riz!)

1 Like

thank @jimrh sparkfun, pimoroni and adafruit - none of them have PH sensors, some have withdrawn items no longer for sale. I think I might add arduino into the mix for this so i can learn that while I’m at it. It’s still a cheap way of monitoring PH to the level of accuracy I need. My project is to add a PH controller to an aquarium - if the CO2 drops below a certain range, instruct a relay to turn off the co2 supply. I already built an autodoser for my fertiliser and a realtime temp sensor on the pi with alerting etc so this would be adding to that.

2 Likes

Cool Beanies! (Though I’m not sure how this fits into robotics)

This sounds (almost) as crazy as my project to modify the Remote Camera Robot project for the GoPiGo3 to use a joystick instead of a mouse.  Sounds easy but has more aspects than a (Maine Coon) cat has hair!

You REALLY have my curiosity riz now - I’m all on fire to see how this works out.

1 Like

Hi there,

thought I drop in here, because I too have the grove PH Sensor kit and will try to get it to work on a Pi during the next weeks. Some fun facts about me regarding this discussion so far

  • I actually have a PhD in Chemistry (never worked as a chemist, so don’t ask me anything :upside_down_face: )

  • I work as a software developer, but my Python Skills are very basic

  • I’m brewing my own beer too

  • Goal of the project: track ph-values in an aquarium

So all in all I should fit in here :wink:

3 Likes

Welcome in!

Can you say: “Like a glove”?

Ahhh! I KNEW you could!

Anyone who doesn’t mind seemingly impossible challenges is a friend of mine! (:laughing:)

1 Like

If you DO decide to go the Arduino <==> Raspberry Pi route, just remember that the Arduino, (at least the one’s I have), are 5v logic devices and you need a level-shifter to interface with Raspberry Pi’s 3.3v logic levels.

At risk of “shouting” - YOU WILL FRY YOUR RASPBERRY PI if you connect 5v logic directly to the Raspberry Pi’s inputs.

That being said, there is a lot of work being done in the Pi with a 'duino paradigm. The Arduino is optimized for a lot of low-level hardware stuff, including nifty things like analog/digital interfaces and higher-voltage i2c stuff - I think. I’ve never used i2c on the Arduino.

I’m sure there’s a lot of information about connecting the two together.

Don’t forget to let us know what you find!

1 Like

Well, the first thing I found some days ago is that I should better order a Grove-Hat for the pi to avoid the problems when trying to connect the sensor directly to the pi. The hat is in the mail right now, along with a pi zero (as a spare part if terrible things happen). Stay tuned :wink:

2 Likes

@jimrh thanks its arrived, I got it connected to my arduino and uploaded the code example. Out the box in the fluid it comes in the voltage is reading wrong and the PH is in minus figures (alien vomit lol). I need to look at how the PH and voltage is calculated in their code example.

2 Likes

@aemee @DocDrum @mitch.kremm @cyclicalobsessive @jimrh

Thanks for picking up where I left off. I sadly still have not gotten a GOOD working pH sensor. I’ve gone through 3 probes and I’m on my 3rd flavor of controller. I have also purchased 2 flavors of arduinos in hopes to figure this thing out.

Where I have gone and what I have tried (other than SEEED):

Atlas OEM pH Sensor : Would not reliably give me a reading with the arduino and wouldn’t work at all with a rPi 3B. Support has been not very good (because it’s meant for an OEM or DEV with engineering experience which I am NOT.). Spend the money and get one of Atlas’s EZO circuits. They actually provide support for them and they just work.

AnyLeaf pH and ORP sensor: I just recieved this one and have been working to get it to run. I haven’t been able to get their code to compile yet on an Arduino. I switched over to an Arduino because I was using a SEEED hat on a pi 3B to read a TDS and Temp sensor which this was hooked to. Well that SEEED hat is haunting me. I believe it was causing some weird I2C readings on the pi. I don’t know what was going on but I had to unplug the AnyLeaf board because I was nervous that nefarious things were going on. I’m currently working with the Dev from AnyLeaf to figure out why his Arduino code isn’t compiling. I believe the issue is because the libraries for the Arduino were just updated and that there is a bug some place in one of the Arduino drivers. The good news is that the Dev is very responsive and helpful.

Everything else in my project is running very well. My goal with this portion of the project is to read the sensors with the Arduino Uno and have that post to a MQTT server (on the pi). This is totally doable. I’m also adding a pH doser to my project using a couple 12V perasteltic pumps and two relays. It should be a simple addition. We’ll see what happens!

One side note about Arduino… If you didn’t know, they are all coded in C++. It’s certainly not my wheelhouse, but I can fumble my way through it. LOL!

Cheers!

1 Like

im running it with a direct cable to the arduino uno - no hat in the way. My next plan is to go through the code samples above - the code itself looks fine (not an expert) in terms of the actions it does, the bit which is broken is how the voltage and ph are calculated - might be a dead end but I’ll have a crack at changing some of the values

1 Like

“Grove” is a connector pinout paradigm that uses a particularly sized connector with a specific pin assignment.

It does NOT say or imply ANYTHING about logic voltage levels.

The GoPiGo uses Grove connectors, but all the logic is still 3.5v logic - not 5v!

You need to make sure that whatever HAT you use provides level-shifting as well as Grove-style connectors.

Asking @mitch.kremm and @cleoqc to step in and help clarify what is the best way to do the level-shifting you need as I’m not the expert on Grove Hats and Dexter/Modular Robotics hardware/software.

Don’t do anything rash until someone else who knows more about this weighs-in and lets us know what’s safe.

1 Like

OK,

This Grove Base Hat for Raspberry Pi Zero - Seeed Wiki is what I got. So far I connected it to a Pi 3b and installed the libraries but didn’t connect anything to the ports on the hat. Says Output Voltage 3.3V on the Package and in the specs on the Website, so I would guess it should be ok. Maybe @mountbaldybrewing could help? How did you connect the pH-Sensor to your pi?

2 Likes

What is the output of the sensor? 3.3 or 5v?

1 Like