Hey everyone. New question for a project I’m working on. I’ve written a library to use in an Arduino sketch and on my Arduino Uno clone I’m getting the results I expect, but on the Thing Dev I’m getting a very consistent MAX VALUE reading.
What I’m doing:
I’m reading a value from a moisture sensors analog output (A0) expecting to read a value from 0-1024 from the Thing-Devs analog read pin (A0, ADC)
What I’m getting:
I’m reading a maxed value of 1024 while fully submerged and while dried out on thing-dev.
What I’ve done to try and figure out the problem:
-I trimmed out all the networking code down to isolate the problem
-I’ve played with the calibration knob to no effect.
-I disconnected the A0 output on the moisture detector; That got me lower inconsistent reading but indeterminate of moisture level. Just wacky readings, not sure how it got those values (same result when I disconnected the power pin).
-I disconnected from the Thing-Dev and connected to proper pins of Arduino Uno Clone- that worked and I was able to read a difference from wet to dry. Never lower than about 200 when submerged, and almost getting to 990 when dry- these are the readings I’m used to working with.
#include <ESP8266WiFi.h>
#include <ClimateSensor.h>
const int moistureSensor = A0, moisturePower = 5;
MoistureDetector MoistureDetector(moistureSensor, moisturePower);
void setup() {
Serial.begin(9600);
pinMode(moisturePower, OUTPUT);
}
void loop() {
MoistureDetector.power(true);
delay(10);
int moistureReading = MoistureDetector.getSensorValue();
MoistureDetector.power(false);
Serial.println(moistureReading);
delay(2000);
}
Anyone have any idea why it isn’t working on the Thing-Dev but is on the Uno clone? Does the Uno clone take a signal voltage more powerful than the Thing-Dev?