Reading a soil moisture sensor using a ESP-12-F
Posted: Tue Jan 26, 2016 1:41 pm
After some trouble, I recently got my ESP-12 up and running. I've been able to upload sketches, run a web server and blink some leds, all worked like a charm. The next thing I want to do is hook up a soil soil moisture sensor, like this one:
I hooked it up to 3.3v, gnd and connected the analog output to a0. Unfortunately I only get 1024 out of it, weather it's dry or completely submerged in water. When I use it on a arduino, I get the whole range of values from 0 to 1024
The sketch I'm using can't be simpler:
Any idea where Im'n going wrong? The only thing I can think of is that the arduino powers the sensor with 5.5v, while with the ESP I'm powering it with 3.3v
I hooked it up to 3.3v, gnd and connected the analog output to a0. Unfortunately I only get 1024 out of it, weather it's dry or completely submerged in water. When I use it on a arduino, I get the whole range of values from 0 to 1024
The sketch I'm using can't be simpler:
Code: Select all
void setup() {
Serial.begin(9600);
pinMode(A0, INPUT);
}
void loop() {
Serial.println(analogRead(A0));
delay(100);
}
Any idea where Im'n going wrong? The only thing I can think of is that the arduino powers the sensor with 5.5v, while with the ESP I'm powering it with 3.3v