กลับไปหน้ารวมไฟล์
how-to-use-dht11-366877.md

วิธีใช้ DHT11

หากคุณใช้ DHT11 แบบ 3 pin; ตรวจสอบให้แน่ใจว่าด้านหน้าของโมดูล DHT11 หันเข้าหาคุณดังภาพ

รูปภาพของเซ็นเซอร์ DHT11

รายละเอียดทางเทคนิคเพิ่มเติม

พื้นฐานการตรวจจับสภาพแวดล้อม

DHT11 เป็นเซ็นเซอร์แบบคอมโพสิตที่ประกอบด้วยส่วนประกอบสำหรับวัดความชื้นแบบ resistive และส่วนประกอบสำหรับวัดอุณหภูมิแบบ NTC

  • One-Wire Protocol: DHT11 ใช้ serial protocol แบบ single-wire ที่กำหนดเอง การส่งข้อมูลแต่ละครั้งประกอบด้วยข้อมูล 40 บิต (5 bytes) รวมถึง 8-bit checksum สำหรับการตรวจสอบข้อผิดพลาด
  • Sampling Rate: เซ็นเซอร์มี sampling rate 1Hz (หนึ่งครั้งต่อวินาที) หลีกเลี่ยงการ poll ข้อมูลอย่างรวดเร็วเพื่อให้มั่นใจถึงความเสถียรของเซ็นเซอร์

การตีความข้อมูล

  • Library Abstraction: ใช้ library DHT.h หรือ SimpleDHT เพื่อจัดการกับ timing ที่ซับซ้อนซึ่งจำเป็นสำหรับ start-signal และ data-bit interpretation
  • Display Output: Arduino จะจัดรูปแบบข้อมูล 8-bit integer ให้เป็น string ที่อ่านง่าย (เช่น "Temp: 25°C, Hum: 60%") ซึ่งจะถูกส่งไปยัง Serial Monitor หรือ character LCD

ข้อมูล Frontmatter ดั้งเดิม

title: "How to use DHT11"
description: "DHT11 Tutorial, That is all I got to say."
author: "the_com3_port"
category: ""
tags:
  - "weather"
  - "arduino"
  - "arduino"
views: 2345
likes: 0
price: 99
difficulty: "Easy"
components:
  - "1x Jumper wires (generic)"
  - "1x Resistor 10k ohm"
  - "1x Arduino UNO"
  - "1x Breadboard (generic)"
  - "1x DHT11 Temperature & Humidity Sensor (4 pins)"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://projects.arduinocontent.cc/faf8d480-931d-46e0-94b0-09c62c1db977.ino"
  - "https://projects.arduinocontent.cc/faf8d480-931d-46e0-94b0-09c62c1db977.ino"
documentationLinks: []
passwordHash: "008add2864fdc3e42a0e1df7c2a7256947ad34c9e68cf2974b9c3a4ef422cb9b"
encryptedPayload: "U2FsdGVkX18dewowpKS2o0/m1EKa9TkZ6V8fEjarnNLZw8W3fRO+SKyR7cww7pICaADonnREVgIv2Z5A7uVEQu8UapP2DLGn/9eR5zcd/fI="
seoDescription: "Learn how to use the DHT11 Sensor with Arduino to measure temperature and humidity. Complete tutorial with wiring and code."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/how-to-use-dht11-366877_cover.jpg"
lang: "th"