Soil Sensor - I²C Capacitive Moisture Sensor

I have a Adafruit Soil Sensor - I²C Capacitive Moisture Sensor

The Capacitive value should be between 0 and 2000

I am getting the correct measurement on my seeed xiao.

Does anyone see anything in the code below that would be causing this reading issue with particle?

#include "Adafruit_Seesaw.h"

Adafruit_Seesaw ss;

void setup()
{
  
  Serial.begin(115200);

  while (!Serial)
  {
    delay(10);
  }

  Serial.println("seesaw Soil Sensor example!");

  if (!ss.begin(0x36))
  {
    Serial.println("ERROR! seesaw not found");
    while (1)
      ;
  }
  else
  {
    Serial.print("seesaw started! version: ");
    Serial.println(ss.getVersion(), HEX);
  }
}

int last_x = 0, last_y = 0;

void loop()
{
  uint16_t tempC = ss.getTemp();
  uint16_t capread = ss.touchRead();

  Serial.print("Temperature: ");
  Serial.print(tempC);
  Serial.println("*C");
  Serial.print("Capacitive: ");
  Serial.println(capread);
  delay(100);
}

below is the serial monitor results

Capacitive: 65535
Temperature: 26*C

Link to sensor –
Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor : ID 4026 : $7.50 : Adafruit Industries, Unique & fun DIY electronics and kits

@bbarr7iot, tempC is declared as an uint16_t but the getTemp() function returns a float. Change the declaration and try it again to see if it works or at least what value is “truly” returned.

1 Like

I got it working with the code below, can you update the library when searching for seesaw.

https://go.particle.io/shared_apps/6169c0afde87cd0008e33f74

@bbarr7iot, what did you change to get it working?

1 Like

Did you need Adafruit_I2CDevice library if you didn’t call it?
Did you alter the Adafruit_Seesaw library?