DHT11/DHT22を配線する
データ、電源、プルアップ抵抗を接続します。
「DHT11/DHT22を配線する」はCoddyKit上の無料Arduino & IoT Academyレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはArduino & IoT Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Arduino & IoT Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
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 2Add 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. 🎉
よくある質問
「DHT11/DHT22を配線する」レッスンは無料ですか?
はい。「DHT11/DHT22を配線する」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Arduino & IoT Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Arduino & IoT Academyコースには全4レッスンが含まれています。
「DHT11/DHT22を配線する」で何を学びますか?
データ、電源、プルアップ抵抗を接続します。 ブラウザで直接実行するハンズオンコードでArduino & IoT Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Arduino & IoT Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのArduino & IoT Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。
「DHT11/DHT22を配線する」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このArduino & IoT Academyレッスンでコードを書いて実行できますか?
はい。すべてのArduino & IoT Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- DHT11/DHT22を配線する
- DHTライブラリをインストールする
- 温度と湿度を読み取る
- 読み取り失敗に対処する