The Classroom Climate Alert monitors temperature and humidity in real-time, displaying readings on a 16x2 LCD screen and alerting when conditions exceed a user-adjustable threshold. Built around an Arduino Uno with a DHT11 sensor, this project combines environmental monitoring with visual and audio feedback to help maintain comfortable classroom conditions.
This guide provides a complete parts list, wiring diagram, and step-by-step assembly instructions for connecting the DHT11 sensor, I2C LCD display, potentiometer threshold control, status LEDs, and piezo buzzer. The included firmware handles sensor readings, threshold logic with hysteresis, and alert triggering—ready to upload and customize for your space.
Wiring diagram

Gather all the parts
Assemble it in 4 steps
1. Ligar o sensor e o ecrã
Com o USB desligado, ligue a alimentação de ambos a 5V e GND. Ligue DATA do módulo DHT11 Gravity DFR0067 a D2, SDA do LCD a A4 e SCL a A5. Use as marcações dos módulos, não a ordem dos fios.
- Se o LCD estiver iluminado mas sem letras, ajuste devagar o pequeno parafuso de contraste atrás do ecrã.
2. Ligar o botão de ajuste
Ligue os dois terminais exteriores do potenciómetro a 5V e GND, e o terminal central a A0.
3. Montar os indicadores numa placa de ensaio
Ligue D4 à perna longa do LED verde através de uma resistência de 220 Ω e D5 à perna longa do vermelho através da outra. Ligue ambas as pernas curtas a GND.
4. Ligar o aviso sonoro opcional
Ligue SIG do piezo passivo a D6 e o outro terminal a GND. Pode deixar o piezo desligado para um teste silencioso.
Review all connections
1. Connections between "sensor" and "Arduino"
2. Connections between "lcd" and "Arduino"
3. Connections between "ajuste" and "Arduino"
4. Connections between "rv" and "Arduino"
5. Connections between "verde" and "Arduino"
6. Connections between "rr" and "Arduino"
7. Connections between "vermelho" and "Arduino"
8. Connections between "aviso" and "Arduino"
Deploy the firmware
#include <Arduino.h>
#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>
#include <DHT.h>
#include <stdio.h>
#include <string.h>
DHT sensor(2,DHT11);
hd44780_I2Cexp lcd;
constexpr bool som = true;
bool alerta=false, valido=false, tela=false, mediu=false;
float temp, hum;
unsigned long ultima=0;
void linha(byte y,const char* texto) {
static char anterior[2][17] = {};
char atual[17];
snprintf(atual,sizeof atual,"%-16.16s",texto);
if(tela && strcmp(atual,anterior[y])) {
lcd.setCursor(0,y); lcd.print(atual); strcpy(anterior[y],atual);
}
}
void setup(){
pinMode(4,OUTPUT); pinMode(5,OUTPUT); pinMode(6,OUTPUT);
sensor.begin();
tela=lcd.begin(16,2)==0;
}
void loop(){
unsigned long agora=millis();
if(agora-ultima>=2000){
ultima=agora;
temp=sensor.readTemperature(); hum=sensor.readHumidity();
valido=!isnan(temp)&&!isnan(hum); mediu=true;
}
long soma=0;
for(byte i=0;i<8;i++) soma+=analogRead(A0);
int limite=18+(soma*17+4092)/8184;
bool antes=alerta;
alerta=valido && (alerta ? temp>limite-1 : temp>=limite);
if(!antes && alerta && som) tone(6,2400,200);
if(antes && !alerta) noTone(6);
digitalWrite(4,valido&&!alerta); digitalWrite(5,alerta);
char a[17],b[17];
if(valido) snprintf(a,sizeof a,"T:%d%cC H:%d%%",(int)round(temp),223,(int)round(hum));
else strcpy(a,mediu?"Erro no DHT11":"A ler sensor...");
snprintf(b,sizeof b,"Lim:%d%cC %s",limite,223,valido?(alerta?"ALERTA":"OK"):"--");
linha(0,a); linha(1,b);
delay(40);
}Remix this project
Make it yours in one click
Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.




