capacitive soil moisture sensor v1.2 again
Moderators: grovkillen, Stuntteam, TD-er
capacitive soil moisture sensor v1.2 again
I tried to get this device working on an esp8266 and an esp32 (preferable) but did not had any sucees in it. I use the ESPEasy_binaries27042022 and connected the soil moister sensor to the 5v, Gnd and an Analog port (in my case on the esp32 pen nr 25 (ADC2-ch8). Also put the sensor in some soil. No messurement are visible. I did not activate the oversampling or the calibration. I tries to put an formula in it ((%value%-350)/(800-350)*100) as mentioned in an old post but also no result. Any suggestions to give this project a push?
Re: capacitive soil moisture sensor v1.2 again
First, see: https://espeasy.readthedocs.io/en/lates ... ty-and-adc
Do not use an analog input connected to ADC2 when you also use WiFi.
Second, what resistors do you use to get the measured voltage between 0 and 3V3?
See: https://randomnerdtutorials.com/esp32-a ... duino-ide/
Do not use an analog input connected to ADC2 when you also use WiFi.
Second, what resistors do you use to get the measured voltage between 0 and 3V3?
See: https://randomnerdtutorials.com/esp32-a ... duino-ide/
Re: capacitive soil moisture sensor v1.2 again
I switched to the esp8266 because it is more convinient for me to test the sensor. I use A0 port and connected a 10k potmeter to 3.3vplus, to the GND and in the middle to A0. Als paralel to the potmeter I connected the Sensor. Turning the Potmeter I see a change in messurments but putting the sensor in the wet soil, no difference is messured. Any idea?
Re: capacitive soil moisture sensor v1.2 again
I assume it is similar to this one:

Are you sure about the connected pins?
Can you measure a voltage over the analog output pin on the sensor when keeping it dry and putting it in wet soil (or a wet paper towel wrapped around the sensor)

Are you sure about the connected pins?
Can you measure a voltage over the analog output pin on the sensor when keeping it dry and putting it in wet soil (or a wet paper towel wrapped around the sensor)
Re: capacitive soil moisture sensor v1.2 again
it is like tris one
Re: capacitive soil moisture sensor v1.2 again
@Dick60,
In your message of 17:02, I read
It should be:
either potmeter,
or sensor, like in your latest message.
In your message of 17:02, I read
Don't parallel connect, because then you only see the potmeter which probably is 'more powerful' than the sensor-output!Als paralel to the potmeter I connected the Sensor. Turning the Potmeter I see a change in messurments but putting the sensor in the wet soil, no difference is messured.
It should be:
either potmeter,
or sensor, like in your latest message.
Re: capacitive soil moisture sensor v1.2 again
I tested like my last picture, with ONLY the Sensor. In that case I see no difference between the messurements in the wet soil and the dry soil. It is a nem sensor and tested also a second sensor withthe sam result. I think it isnt working with the ESPeasy firmware.
Re: capacitive soil moisture sensor v1.2 again
Your first statement proves that your second statement is incorrect.
I'd have a good look at that sensor again, and use a multi-meter to see if the output voltage actually changes between wet and dry measurement.
/Ton (PayPal.me)
Re: capacitive soil moisture sensor v1.2 again
I did some mesurements on the sensor and the spare sensor. I used my multimeter and connected the senser to 5v and mut my multimeter on the data line of the sensor and the plus (later the gnd) but there is no difference between wet soil and dry soil. No voltage change discovered during these mesurements.
Re: capacitive soil moisture sensor v1.2 again
What voltage do you measure (between out and GND) ?
Maybe it improves when you add a small resistor over the output and GND?
Not sure how the internal circuit does work, but typically they charge a capacitor. But if it doesn't get discharged it will slowly increase to the charge voltage (e.g. 5V) without any significant change in voltage due to soil humidity changes.
Maybe it improves when you add a small resistor over the output and GND?
Not sure how the internal circuit does work, but typically they charge a capacitor. But if it doesn't get discharged it will slowly increase to the charge voltage (e.g. 5V) without any significant change in voltage due to soil humidity changes.
Re: capacitive soil moisture sensor v1.2 again
unfortunately no better news, also with a small resister, no change between the two messurments. I will try an external power source instead of the 5v of my ESP8266.
Re: capacitive soil moisture sensor v1.2 again
I got this to work, hardware is straightforward.
But I am struggling with the formula....
My upper value (dry) is 419.
Lower value (immersed in water) is 53.
Meaured value is somewhere in between.
I have been breaking my head on how to map the measured value into a moisture percentage..... any ideas?
But I am struggling with the formula....
My upper value (dry) is 419.
Lower value (immersed in water) is 53.
Meaured value is somewhere in between.
I have been breaking my head on how to map the measured value into a moisture percentage..... any ideas?
Re: capacitive soil moisture sensor v1.2 again
I think I found the formulamanjh wrote: ↑04 Jul 2022, 18:39 I got this to work, hardware is straightforward.
But I am struggling with the formula....
My upper value (dry) is 419.
Lower value (immersed in water) is 53.
Meaured value is somewhere in between.
I have been breaking my head on how to map the measured value into a moisture percentage..... any ideas?

(419-%value%)/(419-53)*100
Where 419 is the upper value (dry) and 53 the lower (immersed).
Re: capacitive soil moisture sensor v1.2 again
I don't think it is a linear relation between voltage and what you're measuring.
The formula suggested in the post before yours can be entered in the formula field at the bottom of the task.
The formula suggested in the post before yours can be entered in the formula field at the bottom of the task.
Re: capacitive soil moisture sensor v1.2 again
has one meanwhile been able to successfully use this kind of sensor and could share the howto/settings?
I'm trying it with a DFRobot FireBeetle, sensor connected to 3V3, GND and A0.
Device: Analog input - internal
Analog Pin: Hall Effect
Att: 11dB
Oversampling: Use Current Sample
When switching to ADC1 ch0 / GPIO-36, which should be the better approach as far as I understand it, I don't get any reading but 0.00.
The settings in the device's tab is most probably the wrong one, but at least I'm receiving a reading, one that jumps from one value to a 'not correlated' one unfortunately
I set also the 'Two Point Calibration'.
I'm trying it with a DFRobot FireBeetle, sensor connected to 3V3, GND and A0.
Device: Analog input - internal
Analog Pin: Hall Effect
Att: 11dB
Oversampling: Use Current Sample
When switching to ADC1 ch0 / GPIO-36, which should be the better approach as far as I understand it, I don't get any reading but 0.00.
The settings in the device's tab is most probably the wrong one, but at least I'm receiving a reading, one that jumps from one value to a 'not correlated' one unfortunately
I set also the 'Two Point Calibration'.
Re: capacitive soil moisture sensor v1.2 again
Which pin on the ESP32 are you using?
There isn't a pin called "A0" on the ESP32. That's the analog pin on an ESP8266.
Also better use "oversampling" as it takes a number of samples and averages it.
When using a multimeter, what voltage do you measure between the analog output of the sensor and GND?
Oh and uncheck the two-point calibration for now, as its default values are 0->0.0 and 0->0.0
Thus if you have not updated those values to something sensible, you will always get 0 as output.
There isn't a pin called "A0" on the ESP32. That's the analog pin on an ESP8266.
Also better use "oversampling" as it takes a number of samples and averages it.
When using a multimeter, what voltage do you measure between the analog output of the sensor and GND?
Oh and uncheck the two-point calibration for now, as its default values are 0->0.0 and 0->0.0
Thus if you have not updated those values to something sensible, you will always get 0 as output.
Re: capacitive soil moisture sensor v1.2 again
The DFR FireBeetle really has a pin named A0 / IO36 (top left)
I had set 500 to represent for 0% and 1 for 100% - now it's deactivated.
When switching to ADC 1 / ch0 I'm receiving 136,5mV with all pins connected to the ESP.I had set 500 to represent for 0% and 1 for 100% - now it's deactivated.
Re: capacitive soil moisture sensor v1.2 again
Ah, yes, DF-Robot is doing a lot of things a little bit different than usual. The A0..An/D0..Dn pin numbers are originally introduced on the Arduino boards, and also numbered like that on the Wemos D1 mini, but for ESP32 this confusing numbering scheme (no linear match to GPIO pins) was dropped. Except by DF-Robot, it seems
.

/Ton (PayPal.me)
Re: capacitive soil moisture sensor v1.2 again
With the interval set to 60sec, I'll receive the following data from this sensor in the soil with no watering for approx. a day:
Re: capacitive soil moisture sensor v1.2 again
Is this with "oversampling" enabled?
Maybe you should also add a small (100nF) capacitor over the analog pin and GND on the ESP.
Maybe you should also add a small (100nF) capacitor over the analog pin and GND on the ESP.
Re: capacitive soil moisture sensor v1.2 again
oversampling active, yes.
Re: capacitive soil moisture sensor v1.2 again
looking a lot better and I believe I have to accept the relatively small deviations now ..
Re: capacitive soil moisture sensor v1.2 again
well well well, not really reliable (changed interval to 15min meanwhile) ..
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 13 guests