Please Help, Im trying to connect DHT11 with a Moisture sensor the code up loads DH11 shows the reading on the gauge but the moisture sensor doesnt show anything on the gauge when placed into a cup of water, this is my code
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <DHT.h>
char auth[] = "*************"; //Auth code
char ssid[] = "********"; //WIFI Name
char pass[] = "***********"; //WIFI Password
#define DHTPIN 2 // Digital pin 4
#define soilPin 0
// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
SimpleTimer timer;
void sendSensor()
{
float h = dht.readHumidity(); // in %
float t = dht.readTemperature(); // in C
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
Blynk.virtualWrite(V5, h); //V5 is for Humidity
Blynk.virtualWrite(V6, t); //V6 is for Temperature
}
void sendsoilSensor()
{
float s = analogRead(soilPin);
if (isnan(s)) {
Serial.println("Failed to read from Gas sensor!");
return;
}
Blynk.virtualWrite(V7, s);
}
void setup()
{
Serial.begin(9600); // See the connection status in Serial Monitor
Blynk.begin(auth, ssid, pass);
dht.begin();
timer.setInterval(1000L, sendSensor);
}
void loop()
{
Blynk.run(); // Initiates Blynk
timer.run(); // Initiates SimpleTimer
}