CODE ISSUE REGARDING THE GRAVITY PH METER V2 BOARD

Hi everyone :)

I need some assistance with the ph meter v2 code, specifically the DFRobot_PH library. GitHub - DFRobot/DFRobot_PH: Arduino library for Gravity: Analog pH Sensor / Meter Kit V2, SKU: SEN0161-V2

My problem is the calibration of the electrode. Currently you have to send the firmware serial commands via the pc to start the process and to finish it. This would be fine for a technical person, but unfortunately the people the ph controllers are going to are not computer people. Iv been arduino'ing for a long time and I just need someone to help me out with the library.

I need to be able to calibrate the probe at pH 4.00 and pH 7.00 simply by selecting the calibration function using 1 or 2 buttons. In the library, its a serial thing, but i need to make it fool proof. All I really need is the route to the function or the function itself that calibrates the probe to the board. I have dug in the .cpp and .h files, but i normally break something.

It needs to be like the hanna calibration sequence. You select calibration, it displays a request for pH 7, you put the probe into your pH7 buffer solution, it stabilises at pH 7, once it is happy, you can press confirm and it stores the offset. It then asks you to put the probe into your pH 4 solution. (after rinsing) It does the same thing, it waits for the pH to stabilise at 4 and then you press confirm. This goes hand in hand with a temperature sensor of course. And thats it! Calibration complete!

You literally pressed 2 buttons, the CAL button and the CFM (confirm) button. I need to do this with my ph meter, please help me :) I would be eternally grateful!!!! My meter has a 2x16 LCD panel on it, So I have setup a menu system and I just need the code to plug into the calibrate probe fuction. You press "Calibrate", the lcd displays calibration has begun, insert probe into ph7, it waits a few seconds for the ph to stabilise @ 7, you then press the same button and it stores the offset on the eeprom. It then tells you to rinse the electrode and put it into ph4, same thing happens and its saves the offset to the eeprom.

And then im not sure if theres any non linear algebra going on with intercepts, slopes and stuff when converting the the adc value to a ph value, but i was led to believe that the board takes care of that.

I just want a quick easy was of calibrating :))) Sorry for the long mail! Thank you to any1 that can help me!!!! <3 G

Have you already written code to test the CAL and CFM buttons ?
Which calibration types do you want to process:

*   enterph -> enter the calibration mode
*   calph   -> calibrate with the standard buffer solution, two buffer solutions(4.0 and 7.0) will be automaticlly recognized
*   exitph  -> save the calibrated parameters and exit from calibration mode

How are you going to select these ? Through an LCD menu system ?

It actually seems simple enough. You'd adapt this to call
phCalibration( X ) unconditionally where X is 1,2 or 3 depending on the calibration type required.

void DFRobot_PH::calibration(float voltage, float temperature)
{
    this->_voltage = voltage;
    this->_temperature = temperature;
    if(cmdSerialDataAvailable() > 0){
        phCalibration(cmdParse());  // if received Serial CMD from the serial monitor, enter into the calibration mode
    }
}

Hi 6v6gt!

First of all, thank you so much for your help. I dont get as much time to code as I'd like to and I run into these silly road blocks, which are essentially the "you must be a dumbass" moments for the elite coders on the forum such as yourself :slight_smile:

Iv uploaded a video of the unit and what I want it to do: PH CALIBRATION ROUTINE - YouTube

Now Im not sure what i must change, the .ino, .h or the .cpp? or all of the above?

On the unit once Im in the calibration screen, I want to call the enterph function, then the calph then the exitph function using the up button.

Ok, I think to simplify things on my end, what do I need to change/add in order for the enterph, calph and exitph routines to run each time the unit is powered on? eg. put them into my void setup()
?

Thanks again :)))

G

It looks like you actually have to change the library routine itself.
But post the code that you have used during that video.

I think its all good, I managed to call each calibration routine individually :slight_smile: I will test it out properly and see if it works :slight_smile:

Thanks for pointing me in right direction :slight_smile: You're my Hero!!! :smiley:

P.S. I did have to change the library routine :wink:

gareth83, please share your result, and how you did, thanks.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.