top of page

Temperature & Humidity Sensor


SOURCE CODE:

#include <dht.h> //include the temperature and humidity sensor library #define dht_apin A0 //define the sensor to pin A0 dht DHT;

void setup() { Serial.begin(9600);//start the serial monitor delay(1000);

}

void loop() { DHT.read11(dht_apin);//read the sensor Serial.print(DHT.humidity);//print the humidity data Serial.print("%"); Serial.print(", "); Serial.println(DHT.temperature);//print the temperature data

}


Single post: Blog_Single_Post_Widget
bottom of page