By Jose
I measured the analog output of the sensor while having the electrode
in my fish tank and it was around 2,3volts if I remember correctly.
So I did not use any voltage divider.

Maybe it is possible to use it like that for now? That would mean no
changes to the original formula, right?

I've talked briefly with our engineer and he has warned that if the Ph level and temperature is high the voltage output will be high accordingly.
I suggest you tell your fish to be clean. Ok, so it goes something like this if I got it right:
ph 0  -  0V
ph 14-  4V

This is at temp 25C. Higher temperature will have higer voltage output. If you have tropical fish, my guess is that you want a range of ph 7 ~8 and 25C, which should be safe while water is clean.
If the fishes are moving around, or the probe is too low near the ground surface where nitrates are usually higher, ph would change. Putting in danger your Rpi.

I would like to give it a try, do you have some pictures of your setup?
By foekie01

I am fully aware of the risks and I know what I am doing.

Just to prevent people from messing up their electronics, I have added a voltage regulator to the setup and the image attached, I suggest you do as well, so we can compare voltage levels later on.

I have chosen a voltage divider with R1 of 330ohms and R2 of 470ohms.
This should result in a maximum level of ~2.938 volts at 5v input.

My setup looks like the attachment.

orange wires: 3.3v
red wires: 5v
black wires: gnd

As you can see I am supplying 5v to the analog ph circuit and using a voltage divider to level down the output signal. The divided voltage is connected to analog pin 0 of the mcp3008.

While the sensor is in my fish tank, I measure a voltage of 2.1volts coming from the analog ph module.
The divided voltage is 1.22volts.

Let me know when you got it all hooked up.

By Jose
Hello foekie01,

I can't get a ph sensor, since i am waiting for the re-stock.

But so far we are getting this ( picture on the attachment )

We are connecting a few sensors to the I2c expansion board and creating a simple GUI with GTK+
i'll try to wire it up the mcp3008 later and add the ph sensor as soon as we get it.

Do you need sources for the GUI?

EDIT: adding the gif picture to get an idea of the gui animation. Lisper, one of our forum stalkers is doing the gtk and the gifs
By foekie01

Too bad you do not have them on stock at the moment.
Do you want me to do some investigations/trials while you are waiting?

I did have a look and I have discovered that when I short the bnc connector (simulating PH 7) I get a voltage of 1.90 volts from the module. Divided voltage is 1.11.

Do you have some sort of chart which displays the voltage output from your module in regards to the PH value of the solution the electrode is in?

float phValue=(float)avgValue*5.0/1024/6; //convert the analog into millivolt
Why are you dividing by 6 by the way?

Your project looks rather interesting!
I like the gtk+ application and how it interacts with the hardware. Yes please, looking forward to have a look at the code :)

P.s. are you guys maybe looking into web applications for controlling hardware? Like controlling that same hardware as in the gif, but using a webpage?