توصيل DHT11/DHT22
صِل البيانات والطاقة ومقاومة السحب إلى الأعلى.
توصيل DHT11/DHT22 درس مجاني في Arduino & IoT Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في 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/7) وفتح باقي دورة Arduino & IoT Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
ماذا ستتعلم في «توصيل DHT11/DHT22»؟
صِل البيانات والطاقة ومقاومة السحب إلى الأعلى. تتمرن على Arduino & IoT Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Arduino & IoT Academy؟
لا تُشترط خبرة سابقة. Arduino & IoT Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «توصيل DHT11/DHT22»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Arduino & IoT Academy هذا؟
نعم. كل درس في Arduino & IoT Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- توصيل DHT11/DHT22
- تثبيت مكتبة DHT
- قراءة درجة الحرارة والرطوبة
- معالجة القراءات الفاشلة