I am trying to get a Spark Core working with a Octopus Soil Moisture Sensor Brick (EF04027).
Information about the sensor: http://www.elecfreaks.com/store/octopus-soil-moisture-sensor-brick-p-422.html
I putting the yellow cable on the A0 pin on Spark Core and the red cable on 3.3* pin and the black cable to GND.
At first its looks like it works but the value going up and down but its not going down mathc before its going back up.
Please, anyone have a good idea?
The values jump like this:
3159
3158
3161
3162
3153
3163
3168
3163
3164
The code i using is:
int latestMeisure = 0;
void setup() {
Spark.variable("latestMeisure", &latestMeisure, INT);
pinMode(A0, INPUT);
}
void loop() {
latestMeisure = analogRead(0);
Spark.publish("meisure", "{ \"my-key\": \"Meisure\", \"my-value\": \"" + String(latestMeisure) + "\" }", 60, PRIVATE);
delay(1000 * 60 * 5);
}