0
\$\begingroup\$

I set up the pH sensor using an ESP32. I connected VCC to 3.3V, GND to GND and PO to PIN39 (ADC1_CH3) and extended my pH probe using four meters of alarm cable.

When I do not connect the probe with the module I get a good analog reading, with the voltage measured by using an ammeter (ignoring noise and linearity of the ESP32.)

When I plug the probe in to the module, then the analog reading will jump to either 0 or 4095.

What is the problem? Is the probe broken or is the module broken or are both broken?

This is the module I used:

Module

My program:

    /*!
     * @file DFRobot_PH_Test.h
     * @brief This is the sample code for Gravity: Analog pH Sensor / Meter Kit V2, SKU:SEN0161-V2.
     * @n In order to guarantee precision, a temperature sensor such as DS18B20 is needed, to execute automatic temperature compensation.
     * @n You can send commands in the serial monitor to execute the calibration.
     * @n Serial Commands:
     * @n    enterph -> enter the calibration mode
     * @n    calph   -> calibrate with the standard buffer solution, two buffer solutions(4.0 and 7.0) will be automaticlly recognized
     * @n    exitph  -> save the calibrated parameters and exit from calibration mode
     *
     * @copyright   Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
     * @license     The MIT License (MIT)
     * @author [Jiawei Zhang](jiawei.zhang@dfrobot.com)
     * @version  V1.0
     * @date  2018-11-06
     * @url https://github.com/DFRobot/DFRobot_PH
     */
    #include "DFRobot_PH.h"
    #include <EEPROM.h>

    #define PH_PIN 39
    float voltage;
    float phValue,temperature = 25;
    DFRobot_PH ph;

    void setup()
    {
        Serial.begin(115200);  
        ph.begin();
    }

    void loop() 
    {
        static unsigned long timepoint = millis();
        if(millis()-timepoint>1000U){                  //time interval: 1s
            timepoint = millis();
            //temperature = readTemperature();         // read your temperature sensor to execute temperature compensation
            voltage = analogRead(PH_PIN)/4096.0*3300;  // read the voltage
            phValue = ph.readPH(voltage,temperature);  // convert voltage to pH with temperature compensation
            Serial.print("Voltage: ");
            Serial.print(voltage);
            Serial.print("   39: ");
            Serial.print(analogRead(39));
            Serial.print("   temperature:");
            Serial.print(temperature,1);
            Serial.print("^C  pH:");
            Serial.println(phValue,2);
        }
        ph.calibration(voltage,temperature);           // calibration process by Serail CMD
    }

    float readTemperature()
    {
      //add your code here to get the temperature from your temperature sensor
    }

Without probe:

Before plug in the Probe

Ammeter reading 1.89V without probe.

After plug in the Probe

Ammeter reading 1.45V with probe.

\$\endgroup\$
3
  • \$\begingroup\$ You measure voltage with a volt meter. You measure current with an ammeter. \$\endgroup\$
    – JRE
    Nov 26, 2022 at 12:57
  • \$\begingroup\$ why are you assuming that something is broken? ... connect everything with short cables \$\endgroup\$
    – jsotola
    Nov 26, 2022 at 20:28
  • \$\begingroup\$ This is a not well-designed board, you need to understand the circuit so that you can calibrate it and use it. See my tinkering of the board and figuring out how to use it. \$\endgroup\$
    – hcheung
    Nov 27, 2022 at 0:07

1 Answer 1

0
\$\begingroup\$

Given that the signal goes to zero volts when you connect the probe on its extended cable, I'd say you probably did something wrong while attaching the extended cable. You most likely shorted the two wires together. It is also possible that you otherwise broke the sensor while working on the cable.

The module is an amplifier. The sensor is either a current source or a voltage source. If the output of the module goes to zero, then either the sensor is dead or you've sorted its cable when you extended it.

As far as my understanding of such sensors goes, they are fairly sensitive to mishandling. I wouldn't try to use an ohmmeter on it for fear of damaging the electrodes. Inspect your work on the extende cable - look for anything that could cause a short circuit. Try removing the extension - restore the sensor cable to its original condition as far as possible.


In general, it is best to try things out as received before making modifications.

Try it out, make sure it works as sold. If not, send it back and use another one.

If it works, you can do you modifications. If it then quits working you can be pretty sure that you broke it with your modification.

\$\endgroup\$
6
  • \$\begingroup\$ pH sensors are voltage sources. They work by electrochemical corrosion on the inside and outside of the glass bulb generating a voltage, with the reference electrode and the conduction through the glass completing the circuit. The impedance of the glass is typically in excess of 10Mohm. The required cable and amplifier impedance is therefore many giga ohms. Most quality industrial probe amplifiers have teraohm input impedance. The kind of shorts that destroy the reading are damp PCB traces, damp cables, flux paths between cables... \$\endgroup\$ Nov 26, 2022 at 14:46
  • \$\begingroup\$ Also other ground return paths than the reference electrode will create electrochemical cells that destroy readings. This is absolutely not a system that can be quickly bodged with reliable results. Most industrial meters will have an isolation barrier between the MCU and the ADC/amplifier doing the measurement. Your one is relying on the isolation of the power source and mcu \$\endgroup\$ Nov 26, 2022 at 14:49
  • \$\begingroup\$ I know this system well, I was the technical lead for a blood gas analyser 8 years ago. You can make this work, but meticulousness and picoamps are the name of the game. \$\endgroup\$ Nov 26, 2022 at 14:52
  • \$\begingroup\$ I had removed the extended wire, and I found the sensor works. Then I extend back, error again... I use multimeter tested the wire, no short... is it the extend cable got any requirements? or length will also affect it \$\endgroup\$
    – GYNB
    Nov 27, 2022 at 8:03
  • \$\begingroup\$ And something weird I found when I touch the ground wire, reading will become 0 or 4095 again (After remove the extended wire)... no idea why \$\endgroup\$
    – GYNB
    Nov 27, 2022 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.