FAQ

First calibration attempt gives erratic readings - why?

userHead Tonny12138 2024-07-11 11:39:03 50 Views0 Replies
What might be the reason for the first calibration that always fails to calibrate, or prints the unexception value?
2025-07-24 16:06:32

When calibrating, the relevant parameters are stored in the specified position in EEPROM. If other data previously saved in the same position in EEPROM, there may be a conflict, resulting in an inability to calibrate properly. Use the following code to erase the contents in the specified position in EEPROM. Run it once, then upload the sample code again to restart the calibration.

 

/*

This code will reset the corresponding EEPROM used by DFRobot Gravity pH Meter V2, SKU: SEN0161-V2.

When uploaded this code, please open the serial monitor of the Ardino IDE. The correct value of the EEPROM block should be 255.

*/

#include <EEPROM.h>

#define PHADDR 0x00

void setup()

{

Serial.begin(115200);

for(int i = 0;i < 8; i++ )

{

EEPROM.write(PHADDR+i, 0xFF);// write defaullt value to the EEPROM

delay(10);

}

}

void loop()

{

static int a = 0, value = 0;

value = EEPROM.read(PHADDR+a);

Serial.print(PHADDR+a,HEX);

Serial.print(":");

Serial.print(value);// print the new value of EEPROM block used by EC meter. The correct is 255.

Serial.println();

delay(10);

a = a + 1;

if (a == 8)

while(1);

}

userHeadPic Tonny12138