General

Gravity: EC Sensor with integrated PT1000

userHead Ffiren 2025-09-14 08:35:19 55 Views1 Replies

G'day!

 

I'm using the above sensor with ESPHome.

 

I can get the EC side working fine with calibration etc, but the inbuilt temp sensor is causing me a few issues.

 

With some linear interpolation, this formula seems close for my desired range, but I don't think it is right. 

Can anyone list the correct one?

 

temperature = 9.915 + 0.01674 * voltage_mV

 

My full code in case it helps anyone else: https://community.home-assistant.io/t/code-for-dfrobot-ec-sensor-with-integrated-temperature-probe/930263

 

Thanks in advance.

2025-09-14 12:37:58

OK, so didn't help that I was given the wrong source code with the probe. Didn't contain anything for the temp sensor so no wonder I was struggling!

 

This seems to work, though I've added a button to calibrate against a known temp as I'm using a fixed offset of -2.87 for now.

 

Again, feel free to reply if this could be better!

 

float voltage_mV = id(temp_voltage).state;

float voltage = voltage_mV / 1000.0;

const float GDIFF = 30.0/1.8; // ~16.67

const float VR0 = 0.223;

const float G0 = 2.0;

const float I = 1.24 / 10000.0; // 0.000124

float Rpt1000 = (voltage/GDIFF + VR0) / I / G0;

float temperature_raw = (Rpt1000 - 1000.0) / 3.85;

 

// Apply calibration offset

float temperature = temperature_raw + id(temp_cal_offset).state;

userHeadPic Ffiren