Introduction
A Smart Classroom System is an automated and IoT-enabled system designed to enhance teaching and learning experiences. By integrating sensors, microcontrollers, and smart devices, it allows automated lighting, attendance, environment monitoring, and resource management.
This project is ideal for schools, colleges, and training centers looking to implement modern smart classrooms.
Objective of the Project
- To automate classroom devices (lights, fans, projector, etc.)
- To monitor environment conditions (temperature, humidity, occupancy)
- To automate attendance using RFID or QR codes
- To integrate IoT for remote monitoring and control
- To improve energy efficiency and comfort in classrooms
Working Principle
- PIR sensors detect classroom occupancy
- Microcontroller (Arduino/ESP32) controls lights and fans based on occupancy
- Temperature and humidity sensors monitor environment conditions
- RFID/QR system records attendance of students automatically
- Optional IoT module sends real-time data to a cloud server or mobile app
- Alerts can be generated for abnormal conditions (temperature, humidity, or unauthorized access)
Components Required
- Arduino Uno / ESP32
- PIR Motion Sensor
- DHT11/DHT22 Temperature & Humidity Sensor
- RFID Module / QR Scanner (for attendance)
- Relay Module (for controlling lights/fans/projector)
- Buzzer & LEDs (alerts)
- LCD / OLED Display (optional)
- Wi-Fi Module (ESP8266 / ESP32 built-in) for IoT
- Jumper wires and power supply
Block Diagram
PIR + Temperature/Humidity Sensors
↓
Microcontroller (Arduino/ESP32)
↓
Relay Module → Lights, Fans, Projector
↓
RFID / QR Scanner → Attendance
↓
Buzzer & LED Alerts
↓
Optional: IoT Cloud / Mobile App
Circuit Connections (Arduino Example)
PIR Sensor
VCC → 5V
GND → GND
OUT → D2
DHT11 Sensor
VCC → 5V
GND → GND
Data → D3 (with 10K pull-up resistor)
Relay Module
IN1 → D8 (Lights)
IN2 → D9 (Fan)
VCC → 5V
GND → GND
COM → Live wire of appliance
NO → Appliance input
RFID Module
SDA → D10
SCK → D13
MOSI → D11
MISO → D12
RST → D9
VCC → 3.3/5V
GND → GND
Arduino Code (Smart Classroom System – Basic Example)
#include <DHT.h>
#include <SPI.h>
#include <MFRC522.h>
#define DHTPIN 3
#define DHTTYPE DHT11
#define PIR_PIN 2
#define LIGHT_RELAY 8
#define FAN_RELAY 9
#define BUZZER 7
DHT dht(DHTPIN, DHTTYPE);
// RFID pins
#define SS_PIN 10
#define RST_PIN 9
MFRC522 rfid(SS_PIN, RST_PIN);
void setup() {
pinMode(PIR_PIN, INPUT);
pinMode(LIGHT_RELAY, OUTPUT);
pinMode(FAN_RELAY, OUTPUT);
pinMode(BUZZER, OUTPUT);
digitalWrite(LIGHT_RELAY, LOW);
digitalWrite(FAN_RELAY, LOW);
Serial.begin(9600);
dht.begin();
SPI.begin();
rfid.PCD_Init();
Serial.println("Smart Classroom System Ready");
}
void loop() {
// Occupancy control
int motion = digitalRead(PIR_PIN);
if(motion == HIGH){
digitalWrite(LIGHT_RELAY, HIGH);
digitalWrite(FAN_RELAY, HIGH);
Serial.println("Classroom Occupied: Lights & Fan ON");
} else {
digitalWrite(LIGHT_RELAY, LOW);
digitalWrite(FAN_RELAY, LOW);
Serial.println("Classroom Empty: Lights & Fan OFF");
}
// Temperature and humidity monitoring
float temp = dht.readTemperature();
float hum = dht.readHumidity();
if(isnan(temp) || isnan(hum)){
Serial.println("DHT sensor error");
} else {
Serial.print("Temperature: "); Serial.print(temp);
Serial.print("C Humidity: "); Serial.println(hum);
if(temp > 30) digitalWrite(FAN_RELAY, HIGH); // Auto fan
}
// RFID Attendance
if(rfid.PICC_IsNewCardPresent() && rfid.PICC_ReadCardSerial()){
Serial.print("Attendance Marked for ID: ");
for(byte i=0;i<rfid.uid.size;i++){
Serial.print(rfid.uid.uidByte[i], HEX);
}
Serial.println();
digitalWrite(BUZZER, HIGH);
delay(200);
digitalWrite(BUZZER, LOW);
}
delay(1000);
}
Code Explanation
- PIR sensor detects classroom occupancy and switches lights/fans
- DHT11 sensor monitors temperature and humidity for comfort
- RFID module marks student attendance automatically
- Buzzer alerts for successful attendance or abnormal conditions
- Optional IoT integration sends real-time classroom data to cloud
Advantages
- Automates classroom lighting, fans, and devices
- Monitors environment for better learning comfort
- Automatic attendance reduces manual effort
- Integrates with IoT for remote monitoring and reporting
Applications
- Smart classrooms in schools and colleges
- Conference rooms and training centers
- IoT-based educational monitoring systems
- Energy-efficient and automated learning environments
Future Enhancements
- Integrate voice control for devices
- Add mobile app to monitor attendance and classroom environment
- IoT alerts for temperature, humidity, and device status
- Add projector control and automatic scheduling
Conclusion
The Smart Classroom System is a mini + innovation project that demonstrates automation, IoT integration, and smart education. It enhances classroom management, improves energy efficiency, and makes learning environments modern and interactive.
