Community project

Classroom Climate Alert

Photo of Classroom Climate Alert
Generated with AI

Carla Pereira Menino

Published November 28, 2026

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

Wiring diagram for Classroom Climate Alert
Loading diagram…

Gather all the parts

QtyComponent
1

DHT11 Gravity DFR0067

DFRobot DFR0067 module; manufacturer specifies 3–5.5 V DC.

1

LCD 16x2 I2C

16x2 character LCD display with I2C backpack

1

10kΩ Potentiometer

10 kΩ linear (B10K) rotary potentiometer in the common 16 mm panel style: metal can, M7 threaded bushing for mounting through a panel, a 6 mm knurled split shaft for push-on knobs, and three PCB pins in a row 5 mm apart. Connect the outer pins across 3.3 V or 5 V and ground; the middle wiper pin then gives an adjustable voltage for an ADC input over about 300° of rotation.

1

LED

Verde

Standard 3mm/5mm through-hole LED. A current-limiting series resistor is added automatically.

1

LED

Vermelho

Standard 3mm/5mm through-hole LED. A current-limiting series resistor is added automatically.

1

Resistor

220Ω

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

220Ω

Through-hole resistor (current-limiting in series with an LED)

1

Piezo Buzzer

Small passive piezo buzzer (TDK PS1240) for beeps, tones and alerts. It has no built-in oscillator, so drive one lead with a 3-30 V square wave from a microcontroller pin using tone() or PWM and connect the other lead to ground. It is loudest around 4 kHz and works from about 2 to 10 kHz; driving both leads in antiphase roughly doubles the volume.

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"

FunctionsensorArduino
powerVCC5V
groundGNDGND
dataDATAGPIO 2

2. Connections between "lcd" and "Arduino"

FunctionlcdArduino
powerVCC5V
groundGNDGND
i2cSDAGPIO 18
i2cSCLGPIO 19

3. Connections between "ajuste" and "Arduino"

FunctionajusteArduino
powerVCC5V
groundGNDGND
adcWIPERGPIO 14

4. Connections between "rv" and "Arduino"

FunctionrvArduino
digitalP1GPIO 4

5. Connections between "verde" and "Arduino"

FunctionverdeArduino
digitalANODE → Resistor P2EXT
groundGNDGND

6. Connections between "rr" and "Arduino"

FunctionrrArduino
digitalP1GPIO 5

7. Connections between "vermelho" and "Arduino"

FunctionvermelhoArduino
digitalANODE → Resistor P2EXT
groundGNDGND

8. Connections between "aviso" and "Arduino"

FunctionavisoArduino
pwmSIGGPIO 6
groundGNDGND

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.

Open in Schematik