capacitive soil moisture sensor v1.2 again

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Dick60
Normal user
Posts: 102
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

capacitive soil moisture sensor v1.2 again

#1 Post by Dick60 » 30 Apr 2022, 14:48

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?

TD-er
Core team member
Posts: 6354
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: capacitive soil moisture sensor v1.2 again

#2 Post by TD-er » 30 Apr 2022, 16:00

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/

Dick60
Normal user
Posts: 102
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: capacitive soil moisture sensor v1.2 again

#3 Post by Dick60 » 30 Apr 2022, 17:02

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?

TD-er
Core team member
Posts: 6354
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: capacitive soil moisture sensor v1.2 again

#4 Post by TD-er » 30 Apr 2022, 17:59

I assume it is similar to this one:

Image

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)

Dick60
Normal user
Posts: 102
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: capacitive soil moisture sensor v1.2 again

#5 Post by Dick60 » 30 Apr 2022, 18:19

Image
it is like tris one

Ton_vN
Normal user
Posts: 252
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: capacitive soil moisture sensor v1.2 again

#6 Post by Ton_vN » 30 Apr 2022, 18:35

@Dick60,

In your message of 17:02, I read
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.
Don't parallel connect, because then you only see the potmeter which probably is 'more powerful' than the sensor-output!
It should be:
either potmeter,
or sensor, like in your latest message.

Dick60
Normal user
Posts: 102
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: capacitive soil moisture sensor v1.2 again

#7 Post by Dick60 » 30 Apr 2022, 18:39

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.

User avatar
Ath
Normal user
Posts: 1815
Joined: 10 Jun 2018, 12:06
Location: NL

Re: capacitive soil moisture sensor v1.2 again

#8 Post by Ath » 30 Apr 2022, 19:52

Dick60 wrote: 30 Apr 2022, 17:02 Turning the Potmeter I see a change in messurments
Dick60 wrote: 30 Apr 2022, 18:39 I think it isnt working with the ESPeasy firmware.
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

Dick60
Normal user
Posts: 102
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: capacitive soil moisture sensor v1.2 again

#9 Post by Dick60 » 30 Apr 2022, 21:26

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.

TD-er
Core team member
Posts: 6354
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: capacitive soil moisture sensor v1.2 again

#10 Post by TD-er » 30 Apr 2022, 21:40

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.

Dick60
Normal user
Posts: 102
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: capacitive soil moisture sensor v1.2 again

#11 Post by Dick60 » 30 Apr 2022, 22:01

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.

manjh
Normal user
Posts: 499
Joined: 08 Feb 2016, 11:22

Re: capacitive soil moisture sensor v1.2 again

#12 Post by manjh » 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?

manjh
Normal user
Posts: 499
Joined: 08 Feb 2016, 11:22

Re: capacitive soil moisture sensor v1.2 again

#13 Post by manjh » 04 Jul 2022, 21:41

manjh 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?
I think I found the formula ;) :
(419-%value%)/(419-53)*100
Where 419 is the upper value (dry) and 53 the lower (immersed).

Haldi_2
Normal user
Posts: 34
Joined: 24 Aug 2020, 18:10

Re: capacitive soil moisture sensor v1.2 again

#14 Post by Haldi_2 » 24 Jul 2022, 19:20

manjh wrote: 04 Jul 2022, 18:39 I have been breaking my head on how to map the measured value into a moisture percentage..... any ideas?
Uhm... it's an Analog input right?
Just use Two Point Calibartion?
del.jpg
del.jpg (24.08 KiB) Viewed 595 times

TD-er
Core team member
Posts: 6354
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: capacitive soil moisture sensor v1.2 again

#15 Post by TD-er » 24 Jul 2022, 21:29

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.

manjh
Normal user
Posts: 499
Joined: 08 Feb 2016, 11:22

Re: capacitive soil moisture sensor v1.2 again

#16 Post by manjh » 25 Jul 2022, 12:45

Haldi_2 wrote: 24 Jul 2022, 19:20
manjh wrote: 04 Jul 2022, 18:39 I have been breaking my head on how to map the measured value into a moisture percentage..... any ideas?
Uhm... it's an Analog input right?
Just use Two Point Calibartion?
del.jpg
Where can this be entered?

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests