soil moisture sensor

Hi,

I try to calibrate the sensor by placing it in a cup of water and supplying it with power 3 V and 4.5 V and I get the following result

Supply output reading

3 V 2.57 V 812

4.5 V 3.88 V 870

Output is proportional to supply but readings seem (to me) to be completely out of whack. Should the proportionality no extend to the readings - ref. you explantion:

1023/5 = x/ 2.12

x = 434

best regards

torben

ADC_out = ( V_reading / V_supply) * (2^ADC_bits - 1)

or as more typically seen

V_reading = (ADC_Reading/(2^ADC_bits - 1 )) * V_supply

Make sure the voltage you’re supplying to the sensor is also the reference for your ADC.