Devices & Components
Arduino Leonardo with Headers
Resistor 10k ohm
DHT11 Temperature & Humidity Sensor (4 pins)
Rotary potentiometer (generic)
Standard LCD - 16x2 White on Blue
Project description
Code
DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo
arduino
Easy temperature and humidity sensor on DHT11 with LCD
1// DHT11 sensor 2 3#include <DHT.h> 4#define DHTPIN 7 // what digital 5 pin we're connected to 6#define DHTTYPE DHT11 //DHT 11 7 8// LCD display 9 10#include 11 <LiquidCrystal.h>; 12LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 13 14DHT dht (DHTPIN, 15 DHTTYPE); //Initialize DHT sensor. 16 17 18void setup() { 19 // put your setup 20 code here, to run once: 21 22 23// Serial.begin(9600); 24dht.begin(); 25 26} 27 28void 29 loop() { 30 delay(10000); // Waiting time between measurements 31 32float t 33 = dht.readTemperature(); // Read temperature in *C (default) 34float h = dht.readHumidity(); 35 // Read humidity % 36 37float hic = dht.computeHeatIndex(t, h); 38 39 40/*Serial.print("Temerature: 41 "); 42Serial.print(t); 43Serial.print("*C\ "); 44Serial.print("Humidity: 45 "); 46Serial.print(h); 47Serial.print("%\ "); 48Serial.print("Heat index: 49 "); 50Serial.println(hic); 51*/ 52 53 54 55// LCD display 56 57lcd.begin(16, 58 2); // display diamensions 59lcd.setCursor(0,0); 60lcd.print("T="); 61lcd.setCursor(2,0); 62lcd.print(t); 63lcd.setCursor(4,0); 64lcd.print("*C 65 "); 66lcd.setCursor(0,1); 67lcd.print("H="); 68lcd.setCursor(2,1); 69lcd.print(h); 70lcd.setCursor(4,1); 71lcd.print("% 72 "); 73lcd.setCursor(8,1); 74lcd.print("HI="); 75lcd.print(hic); 76 77} 78
Downloadable files
DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo
Simple temperature and humidity sensor with LCD
DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo
DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo
DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo

DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo
DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo

DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo
Simple temperature and humidity sensor with LCD
DHT11 temperature and humidity sesnor with LCD on Arduino Leonardo
Comments
Only logged in users can leave comments