I've been trying to get these moisture sensors to work for 4 hours but i just cant seem to! I've tried everything i can think of 3.3v, 5v, different sensors(but the same) differnet cables, different pins, pull up, pull down etc etc, ive tried attenuation but not much.
it either starts from 4095 and slowley goes down to 0 with no effect when i dip it in and out of water.
or its just pinned at 4095 (with 5v).
here's my test code
Code: Select all
#include <Arduino.h>
#define pin 26
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
//pinMode(pin, PULLDOWN);
}
void loop() {
int val;
val = analogRead(pin);
Serial.println(val);
//delay(500);
}
gnd - gnd
vcc - 3.3v
aout - d26
image attached
heres my sensors - https://www.amazon.co.uk/gp/product/B08 ... UTF8&psc=1
and the board im using - https://docs.zerynth.com/latest/referen ... sp32/docs/
any help would be much appreicated, im at my whits end!
thanks so much in advance