Czujnik wilgotności i temperatury DHT22 / AM2302

LANKON-032

Nowy produkt

Czyjnik Temperatury i wilgotności. 

Współpracujący z LanKontrolerem LK2 ( nie działa z LK3)z oprogramopwaniem z lini 3.xx od wersji 3.4 najnowszy soft

Więcej szczegółów

Oczekiwanie na dostawę tego towaru

5.44 USD brutto

Więcej informacji

Czujnik DHT22  (czasami podawane jako zamiennik do AM2302) 

Pasuje do Naszego lanKontrolera LK2, ARDUINO, RASPBERRY i wielu innych projektów.

(UWAGA: Nie współpracuje z LK3)

Do pomiaru wilgotności (najlepiej pracuje w zakresie 0%-100% RH z dokładnością ±2%RH)

i temperatury :-40°C  do 125°C ± 0,5 °C

Na końcu podajemy przykład dla 4 czujników na ARDUINO

Użyto wyświetlacza 4 wierszowego 4x

 

 Przykladowy EKRAN (w przykładzie zdjecie DHT11) w LanKontrolerze.:

 

(UWAGA Kabelki podłączeniowe do kupienia sa w tym dziale)  

 

 

 

Arduino sample code:  

#include "DHT.h"
#include <Wire.h> // standardowa biblioteka Arduino
#include <LiquidCrystal_I2C.h> // dolaczenie pobranej biblioteki I2C dla LCD

//obsługa I2C do wyświetlacz
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Ustawienie adresu 0x27/ Set Address of I2C 

#define DHTPIN1 2 // what digital pin we're connected to
#define DHTPIN2 3 // what digital pin we're connected to
#define DHTPIN3 4 // what digital pin we're connected to
#define DHTPIN4 5 // what digital pin we're connected to

// Uncomment whatever type you're using!
//#define DHTTYPE DHT11 // DHT 11
#define DHTTYPE1 DHT22 // DHT 22 (AM2302), AM2321
#define DHTTYPE2 DHT22 // DHT 22 (AM2302), AM2321
#define DHTTYPE3 DHT22 // DHT 22 (AM2302), AM2321
#define DHTTYPE4 DHT22 // DHT 22 (AM2302), AM2321
//#define DHTTYPE DHT21 // DHT 21 (AM2301)


int dhtc [4] = {1, 2, 3, 4};
char hnr [] = "h1, h2, h3, h4";

DHT dht1(DHTPIN1, DHTTYPE1);
DHT dht2(DHTPIN2, DHTTYPE2);
DHT dht3(DHTPIN3, DHTTYPE3);
DHT dht4(DHTPIN4, DHTTYPE4);


void setup() {
lcd.begin(20, 4); // Inicjalizacja LCD 2x16
//Serial.begin(9600);
lcd.print("DHTxx Multi sensor!");

dht1.begin();
dht2.begin();
dht3.begin();
dht4.begin();
delay(2000);
lcd .clear();
}

void loop() {
// Wait a few seconds between measurements.

// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
int h1 = dht1.readHumidity(); //bylo float , float jesli chcemy zpo przecinku
delay (250);
int h2 = dht2.readHumidity();
delay (250);
int h3 = dht3.readHumidity();
delay (250);
int h4 = dht4.readHumidity();
delay (250);
// Read temperature as Celsius (the default)
float t1 = dht1.readTemperature();
int t2 = dht2.readTemperature();
float t3 = dht3.readTemperature();
float t4 = dht4.readTemperature();
// Odczyt temperatury w Fahrenheit (isFahrenheit = true)
float f1 = dht1.readTemperature(true);
float f2 = dht2.readTemperature(true);
float f3 = dht3.readTemperature(true);
float f4 = dht4.readTemperature(true);

// Check if any reads failed and exit early (to try again).
if (isnan(h1) || isnan(t1) || isnan(f1)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Compute heat index in Fahrenheit (the default)
float hif1 = dht1.computeHeatIndex(f1, h1);
float hif2 = dht1.computeHeatIndex(f2, h2);
float hif3 = dht1.computeHeatIndex(f3, h3);
float hif4 = dht1.computeHeatIndex(f4, h4);
/// Compute heat index in Celsius (isFahreheit = false)
float hic1 = dht1.computeHeatIndex(t1, h1, false);
// float hic2 = dht1.computeHeatIndex(t2, h2, false);
// float hic3 = dht1.computeHeatIndex(t3, h3, false);
// float hic4 = dht1.computeHeatIndex(t4, h4, false);

//for (int x=1; x< 5; x++){
//
// lcd.setCursor (0,0);/////dhtc[x]);
// lcd.print ("H" + x );
//
// lcd.print(h[x]);
// Serial.print (h[x]);
// }


//for (int yy = 0; yy < 1; yy++) {
lcd.setCursor (0, 0);
lcd.print ("H");
lcd.print("1"); // liczba za H
lcd.print(": ");
lcd.print(h1);
lcd.print("%");
lcd.print(" ");
lcd.print(hic1);

// /}

//DHT nr 2 
lcd.setCursor(0, 1);
lcd.print ("H2: ");
lcd.print(h2);
lcd.print("%");
lcd.print(" T: ");
lcd.print(t2);
lcd.print("*C ");

///DHT 3
lcd.setCursor(0, 2);
lcd.print ("H3: ");
lcd.print(h3);
lcd.print("%");

// DHT 4
lcd.setCursor(0, 3);
lcd.print ("H4: ");
lcd.print(h4);
lcd.print("%");

delay(2000);
}

 

19 innych produktów w tej samej kategorii: