Classroom air quality and ventilation monitor
Indian cities have some of the worst air in the world, and crowded classrooms build up CO2 that makes students drowsy. A monitor that shows PM2.5 and CO2 and says when to open windows is useful in every college.
- Parts
- ₹6,200
- Build
- 12 weeks
- Board
- ESP32
- Objectives
- 6
Block diagram
- PM2.5 sensorMeasures fine dust
- CO2 sensorMeasures carbon dioxide
- Temperature and humidityAdds comfort context
- ESP32Works out the AQI sub-index
- RGB ring and displayShow good, moderate or poor
- Cloud dashboardStores readings, plots trends and sends alerts+
- Data loggerStores timestamped readings for analysis+
Objectives
- To measure PM2.5, CO2, temperature and humidity.
- To compute the Indian National AQI sub-index for PM2.5 from a rolling 24-hour average.
- To log a week of classroom data and relate CO2 to occupancy.
- To compare the dust sensor with the nearest CPCB station.
- To publish readings over MQTT and show them on a live dashboard with threshold alerts.
- To log timestamped data and analyse it to support the conclusions with evidence.
Parts and specifications
- ESP32 DevKit V1Dual-core 240 MHz, 520 KB SRAM, Wi-Fi + Bluetooth, 3.3 V logic, 12-bit ADC (use ADC1 pins when Wi-Fi is on)₹450Buy
- PMS5003 PM2.5 sensorLaser scattering, PM1.0/2.5/10 µg/m³, 1 s output on UART 9600, 5 V 100 mA fan₹1,600Buy
- SCD40 CO₂ sensorTrue NDIR-style photoacoustic CO₂, 400 to 2000 ppm ±(50 ppm + 5%), I²C 0x62₹2,500Buy
- 5 V 2 A USB adapter and box₹250
- DS3231 RTC moduleTemperature-compensated, ±2 ppm (about 1 minute a year), I²C 0x68, CR2032 backup₹150Buy
Total about ₹6,200 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
Linear between breakpoints: I = (Ihi − Ilo) / (BPhi − BPlo) × (C − BPlo) + Ilo. For 75 µg/m³ in the 61 to 90 band (index 101 to 200): I = 99 / 29 × 14 + 101 ≈ 149, 'Moderate'.
Steady-state CO2 rise = G / Q. 40 students breathe out about 0.005 L/s each = 0.2 L/s. To keep 700 ppm above outdoors needs Q = 0.2 / 0.0007 ≈ 286 L/s of fresh air.
Laser PM sensors over-read above about 70% RH as particles swell; flag readings in high humidity rather than trust them.
Pin map
| Signal | Pin or connection |
|---|---|
| PMS5003 TX → RX2 | GPIO 16 (PMS on 5 V, logic 3.3 V) |
| SCD40, BME280, OLED SDA / SCL | GPIO 21 / 22 (I²C 0x62, 0x76, 0x3C) |
| WS2812 ring DIN | GPIO 13 (330 Ω series) |
| Power | 5 V 2 A USB |
Firmware outline
- Read the PMS5003 32-byte frame, check the checksum, take PM2.5 (atmospheric).
- Read SCD40 every 5 s (CO2, T, RH) and BME280.
- Keep a 24-hour ring buffer of hourly PM2.5 averages for the AQI.
- Map CO2 to the ring colour: green < 800, amber 800 to 1200, red > 1200 ppm with 'Open windows'.
- Show PM2.5, AQI band, CO2 and comfort on the OLED; log every minute.
Test plan
| Test | Expected result |
|---|---|
| Outdoor air vs nearest CPCB station | Same AQI band most hours |
| Classroom with 40 students, door closed | CO2 rises past 1200 ppm |
| Windows opened | CO2 falls within 10 minutes |
| Incense stick 2 m away | PM2.5 rises sharply |
| SCD40 in fresh air | About 420 ppm after self-calibration |
These rows start your results table when you plan the project.
Viva practice
Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 6.
Make it yours
One or two upgrades for a mini project, two to four for a major one.
Build these first
Datasheets and sources to cite
- Plantower PMS5003 manual
- Sensirion SCD4x datasheet
- CPCB National Air Quality Index (2014)
- ASHRAE 62.1 ventilation guidance
About this project
How much does the classroom air quality and ventilation monitor project cost?
About ₹5,590 for the parts in the base list: ESP32 DevKit V1, PMS5003 PM2.5 sensor, SCD40 CO₂ sensor, BME280 sensor, 0.96 inch OLED (SSD1306, I²C), WS2812B ring (16 LEDs), Breadboard 830 points, 5 V 2 A USB adapter and box.
How long does it take?
About 8 weeks for the base project, built on an ESP32. Each upgrade adds time.
Which branches is it suitable for?
Electronics and Communication, Instrumentation, Computer Science / IT (IoT, AI), as a mini or major project.
Which pins and design calculations does it use?
PMS5003 TX → RX2 on GPIO 16 (PMS on 5 V, logic 3.3 V); SCD40, BME280, OLED SDA / SCL on GPIO 21 / 22 (I²C 0x62, 0x76, 0x3C); WS2812 ring DIN on GPIO 13 (330 Ω series). Worked calculations on this page: pm2.5 sub-index (cpcb), co2 and ventilation, humidity correction.
How do I test it?
Outdoor air vs nearest CPCB station: Same AQI band most hours. Classroom with 40 students, door closed: CO2 rises past 1200 ppm. Windows opened: CO2 falls within 10 minutes. Incense stick 2 m away: PM2.5 rises sharply. SCD40 in fresh air: About 420 ppm after self-calibration.
What are the objectives?
To measure PM2.5, CO2, temperature and humidity. To compute the Indian National AQI sub-index for PM2.5 from a rolling 24-hour average. To log a week of classroom data and relate CO2 to occupancy. To compare the dust sensor with the nearest CPCB station.
