Ph Sensor on ADS1115



I would like to realize an aquarium control with Cayenne.
I also want to measure the pH of the water.
I have a PH probe with a transducer but the analog signal on.
I connected this with the ADS1115 module.
That works quite well.
Now my question.
How can I generate the trade fair area or a conversion?
If I indicate Volt, the volts are also output.
But I want to get the PH value displayed.
Another question.
Does Cayenn also support WS2812b LED Stripes?
I want to simulate sunrises, sunsets and moon phases.
Is that possible ?



Begin with this i think you can find your happiness for mV to pH translation:

#define Offset 0.00            //deviation compensate
unsigned long int avgValue;     //Store the average value of the sensor feedback
void setup()
  Serial.println("Ready");    //Test the serial monitor
} //END setup
void loop()
  int buf[10];                //buffer for read analog
  for(int i=0;i<10;i++)       //Get 10 sample value from the sensor for smooth the value
  for(int i=0;i<9;i++)        //sort the analog from small to large
    for(int j=i+1;j<10;j++)
        int temp=buf[i];
  for(int i=2;i<8;i++)                      //take the average value of 6 center sample
  float phValue=(float)avgValue*5.0/1024/6; //convert the analog into millivolt
  phValue=3.5*phValue+Offset;                      //convert the millivolt into pH value
  Serial.print("    pH:"); 
  Serial.println(" ");
  digitalWrite(13, HIGH);      
  digitalWrite(13, LOW);
} // END loop



Thank you for your prompt reply.
I had forgotten that I use a Raspberry pi.
Unfortunately, I noticed that the extensions remove themselves.
The same thing happens with buttons.
Weird behaviour.
When I reset the Raspi everything will work again for a while.
Which device do you use as a basis?
I might pan to NodeMCU if that’s possible. the synonymous has an analog input.



I’m a beginner with RPI i think it’s possible in coding with this :

I’m more familiar with ARDUINO.
NodeMCU got twice : i2c and analog input . and library
you could transmit pH after calculation to Cayenne.

An important precision : a pH sensor mesure mV between -200 to +200mV .
Does ADS1115 mesure négative Voltage ? I don’t think : it goes from GNd to Vcc !
So you must use electronic adaptor like this :