I am trying to read value from a capacitive moisture sensor (https://www.amazon.fr/Capacitive-Moisture-Corrosion-Resistant-Raspberry/dp/B07FLR13FS) from an ESP32.
I connected the sensor to pin GPIO 0 but the value returned is a constant 4095 even if the sensor is dry or wet. I tried to use 3.3v and 5v but the result is the same. Even if I disconnect the data pin the value is still 4095. I've read that 4095 is the max value returned on a sensor connected to 5v but not sure what I am doing here.
This is the code I am using:
const int moisturePin = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
float moistureValue = analogRead(moisturePin);
Serial.println(moistureValue);
delay(30000);
}
Thanks for any help.