Cov txheej txheem:

Ntsuas Kub thiab Vaum Siv DHT11 / DHT22 thiab Arduino: 4 Kauj Ruam
Ntsuas Kub thiab Vaum Siv DHT11 / DHT22 thiab Arduino: 4 Kauj Ruam

Video: Ntsuas Kub thiab Vaum Siv DHT11 / DHT22 thiab Arduino: 4 Kauj Ruam

Video: Ntsuas Kub thiab Vaum Siv DHT11 / DHT22 thiab Arduino: 4 Kauj Ruam
Video: QHIA QHOV TSEEB - KUB VAJ LOOG TSUA NEW MUSIC VIDEO 2022 2024, Hlis ntuj nqeg
Anonim
Image
Image

Hauv phau ntawv qhia Arduino no peb yuav kawm paub siv DHT11 lossis DHT22 lub ntsuas ntsuas ntsuas kub thiab av noo nrog Arduino board.

Khoom siv

  • Arduino UAS
  • DHT11 lossis DHT22
  • 16 x 2 LCD Zaub
  • Cov qhob cij
  • Jumper Cables
  • Arduino Kab

Kauj ruam 1: Taw qhia:

Taw qhia
Taw qhia
Taw qhia
Taw qhia

Cov ntsuas no nrov heev rau cov nyiam siv hluav taws xob vim tias muaj nqi pheej yig tab sis tseem muab kev ua tau zoo. Nov yog qhov tshwj xeeb tseem ceeb thiab sib txawv ntawm ob lub ntsuas no:

DHT22 yog tus nqi kim dua uas pom tseeb muaj qhov tshwj xeeb zoo dua. Nws qhov ntsuas kub ntau yog los ntawm -40 txog +125 degrees Celsius nrog +-0.5 degrees raug, thaum DHT11 kub ntau yog los ntawm 0 txog 50 degrees Celsius nrog +-2 degrees raug. Tsis tas li DHT22 lub ntsuas cua muaj qhov ntsuas huab cua zoo dua, los ntawm 0 txog 100% nrog 2-5% qhov tseeb, thaum DHT11 cov av noo ntau yog los ntawm 20 txog 80% nrog 5% qhov tseeb.

Muaj ob qhov tshwj xeeb uas DHT11 zoo dua DHT22. Qhov ntawd yog tus qauv piv txwv uas rau DHT11 yog 1Hz lossis nyeem ib qho thib ob, thaum DHT22 tus qauv piv txwv yog 0, 5Hz lossis ib qho nyeem txhua ob vib nas this thiab DHT11 muaj lub cev me me. Kev khiav hauj lwm qhov hluav taws xob ntawm ob lub ntsuas hluav taws xob yog los ntawm 3 txog 5 volts, thaum lub zog tam sim no siv thaum ntsuas yog 2.5mA.

Kauj Ruam 2: Schematics:

Schematics
Schematics

Kauj ruam 3: Source Code:

/ * © Techtronic Harsh */

#suav nrog "DHT.h" // suav nrog DHT lub tsev qiv ntawv

#suav nrog // suav nrog lub tsev qiv ntawv LiquidCrystal #define DHTPIN 12 // txhais DHT tus pin #define DHTTYPE DHT11 // txhais DHTTYPE DHT11/DHT22

LiquidCrystal lcd (2, 3, 4, 5, 6, 7); // txhais LCD pins (RS, E, D4, D5, D6, D7)

DHT dht (DHTPIN, DHTTYPE);

void teeb tsa ()

{dht.begin (); lcd.begin (16, 2); // initializes LCD thiab qhia qhov ntev} void loop () {ntab temp = dht.readTemperature (); ntab humi = dht.readHumidity (); lcd.setCursor (0, 0); lcd.print ("Temp:"); lcd.print (kub); lcd.print ("C"); lcd.setCursor (0, 1); lcd.print ("Humi:"); lcd.print (humi); lcd.print (" %"); ncua (2000); }

/*

© Techtronic Harsh

*/

Pom zoo: