Arduinoda Namlik va Harorat datchigini takomillashtirish


Download 228.44 Kb.
Sana20.06.2023
Hajmi228.44 Kb.
#1634889
Bog'liq
NabijonovNodirbekArduino 3



Arduinoda Namlik va Harorat datchigini takomillashtirish

DTH11 datchigi yordamida xona haroratini boshqaradigan qurilma qilish .


Ishlash printsipi: DTH11 datchigi xona haroratini aniqlaydi va displeyga yuboradi belgilangan gradusga qarab 5V DC FAN qurilmasi ishga tushadi.
Arduino bilan LCD ulanishi LCD to'g'ridan-to'g'ri Arduino-ga ulangan . LCD-RS, EN, D4, D5, D6 va D7 pinlarini Arduino-ning 7, 6, 5, 4, 3 va 2 raqamli pin raqamlariga ulang.

Kerakli komponentlar :





Dastur kodi:
//Robu.in #include "DHT.h" float hi = dht.computeHeatIndex(f, h);
#include
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#define DHTPIN 12
#define DHTTYPE DHT11
#define pwm 9 byte degree[8] = {
0b00011, 0b00011,0b00000, 0b00000,
0b00000, 0b00000, 0b00000, 0b00000 };
void setup() { lcd.begin(16, 2); z`
lcd.createChar(1, degree);
lcd.clear();
lcd.print(" Fan Speed ");
lcd.setCursor(0,1);
lcd.print(" Controlling ");
delay(2000); analogWrite(pwm, 255);
lcd.clear(); lcd.print("Robu ");
delay(2000); Serial.begin(9600);
dht.begin(); } void loop(){
delay(2000);
float h = dht.readHumidity();
float t = dht.readTemperature();
float f = dht.readTemperature(true);
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return; }
Download 228.44 Kb.

Do'stlaringiz bilan baham:




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