Page 1 of 2
Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Monday 09 July 2018 17:14
by JHO01
Finally got the capacitive soil moisture sensor working in Domoticz
Hardware:
-capacitive soil moisture sensor, does not corrode (Aliexpress)
-Wemos D1 Mini
-connect moisture sensor VCC=>5V (Wemos), GND=>G (Wemos), AUDT=>A0 (Wemos)
Software steps:
Domoticz:
-Create Virtual Sensor, Leaf Wetness (because I like the little green icon); note IDX (in my case 1883)
Wemos:
-Flash Wemos with ESPeasy
ESPEasy:
-Config: Connect to your wifi network
-Controllers: Connect to your Domoticz HTTP
-Devices: add Analog input - internal, !st GPIO-14 (D5) enabled,
Do
NOT enable send to Controler.
Memorize Name sensor (in my case Soil) and # name of Values (in my case Analog)
Add formula: (840-%value%)/425*100 (The A0 value is varying between 840-425, Dry-Wet)
Submit
-Tools, advanced, check rules, Submit
-Rules: add
Code: Select all
on Soil#Analog do
SendToHTTP,192.168.2.30,8080,/json.htm?param=udevice&type=command&idx=1883&nvalue=[Soil#Analog]
endon
Submit.
Now the number below the Leaf Wetness icon is showing the moisture percentage
Done
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Friday 27 July 2018 9:25
by JHO01
Next challenge is to make the capacitive moisture sensor water proof. Have a look at my banana collection
1) cut out some plastic of the connector and clamp and solder a telephone wire:
2) Use a 2 cm diameter hose
3) Fill up the inside with silicone

- 1.jpg (29.39 KiB) Viewed 17824 times

- 2.jpg (22.71 KiB) Viewed 17824 times

- 3.jpg (35.07 KiB) Viewed 17824 times
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Saturday 20 October 2018 21:15
by misko903
Thank you, I will try it.
Wemos itself is somewhere in the waterproof box together with power adapter?
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Tuesday 23 October 2018 20:38
by JHO01
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Friday 16 November 2018 22:48
by misko903
Thanks for sharing, really great idea, and it is working out of the box!
the basic parts are working, yeah!
now i want to integrate it into something like this:
maybe i can add some more sensors to it?
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Saturday 17 November 2018 22:18
by misko903
I have inverted the formula, to correspond the Soil Moisture sensor values in Domoticz (using theme Aurora)
00 - 09 ==> "saturated
10 - 19 ==> "adequately wet"
20 - 59 ==> "irrigation advice"
60 - 99 ==> "irrigation"
> 99 ==> "Dangerously dry"
(definitions from this post
viewtopic.php?t=23443#p180501)
now the formula is:
(%value%-350)/(800-350)*100
where the values are 350 = sensor in the water, 800 = dry sensor - not real clay values!
I used the same sensor - DIY More Capacitive Soil Moisture Sensor v1.2
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Sunday 12 May 2019 19:22
by manuloup
Hi,
I just installed Espeasy on my Wemos D1, and I also have a soil sensor connected (YL-67 type).
The soil is connected to A0-Gnd and 3.3V. It seems working, has the soil sensor has been detected.

- espeasy 1.jpg (101.01 KiB) Viewed 15432 times

- espeasy 2.jpg (81.78 KiB) Viewed 15432 times
If I enable send data, my device is updated in domoticz but stays at 0.
If I disable it, even with the rule, nothing happens, my device is not updated anymore in domoticz.

- espeasy 3.jpg (50.38 KiB) Viewed 15432 times
I did not understand : -Devices: add Analog input - internal, !st GPIO-14 (D5) enabled,
I only have A0 connected. I did not find anything for GPIO 14 - D5 to enable it.
Any idea ?
Thanks for your help.
Manu
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Sunday 12 May 2019 22:22
by tlambin
here the same issue
I hope someone can help us
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Friday 17 May 2019 9:14
by Mdieli
manuloup wrote: ↑Sunday 12 May 2019 19:22
...
tlambin wrote: ↑Sunday 12 May 2019 22:22
...
It is good i came across both of your posts. I changed Domoticz server a few days ago, and forgot to update the soil sensor to the new server.
I did it yesterday, but was wondering why the data still didn't got updated. It wasn't since the 12th.
I first thought of problems with my server and the reachability from it. Even tried to force a browser JSON but that worked.
Unfortunately, i have no clue where to find the solution..

Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Friday 17 May 2019 10:30
by marcojpolet
Hi all,
Which version of ESPEasy do you use? Also, did you check the log in the ESPEasy menu? You could also set that to a higher level of detail, perhaps that gives a clue.
Regards,
Marco
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Friday 17 May 2019 23:20
by tlambin
Hi Marco
I use R120 version of esp easy
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Sunday 19 May 2019 8:49
by marcojpolet
Hi,
Thanks. Perhaps consider the mega branch, for me it's very stable (15 days+ without interruptions). But please also share the log details, this might help too.
Regards,
Marco
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Sunday 19 May 2019 22:47
by tlambin

it’s working
If have installed the ESPEasy_mega-20190511
Here some pictures
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Sunday 19 May 2019 23:15
by tlambin
more pictures to come
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Sunday 19 May 2019 23:15
by tlambin
the last pictures
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Monday 03 June 2019 13:34
by Nilesh579
Quite practical answer!!
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Monday 03 June 2019 14:00
by manuloup
Hi,
I guess I also have to calibrate the sensor. Is there a simple way to do it ?
Thanks,
Manu
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Monday 03 June 2019 16:31
by tlambin
Put soil in a jar and put it in the oven until all moisture is vaporized.
Read the value in the devices tab. In my case 820 This will be your 0%
Add water over the soil until the water stays on the soil. Read the value in the devices tab again. In my case 360 This will be your 100%
Now check the “calibration enable“ checkbox in the tab “devices” “task settings” and fill out your values
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Tuesday 11 June 2019 14:52
by acaonweb
JHO01 wrote: ↑Monday 09 July 2018 17:14
Finally got the capacitive soil moisture sensor working in Domoticz
Hardware:
-capacitive soil moisture sensor, does not corrode (Aliexpress)
-Wemos D1 Mini
-connect moisture sensor VCC=>5V (Wemos), GND=>G (Wemos), AUDT=>A0 (Wemos)
Software steps:
Domoticz:
-Create Virtual Sensor, Leaf Wetness (because I like the little green icon); note IDX (in my case 1883)
Wemos:
-Flash Wemos with ESPeasy
ESPEasy:
-Config: Connect to your wifi network
-Controllers: Connect to your Domoticz HTTP
-Devices: add Analog input - internal, !st GPIO-14 (D5) enabled,
Do
NOT enable send to Controler.
Memorize Name sensor (in my case Soil) and # name of Values (in my case Analog)
Add formula: (840-%value%)/425*100 (The A0 value is varying between 840-425, Dry-Wet)
Submit
-Tools, advanced, check rules, Submit
-Rules: add
Code: Select all
on Soil#Analog do
SendToHTTP,192.168.2.30,8080,/json.htm?param=udevice&type=command&idx=1883&nvalue=[Soil#Analog]
endon
Submit.
Now the number below the Leaf Wetness icon is showing the moisture percentage
Done
Just two questions to understand better
why don't send value to controller but use rules?
why use http instead mqtt?
Re: Capacitive Soil Moisture Sensor Wemos ESPeasy
Posted: Wednesday 24 July 2019 18:08
by manjh
I connected to an ESP, using VCC, Gnd and A0. How difficult could it be.
Then added a device as described.
Should work, but doesn't: my A0 value stays at zero....
Any ideas?