I am having trouble getting a proper TDS value using a TDS meter v1.0. I have found multiple articles online about this, but none seem to have the same issue I am seeing. Any help would be much appreciated.
Also, I am really not totally understanding what values I should be getting back from the sensor as raw data. I am seeing a value between 0 and 1, but I am not sure whether multiplying it by 3.3 is needed.
[23:33:08][D][dallas.temp.sensor:054]: 'temperature': Got Temperature=16.4°C
[23:33:08][D][sensor:103]: 'temperature': Sending state 16.43750 °C with 1 decimals of accuracy
[23:33:09][D][sensor:103]: 'tds': Sending state -4995.80566 ppm with 3 decimals of accuracy
[23:33:13][D][dallas.temp.sensor:054]: 'temperature': Got Temperature=16.4°C
[23:33:13][D][sensor:103]: 'temperature': Sending state 16.43750 °C with 1 decimals of accuracy
[23:33:14][D][sensor:103]: 'tds': Sending state -5011.00000 ppm with 3 decimals of accuracy
[23:33:18][D][dallas.temp.sensor:054]: 'temperature': Got Temperature=16.4°C
[23:33:18][D][sensor:103]: 'temperature': Sending state 16.43750 °C with 1 decimals of accuracy
[23:33:19][D][sensor:103]: 'tds': Sending state -5011.00000 ppm with 3 decimals of accuracy
[23:33:23][D][dallas.temp.sensor:054]: 'temperature': Got Temperature=16.4°C
[23:33:23][D][sensor:103]: 'temperature': Sending state 16.43750 °C with 1 decimals of accuracy
[23:33:24][D][sensor:103]: 'tds': Sending state -5011.00000 ppm with 3 decimals of accuracy
On esphome, ADC component prints the voltage seen by the chip, 0-1V in case of Esp8266. D1-mini has voltage divider on-board boosting the range to 3.3V so yes, you need to multiply the voltage by 3.3.
Also you likely want to take more than just one sample. Add samples: 30 #or whatever you like
to your ADC config.
Also, double check all your calculations on lambdas:
that leads to quite big compensation, maybe you need 0.02?
Final thought, I was trying to figure out how to calibrate the sensor and found that a k value should be entered, but I am not sure if I am putting this value in the right place:
filters:
- multiply: 3.3 # 3.3v from 0-1
- lambda: return x/(1.0+(0.02 * (id(temperature).state-25.0))); # temp adjustment
- multiply: 1.8 # k value calibration
- lambda: return ((133.42 * x * x * x) - (255.86 * x * x) + (857.39 * x)) * 0.5; # v to tds conversion
- lambda: return x/500; # convert from ppm to EC
3.3 multiplier has to be always first.
For the rest, I’m not so sure. The calibration method is confusing and looks like they swapped the order EC/ temp correction.
And factor 1.8 sounds really high.