Skip to content

Temperature and Humidity with DHT11

Beginning of the lesson

Temperature and Humidity with DHT11

Your ESP32 can already blink an LED. Now let us give it a sense of the weather. The DHT11 is a tiny, cheap sensor that tells your board two things about the air around it: how warm it is and how damp it is. By the end of this lesson you will have wired one up and printed live temperature and humidity to your screen.

The big idea

Inside the little blue box are two miniature parts: a thermistor (a resistor whose value changes with heat) and a humidity-sensing capacitor (whose value changes with moisture). A tiny chip inside reads both, turns them into plain numbers, and hands those numbers to your ESP32 over a single wire. You never touch the raw electronics — you just ask a library "what is the temperature?" and it answers.

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 16
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers