Cov txheej txheem:

DISPLAY HUMIDITY THIAB TEMPERATURE ntawm LCD nrog ARDUINO NANO: 5 Kauj Ruam
DISPLAY HUMIDITY THIAB TEMPERATURE ntawm LCD nrog ARDUINO NANO: 5 Kauj Ruam

Video: DISPLAY HUMIDITY THIAB TEMPERATURE ntawm LCD nrog ARDUINO NANO: 5 Kauj Ruam

Video: DISPLAY HUMIDITY THIAB TEMPERATURE ntawm LCD nrog ARDUINO NANO: 5 Kauj Ruam
Video: WIZZVENT, the Ultimate Moisture Control Solution for Garages! 2024, Kaum ib hlis
Anonim
DISPLAY HUMIDITY THIAB TEMPERATURE ntawm LCD nrog ARDUINO NANO
DISPLAY HUMIDITY THIAB TEMPERATURE ntawm LCD nrog ARDUINO NANO

Cov lus qhia hauv qab no qhia nrog ua qhov yooj yim lcd interface nrog arduino nano.

Kauj Ruam 1: Yuav Tsum Tau:

Yuav tsum muaj

  1. DTH11 Vaum thiab Kub Sensor
  2. Arduino Nano Cov
  3. 16*2 LCD zaub
  4. I2C qhov module
  5. Txuas xov hlau

Thiab

  • Arduino IDE Cov
  • Arduino tsev qiv ntawv

I2c tsev qiv ntawv (LiquidCrystal_I2C)

DHT tsev qiv ntawv (DHT.h)

Kauj Ruam 2: Txuas Cov Khoom Siv rau Nano

Txuas Cov Khoom Siv rau Nano
Txuas Cov Khoom Siv rau Nano

Txuas cov khoom siv rau nano raws li kev tshuaj ntsuam, DTH11 Rau Arduino Nano

3.3v kwv

GND GND

Tawm D4 I2C

Lcd to Nano

GND NWG

SDA AW 4

SWB A5

Vc5v wb

Kauj Ruam 3: Suav nrog Lub Tsev Qiv Ntawv

Suav nrog Tsev Qiv Ntawv
Suav nrog Tsev Qiv Ntawv

Rub tawm thiab suav nrog Cov tsev qiv ntawv hauv qab no, DHT sensor tsev qiv ntawv (DHT.h)

I2c tsev qiv ntawv (LiquidCrystal_I2C.h)

Xws li cov duab saum toj no.

Mus rau ketch suav nrog Lub Tsev Qiv Ntawv Ntxiv Zip Cov Ntaub Ntawv thiab tom qab ntawd xaub daim nplaub tshev, Kaw IDE thiab qhib nws dua, Koj tuaj yeem rub tawm cov tsev qiv ntawv los ntawm cov kab ntawv txuas hauv qab no, bitbucket.org/fmalpartida/new-liquidcrysta…

codeload.github.com/adafruit/DHT-sensor-li…

Kauj Ruam 4: Luam theej I2C thiab Nrhiav Qhov Chaw Nyob

Rub lub I2C scanner thiab nrhiav koj qhov chaw nyob i2c thiab tom qab ntawd nkag mus rau tus lej;

Koj tuaj yeem pom tus lej scanner los ntawm no thiab.

www.mediafire.com/file/f7oaa4et779yaaz/i2c_…

Kauj ruam 5: CODE

Tus CODE
Tus CODE
Tus CODE
Tus CODE

// Sau thiab xa cov cai rau arduino nano

#suav nrog "DHT.h" #define SensorPin 4 // txuas tus pin ntawm dht sensor rau D4 tus pin ntawm arduino nano

#Txhais Dht DHT11

DHT dht (SensorPin, Dht);

#suav nrog

#suav nrog

LiquidCrystal_I2C lcd (0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // teeb I2C Chaw Nyob raws li 0x3F

void teeb tsa () {

Serial.begin (9600);

lcd.begin (16, 2);

Serial.println ("Kev Ntsuas Kub thiab Vaum");

dht.begin ();

}

void voj () {

int hum = dht.readHumidity ();

int temp = dht.readTemperature ();

lcd.setCursor (0, 0);

lcd.print ("Temp:");

lcd.print (kub);

lcd.print ("C");

lcd.setCursor (0, 1);

lcd.print ("Vaum:");

lcd.print (hwm);

lcd.print ("%");

Serial.print ("\ n Tam sim no Kub:");

Serial.print (temp);

Serial.print ("C");

Serial.print ("\ n Tam sim no Vaum:");

Serial.print (hum);

Serial.print ("%");

ncua (2500);

}

Cov txiaj ntsig tau pom nrog cov duab saum toj no.

Ua tsaug, Diav.

Pom zoo: