Go Down

Topic: Help with Ph sensor pin abbreviations (Read 64083 times) previous topic - next topic


Can I get a step by step how to hook this sensor up, Mine does not seem to work. I tried adjusting the voltage and it doesn't move from 2.46v.


@rgonzo2: Hook your voltmeter "V+" to module "V+" and "V-" to "Po" on the module. Adjust with the pot near the BNC connector.


Hi there,

I bought a ph & temperature shield (E-201-C) from lei-ci.com,  for arduino from china and i couldn't find the schematic online.
The leads coming out have the following symbols: T2, T1, Po, Gnd, Gnd, Vcc
What do they stand for?
I Need help to conect to Mega 2560 or Uno r3 shield.
Tal for help.

Compre un sensor de PH y temperatura con placa E-201-C desde lei-ci.com.
No puedo encontrar el esquema el├ęctrico de la placa que tiene 6 pines en el lateral.
necesito ayuda para poder conectar a placa Mega 2560 o UNO R3.



Jul 26, 2016, 02:17 am Last Edit: Jul 26, 2016, 02:23 am by LeCyb
@JoseAngelRet: Scroll to the description here http://www.mini-kossel.com/Arduino-PH-Board


Great info. But, I found that I get one value with the BNC shorted and a different value with a probe in 7.0 solution. In short I just measured my raw input in 7.0 solution and then the raw input in a 4.01 solution and mapped the outputs..
Yes, it's a linear map not log, but that should be close enough for me.

765 and 665 are the analog reads in 4.01 and 7.01 solutions.

Code: [Select]

void loop() {
     float mappedv = mapfloat(analogRead(0), 765, 665, 4.01, 7.01);   // Map the '0 to 1023' result to '0 to 14'.

float mapfloat(long x, long in_min, long in_max, long out_min, long out_max){
 return (float)(x - in_min) * (out_max - out_min) / (float)(in_max - in_min) + out_min;


int ph_pin = A7; //This is the pin number connected to Po

void setup() {

void loop() {
  int measure = analogRead(ph_pin);
  Serial.print("Measure: ");

  double voltage = 5 / 1024.0 * measure; //classic digital to voltage conversion
  Serial.print("\tVoltage: ");
  Serial.print(voltage, 3);

  // PH_step = (voltage@PH7 - voltage@PH4) / (PH7 - PH4)
  // PH_probe = PH7 - ((voltage@PH7 - voltage@probe) / PH_step)
  float Po = 7 + ((2.5 - voltage) / 0.18);
  Serial.print("\tPH: ");
  Serial.print(Po, 3);


Using this code, i m not getting results
pH 20, etc is shown in serial monitor


Hello guys,
Im using the Logo_PHsensor V1.1, for a final project on my university
Im having a problem, i have a box full of water and i'm trying to produce a solution to use on a hidroponic system buti have a ph probe and 2 pins conected to arduito to read de EC of the solution inside the box.
My problem is, everytime i have EC reader and the Ph probe inside the water, im getting a value of PH higher and higher along the time. IF i took the EC reader of the box, it get a value completly diferent and stable.
Any help?


You can't measure EC and pH at the same time in small water because the EC probe insert some small current that affect pH measurement. You have to turn EC off while taking pH measurement. Maybe you can put the two probes away from each other.


hello guys, can i get some help from you? i'm doing project ph control system, by using ph probe. this is my coding
 # This sample code is used to test the pH meter V1.0.
 # Editor : YouYou
 # Ver    : 1.0
 # Product: analog pH meter
 # SKU    : SEN0161
#define SensorPin A0            //pH meter Analog output to Arduino Analog Input 0
#define Offset 0.00            //deviation compensate
#define LED 13
#define samplingInterval 20
#define printInterval 800
#define ArrayLenth  40    //times of collection
int pHArray[ArrayLenth];   //Store the average value of the sensor feedback
int pHArrayIndex=0;   
void setup(void)
  Serial.println("pH meter experiment!");    //Test the serial monitor
void loop(void)
  static unsigned long samplingTime = millis();
  static unsigned long printTime = millis();
  static float pHValue,voltage;
  if(millis()-samplingTime > samplingInterval)
      voltage = avergearray(pHArray, ArrayLenth)*5.0/1024;
      pHValue = 3.5*voltage+Offset;
  if(millis() - printTime > printInterval)   //Every 800 milliseconds, print a numerical, convert the state of the LED indicator
        Serial.print("    pH value: ");
   if(pHValue >= 7.00)
if (pHValue <= 5.50)
double avergearray(int* arr, int number){
  int i;
  int max,min;
  double avg;
  long amount=0;
    Serial.println("Error number for the array to avraging!/n");
    return 0;
  if(number<5){   //less than 5, calculated directly statistics
    avg = amount/number;
    return avg;
      min = arr[0];max=arr[1];
        amount+=min;        //arr<min
      }else {
          amount+=max;    //arr>max
          amount+=arr; //min<=arr<=max
    avg = (double)amount/(number-2);
  return avg;
and my problem is, the output pin 7 only produce 1.5v, which cannot control the relay 5v...
can anyone help me with it? i want that the output 7 is 5v, which can control relay...


It seems an hardware problem or you have a pH value that oscillate around 7.
In the latter case put a delay of about one second at the end of the loop and check again.


hello guys, from @LeCyb code, how should i code in order to add a second PH_step variables ? i have add the first which is the 4.01 and i want to add the 9.16. I need to measure from 4 to around 8 of PH. Thankyou ;)


You should notice that there is only approx. 2V for all 0-14 PH scale, that is not very accurate, voltage distortion about 10mV can change the overall PH value about 0,1PH

So .. main question it is possible to increase the phmeter voltage output range to 0-5V


im using this Logo_PHsensor v1.1 for my project but want to interface with PIC16f4550 can any1 help me out how do l do that im writting my code in microC


The code from LeCyb works great, thanks a lot! Calibration values for me were almost the same, using 17 for the step divider and 2.62 for the pH7 value gives me very accurate readings.

However the variation within the data is too big to only use single data measurements. I added a rolling average to get a proper and relatively static reading:

Code: [Select]

float water_ph = 7; // variable to store average pH
float N = 20; // do average over x measurements

// exponentially weighted moving averge
double approxRollingAverage(double avg, double new_sample) {
    avg -= avg / N;
    avg += new_sample / N;
    return avg;

void loop(){
  //.... get Po like in normal code

  water_ph = approxRollingAverage(water_ph, Po);


Hi all,

Thank you for creating this topic with so much useful information. This is the only detailed explanations for the "Logo_PHsensor v1.1" board I have found in English on the web. Thanks a lot, especially to LeCyb. Now, I know why the red LED turns on and off when I turn the pot by the pins!

That being said, I'm struggling getting my board working. When I apply 5V between V+ and G, the green LED turns on so that's good. Now, when I measure the voltage between Po and the second pin G and change the resistance of the pot by the BNC connector, I always measure 1.85V (+/- 0.04V) no matter what is connected to the BNC connector (a short, open circuit or the black pH probe). The symptom seems to be very similar to the one from rgonzo2, except the difference in voltage.

Does that mean that the board is not working correctly?



Go Up