0Pricing
Arduino & IoT Academy · Lesson

Wire the DHT11/DHT22

Connect data, power, and a pull-up resistor.

Wire the DHT11/DHT22 is a free Arduino & IoT Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Arduino & IoT Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Meet the DHT Sensor

A DHT sensor measures both temperature and humidity in one tiny package. It is the friendliest way to give your project a sense of climate. 🌡️

DHT11 vs DHT22

The DHT11 is cheap and good enough for hobby projects. The DHT22 costs a bit more but reads a wider range with better accuracy.

Just One Data Pin

What makes DHT lovely is its single data pin. One wire carries both readings to your board, so wiring stays simple.

Three Pins to Know

A bare DHT has three useful pins: VCC for power, GND for ground, and DATA for the signal. A fourth pin is usually unused.

Power It Correctly

Connect VCC to the 5V pin on your Arduino and GND to a ground pin. Get this right first, or the sensor stays silent.

The Data Line

Run the DATA pin to any digital pin you like, such as pin 2. You will name this exact pin later in your code.

#define DHTPIN 2

Add a Pull-Up Resistor

The data line needs a pull-up resistor, about 10k ohms, between DATA and VCC. It keeps the idle signal clean and steady.

Why the Pull-Up Helps

Without that resistor, the data line can float and report scrambled values. The pull-up gives the line a reliable resting voltage.

Modules Make It Easy

Many DHT modules come on a small board with the resistor already soldered on. Then you only wire three pins and skip the resistor.

Mind the Orientation

Always check the pin labels printed on your sensor. Swapping VCC and GND can overheat the part, so look before you power up.

Double-Check Before Power

Trace each wire one more time: power, ground, and data to the right digital pin. A calm check now saves confusing readings later.

Quick Check

You are wiring a bare DHT11. What component does its data line need to stay reliable?

Recap

You met the DHT family, wired VCC, GND, and a data pin, and added a 10k pull-up so the signal stays clean and trustworthy. 🎉

Frequently asked questions

Is the “Wire the DHT11/DHT22” lesson free?

Yes — the full text of “Wire the DHT11/DHT22” is free to read here on the web, and the Arduino & IoT Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Arduino & IoT Academy course, upgrade to CoddyKit PRO.

What will I learn in “Wire the DHT11/DHT22”?

Connect data, power, and a pull-up resistor. You practise Arduino & IoT Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Arduino & IoT Academy?

No prior experience is required. Arduino & IoT Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Wire the DHT11/DHT22” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Arduino & IoT Academy lesson?

Yes. Every Arduino & IoT Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

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