Hi All,
I am looking at developing a moisture meter. I assumed a simple potential divider would work but having some issues with unstable ADC. For a start I would like to just develop a reliable probe and then one it is stable I will be begin looking at solutions for electrolysis. I have made a PCB that has too big pads at the end of each probe, and then a spot for an optional resistor between ground and ADC line. See attached.
I then used a multimeter and measured the resistance between +V and ADC, and got a value of around 3M (without watering for approx 1 week) and 50K after watering. So I initially decided to put a 2.7M Ohm resister between ADC and ground. My thinking was that if the plant hadn't been watered for around a week the soil resistance could be approx 3M and therefore the ADC should be around 128. But i thought it would be better to get more use of the ADC resolution if i lowered the resister value and therefore if the soil resistance was around 3M the value could be lower than 128.
So I decided to use a 1M resistor and here are some my calculation to verify my thinking is correct:
Dry (2 weeks)
SoilRes = 4M SetRes = 1M
MoistADC = Vcc x (SoilRes / (SoilRes + SetRes)) x 256 / Vcc
MoistADC = 5 x (4M / (4M + 1M)) x 256 / 5
MoistADC = 51.2 = 52
Needs water
SoilRes = 2M SetRes = 1M
MoistADC = Vcc x (SoilRes / (SoilRes + SetRes)) x 256 / Vcc
MoistADC = 5 x (2M / (2M + 1M)) x 256 / 5
MoistADC = 85.3 = 86
Wet (10 min after watering)
SoilRes = 50K SetRes = 1M
MoistADC = Vcc x (SoilRes / (SoilRes + SetRes)) x 256 / Vcc
MoistADC = 5 x (50K / (50K + 1M)) x 256 / 5
MoistADC = 243.8 = 244
The problem I am having is that even when the probe is out of the soil I am still getting a reading jumping between 20 - 80 and it should theoretically be 0. I am using a LM317 circuit to step a 9V wall supply down to 5V. I have read about using a capacitor between ground and ADC to filter some noise but unsure how to calculate an appropriate capacitor.
Cheers,
Joel