medium
สร้างสถานีวัดอากาศด้วย ESP32
Admin
2 ชั่วโมง
Feb 01, 2026
สแกนเพื่อเข้าชม
ขั้นตอนการทำ
7 ขั้นตอน1
ขั้นตอนที่ 1: ต่อวงจร
ต่อขา Data ของ DHT11 เข้ากับขา D4 ของ ESP32, VCC เข้า 3.3V และ GND เข้า GND
2
ขั้นตอนที่ 2: Preparation and Safety
Before starting, ensure you have a clean workspace and all safety gear is worn. Check all tools are in good working condition.
3
ขั้นตอนที่ 3: ติดตั้ง Library
ใน Arduino IDE ไปที่ Sketch > Include Library > Manage Libraries... ค้นหา "DHT sensor library" แล้วติดตั้ง
4
ขั้นตอนที่ 4: Main Assembly - Phase 1
Begin by assembling the base structure. Follow the diagram carefully. Ensure all connections are tight and secure.
5
ขั้นตอนที่ 5: เขียนโค้ดอ่านค่า
ก๊อปปี้โค้ดสำหรับอ่านค่าอุณหภูมิและความชื้น
cpp
#include "DHT.h"
#define DHTPIN 4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
float h = dht.readHumidity();
float t = dht.readTemperature();
Serial.print("Hum: ");
Serial.print(h);
Serial.print(" Temp: ");
Serial.println(t);
delay(2000);
}
6
ขั้นตอนที่ 6: Main Assembly - Phase 2
Continue with the secondary components. Attach them to the base structure created in step 1. Double check measurements.
7
ขั้นตอนที่ 7: Final Polish and Testing
Sand down any rough edges (if applicable) or tidy up wiring. Test the functionality of your project to ensure everything works as intended.
ความคิดเห็น 0
ยังไม่มีความคิดเห็น
เขียนความคิดเห็น
กำลังตอบกลับไปยัง