 const int pin_read = 2;
 const char* server = "api.thingspeak.com";
 
+DHT dht(pin_read, DHT11);
+
 int sent = 0;
 
 #define SLEEP_TIME 1200 * 1000 * 1000
 
 void setup() {
   Serial.begin(115200);
+  dht.begin();
+  
   pinMode(pin_clk, OUTPUT);
   pinMode(pin_soil, INPUT);
   pinMode(pin_led, OUTPUT);

  float hum=0,temp=0,soil_hum=0;
  Serial.println("Requesting Temperature and Humidity...");
  
  int chk = DHT.read(pin_read);
  if(chk == 0){
    hum = DHT.humidity;
    temp = DHT.temperature;
    Serial.print("Humidity:");
    Serial.println(hum);
    Serial.print("Temperature:");
    Serial.println(temp);
  }
  delay(1000);
  soil_hum = readSoilVal(8);
  Serial.print("Soil_Humidity:");

#include <ESP8266WiFi.h>
#include "DHT.h"

String apiKey ="<YOUR-API-KEY>";
const char* MY_SSID = "<YOUR-SSID>"; 
const char* MY_PWD = "<YOUR-PASSWORD>";

const int pin_clk = 5;
const int pin_soil = A0; 
