FAQ

Why the Calibration Fail or Read NAN the First Time for the Analog Electrical Conductivity Sensor

userHead Tonny12138 2024-12-04 17:26:59 216 Views1 Replies

During the first calibration, the calibration always fails, or the sensor always reads NAN the first time it is used. What could be the reason?

2024-12-31 17:27:30

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.  Different from DFR0300‘s program.

————————————————————————————————————————————————————————————————

#include <EEPROM.h>     

#define KVALUEADDR 0x0F     

void setup(){         

for(byte i = 0;i< 8; i++ ){           

EEPROM.write(KVALUEADDR+i, 0xFF);         

}     

}     

void loop(){     

}
————————————————————————————————————————————————————————————————

userHeadPic Tonny12138