DIY Arduino Temperature Sensor with LCD Display
This beginner-friendly Arduino project teaches you how to measure temperature and display it on a screen.
### 🔧 What You’ll Need:
- Arduino Uno
- DHT11 or LM35 temperature sensor
- 16x2 LCD screen with I2C module
- Breadboard + jumper wires
---
### 🧠What You'll Learn:
- How to read temperature data from a sensor
- How to output data to an LCD
- Basics of using I2C communication
---
### 💻 Code Sample:
```cpp
#include <LiquidCrystal_I2C.h>
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.begin();
lcd.backlight();
dht.begin();
}
void loop() {
float temp = dht.readTemperature();
lcd.setCursor(0, 0);
lcd.print("Temp: ");
lcd.print(temp);
lcd.print(" C");
delay(2000);
}
Comments
Post a Comment