Pezonurlatgich.(Buzzer musiqa notasi). Pezonurlatgich(Buzzer) datchigini boshqarish: tonni o‘zgartirish. Transtistor xususiyatini namoyish etish. Elektrorichak misolida aylanish o‘zgartirish. Rele


Download 1.09 Mb.
bet21/21
Sana22.10.2023
Hajmi1.09 Mb.
#1715747
1   ...   13   14   15   16   17   18   19   20   21
Bog'liq
3-dedline Soliyev S O\'rnatilgan tizimlar

56-rasm. DHT 22 Ulanish sxemasi.
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(115200);
Serial.println(F("DHT22 example!"));
dht.begin();
}
void loop() {
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();
// Check if any reads failed and exit early (to try again).
if (isnan(temperature) || isnan(humidity)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
Serial.print(F("Humidity: "));
Serial.print(humidity);
Serial.print(F("% Temperature: "));
Serial.print(temperature);
Serial.println(F("°C "));
// Wait a few seconds between measurements.
delay(2000);
}
DHT22 (AM2302) termo-va-issyqlik datchisi juda yuqori qulaylik va to‘g‘ri ishlashga ega bo‘lsa ham, uning bir nechta kamchiliklari mavjud bo‘lishi mumkin. Quyidagi kamchiliklarni eslatibo‘tamiz:
Javob uzatish va narxi: DHT22-nio‘qish uchun kamchiliklardan biri,o‘qish uchun javob uzatishi vaqtinchalik bo‘lishi mumkin. Buning natijasida Arduino va boshqa mikrokontrollerlar bir oz davom etishi mumkin. Datchio‘qish jarayonida keyinchalik kamchiliklar nazariga olinishi mumkin, bu esa natijalarning kech bo‘lishiga olib kelishi mumkin.




void setup() {
pinMode(8,OUTPUT);
}

void loop() {


tone(8,262,200);
delay(250);
tone(8,262,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,440,200);
delay(250);
tone(8,440,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,349,200);
delay(250);
tone(8,349,200);
delay(250);
tone(8,330,200);
delay(250);
tone(8,330,200);
delay(250);
tone(8,294,200);
delay(250);
tone(8,294,200);
delay(250);
tone(8,262,200);
delay(250);
tone(8,262,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,349,200);
delay(250);
tone(8,349,200);
delay(250);
tone(8,330,200);
delay(250);
tone(8,330,200);
delay(250);
tone(8,294,200);
delay(250);
tone(8,294,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,349,200);
delay(250);
tone(8,349,200);
delay(250);
tone(8,330,200);
delay(250);
tone(8,330,200);
delay(250);
tone(8,294,200);
delay(250);
tone(8,294,200);
delay(250);
tone(8,262,200);
delay(250);
tone(8,262,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,440,200);
delay(250);
tone(8,440,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,392,200);
delay(250);
tone(8,349,200);
delay(250);
tone(8,349,200);
delay(250);
tone(8,330,200);
delay(250);
tone(8,330,200);
delay(250);
tone(8,294,200);
delay(250);
tone(8,294,200);
delay(250);
tone(8,262,200);
delay(250);
tone(8,262,200);
delay(250);
}


Xulosa.


Fotoqarshilik, yokifotorezistor, nurenergiyasigabo'lganmurojatinio'rganishuchunishlatiladi. U avtomatizatsiyatizimlarida, judayorqinbirholatdachiroqningmavjudliginiyokichiroqkuchio'zgaribturib, avtomatikjarayonlarniboshlatishdavato'xtatishda, aniqjoylashganishlabchiqarishvabog'liqsohalardaishlatiladi.
Download 1.09 Mb.

Do'stlaringiz bilan baham:
1   ...   13   14   15   16   17   18   19   20   21




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling