Different types of sensors can be found: https://en.wikipedia.org/wiki/Soil_moisture_sensor
I have tried some cheap resistivity sensors of this kind:
However, the price is cheap but the quality also is. It is not resistant to water and the probe get oxidized quite fast.
So I decided to buy that a better build one, and had a look inside. It can be found on Aliexpress for about 3 euros.
This one can also be used to check the luminosity and the PH. I will use it only for soil moisture.
I will use the "gold" probe, which is made of 2 isolated parts (both "needle bottom" are wired together). The current will flow through the soil, from one to another part of the probe.
By reading the voltage with the analog pin of the ESP, we should be able to evaluate the resitance and so the humidity of the soil.
The internal sensor resistance is 900 Ohm.
VCC voltage will be 3V.
The ESP12 has only one analog pin.
If we want to read several analog sensors, then we need to use ADS1115 for instance, that gives 4 analog pins, and is supported by the ESP Easy firmware.
http://www.ti.com/lit/ds/symlink/ads1115.pdf
https://www.letscontrolit.com/wiki/index.php/ADS1115
The Analog digital converter range is from 0V to 1V, that will give a value between 0 and 1024.
http://www.esp8266.com/wiki/doku.php?id=esp8266_gpio_pin_allocations
I have tried with real condition, and when the soil is full of water, the value is around 800.
The voltmeter shows a value of around 0.85V when the probe is into a glass of water.
Later on, it is possible to edit the source code of ESP Easy and to remap the values if needed.
Aucun commentaire:
Enregistrer un commentaire