0Pricing
Arduino & IoT Academy · Lesson

Read Temperature & Humidity

Call the library to get real climate numbers.

Time to Read

Your sensor is wired and the library is ready. Now you will ask it for real numbers and print them to the Serial Monitor. 🌡️

Read Temperature

Call readTemperature() to get the current value in Celsius. Store it in a float because the reading often has decimals.

float t = dht.readTemperature();

All lessons in this course

  1. Wire the DHT11/DHT22
  2. Install the DHT Library
  3. Read Temperature & Humidity
  4. Handle Failed Reads
← Back to Arduino & IoT Academy