Arduino tutorial temp and humidity sensor

So here’s a temperature and humidity sensor for your 3d printer enclosure or filament box, that displays the humidity percentage and temp in Celsius on a lcd screen. It’s made using an Arduino Uno R3

Materials list:

1—DHT sensor (dual humidity and temperature sensor)
1— lcd 2 line display
19—short wires
1—bread board

Insert the DHT into the breadboard,

connect the left most pin to digital pin #2 on the arduino

Connect the middle pin to the positive rail on the bread board

Connect the right pin to the negative rail on the bread board

Insert the potentiometer into the bread board.

1 Like

Connect the top left connector of the potentiometer to the positive rail

Connect the top right connector of the potentiometer to the negative rail
Plug the lcd into the bread board
Connect the bottom post of the potentiometer to the v0 connector of the lcd

1 Like

Lcd connections:
Vss connects to negative rail

Vdd connects to positive

Rs connects to arduino digital pin 7

Rw connects to the negative rail

E connects to arduino digital pin 8
D4 connects to digital pin 9
D5 connects to digital pin 10

D6 connects to digital pin 11

D7 to to digital pin 12

A connects to positive rail

K connects to negative rail

Connect the positive rail to the 5v pin on the arduino, and the negative rail to the Gnd pin on the arduino

And that’s it for the connections.

1 Like

Here is the code for the IDE upload this into the Arduino

#include “DHT.h”
#include <LiquidCrystal.h>
#define DHTPIN 2
#define DHTTYPE DHT11
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

Void setup() {
lcd.begin(16, 2);
lcd.print(“Hum% & Temp© :”);

void loop(){
delay (2000);
lcd.setCursor(0, 1);

float h = dht.readHumidity();
float t = dht.readTemperature();

The libraries are the dht and lcd libraries from adafruit
If it all works out this is what you should see, values different of course


Awesome. What is the range it can measure?

Here is the specs for the DHT 11 sensor

Temperature Range: 0°C to 50°C. Humidity Range: 20% to 90% Resolution: Temperature and Humidity both are 16-bit. Accuracy: ±1°C and ±1%

The potentiometer changes screen brightness. I’m going to design a plastic case for it so that it can be mounted. Should run as an accessory to a rasberry pi.

All parts are available on Amazon, or as an elegoo super starter kit.