I2C Soil moisture sensor - what's wrong here?


I'm quite new in the Arduino space. But I've bought the Rural Hack Kit and the Arduino Uno Starter Kit. And I'm having quite some fun :smiley:

However. Now I've just started exploring the Rural Hack Kit and especially the I2C Soil Moisture Sensor.

I've just followed the basics in this tutorial from hackster.io.

I just copied the code and the included the required library.

The reading I get is:
Soil Moisture Capacitance: 65535, Temperature: -0.10, Light:

And the readings are the same whether the sensor is in soil, open air or any place.

So I guess something is wrong.

If try to rearrange anything in my setup the reading don't come in at all. So something seems right. The measurements are just thrown off.

The hackster example is with the MKR1200 board. And I use the Arduino Uno board. Could this be making any difference?

And how do you translate the Capitance measurement to moisture in percentage (given the reading is correct)?

The Rural Hack Kit is in the official Arduino store: Kits — Arduino Online Shop. I didn't know that.

On that page is a link to the Chirp sensor: https://www.tindie.com/products/miceuz/i2c-soil-moisture-sensor/.
That tindie page tells to run the I2C Scanner if communication fails.

The code is pretty straightforward, it should work on every Arduino board.

Can you run the I2C Scanner ? Did it find its default address 0x20 ?

How did you connect it ?
Which library do you use for the Chirp ?


Thanks for the reply.

I ran the I2C Scanner.

I connected it like this (chirp on right / board input on left):

VCC --> 3.3V

SDA --> 11
SCL --> 12

(These are the inputs described in the Hackster.io tutorial)

It returned: "No I2C device found" for the soil moisture sensor.

I also tried wiring SDA directly to the boards SDA input. And also for the SCL. I don't exactly what the abbreviations means. But it kinda made sense to connect them :slight_smile:

This returned
"I2C device found at address 0x20 !"

So that seems to work.

I use this library:

Here is a link to my sketch:

It still just returns the same values:

Soil Moisture Capacitance: 65535, Temperature: -0.10, Light:

Did you try reading the sensor using the example code provided with the library?


I actually didn't.

Now I have. And it works.

Thanks a bunch for the input. It makes perfectly sense. I'll remember reading more throughly in the GitHub repos next time :smiley:

Most libraries have a simple example included.
The I2C scanner to see whether the connections are fine, and the example sketch can tell whether the sensor is working at all.