ESP Soil Moisture Sensor Rev 2.2

I am using Rev 2.2 of the hardware for this soil moisture sensor. The wiki and the sample source code, does not mention how to calculate relative humidity of the soil from reading the soil moisture sensor.
Can you please provide how to get a relative humidity value given the values returned by reading the PIN_SOIL (I get values in the 565 area at 22.5 deg celcius just after dousing the soil with water).

Perhaps an update to the sample source code and wiki would help. The only values shown on the wiki are for the rev 1 soil sensor showing 640-860.

  • It’s 100% humidity when you put the sensor area to a bottle of water. Let’s say the value you get is 500.
  • it’s 0% humidity when you put the sensor in air. Let’s say the value is 800.

You can calculate the relative humidity with these values.

Thank you for the prompt response.

The information is inconsistent with the results I am seeing.

I see a low number on the soil moisture sensor that fluctuates up and down between 420 and 460 when the sensor is completely immersed in water for 24 hours.

When it was outside of the water and dry, it stabilized at 700 reliably without any fluctuations.

My three questions are:

  1. is the soil sensor already returning a “relative humidity” value another NOT just returning a moisture value? BTW, when I say relative humidity, I mean a value that is calculated based on the current temperature.
  2. If I need to calculate the relative humidity from the soil moisture sensor, could you please tell me how to do that based on the 420 - 700 range of values? … what is the formula?
  3. Do these sensors need to be calibrated somehow?

Thank you very much.

If the battery voltage changed, the sensor value need be calibrated again. Yes. the soil humidity is based on the voltage of power supply.

You should use “map” function https://www.arduino.cc/en/Reference/Map

Thank you for your tip. “map” function is great!

Thanks to arduino developers for great tools.
You made nice device but i have some suggestions for power management. If you include 3.3V voltage regulator and 3.7V battery the readings will be more stable for longer period. Can you please share schematic file and components list for v2.2? There is only v1.0 and v2.1 available on GitHub page of project. Thank you!

The schematic v2.1 is same with v2.2. Do you have any 3.3V voltage regulator recommend for this sensor? I think it will consume lower current when ESP8266 go to sleep without regulator.

You are right, but accurate reading are more important i think. Then you have only power capacity problem instead of two problems a power capacity and an accuracy, I think.

Bytheway the AP2112k 3.3V regulator in ESP8266 THING by Sparkfun does really good job I think. It’s Quiescent Current: 55μA (Typ.) and Standby Current: 0.01μA (Typ.).

Here is power supply part of schematics for ESP8266 THING by Sparkfun (AP2112k on a right): https://snag.gy/kAN3zH.jpg

Here is AP2112k datasheet: https://cdn-shop.adafruit.com/product-files/2471/AP2112.pdf

Thank you! Seems AP2112k will be good friend with ESP8266. I will check the datasheet of AP2112k.

For accuracy of sensor value, we added a switch (sn74lvc1g3157) to measure the battery level. ESP8266 has only one ADC pin. Leave the pin to float to measure battery level. It default connect to the pin of sensor.

So we can calculate the relative soil moisture value that depend the battery voltage. But we haven’t finish the codes.

The switch is nice solution. Did you figure out is it linear or exponential relativity between voltage level and sensor readings?

It should be linear. We haven’t do full testing about this

1 Like

In my code i use the formule soil moisture = (100 * analog Input Battery Value / analog Input Soil Moisture Value). And i map Soil Moisture to %.

I put sensor in water and i change the voltage, the Soil Moisture value is accurate (100%).

No need Regulator ! Cool…

Esp stop Working under 2.4volt
i put my battery low at 2.5volt

Sorry for my english…

Thank you for your sharing. Could you please share the code that you measure the sensor value by battery voltage?

I think the problem is the SPI flash for ESP8266 can’t work at voltage < 2.4V

Ok !!! this is my code . have fun…

https://drive.google.com/open?id=0B1yHoGyAwdv0b1QxWVpKZVhFM2M

Thank you for your sharing. It looks great! Can I upload it to GitHub?

Yes … pour quoi pas …

My Soil Moisture Project Web Page …

http://www.qsl.net/v/ve2cuz//garden/

All Files is Included !!! in Download Button

Thank you! I’ve posted a twitter for your link.