I Tried Reading Temperature with Arduino – Here’s What Surprised Me

#include "DHT.h"
#define DHTPIN 2     
#define DHTTYPE DHT11   
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  dht.begin();
}
void loop() {
  float t = dht.readTemperature();
  Serial.print("Temp: ");
  Serial.println(t);
  delay(2000);
}

Tip: Always check where you place your sensors. Data is only useful if it’s accurate.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top