🛠️ MAKER GUIDEAug 08, 2026•⏱️ 3 min read•🇳🇵 Tested in Nepal
Kathmandu Valley Air Quality & Gas Monitor with ESP32 & OLED Display
Build a desktop air quality and combustible gas monitor for Kathmandu Valley with the MQ-2 sensor, DHT11, ESP32, and a live OLED dashboard.
🛠️ BILL OF MATERIALS (BOM)
Required Hardware & Component Checklist
Curated components verified for this project. Check the items you need, adjust quantities, and add straight to cart:
Estimated Total (5/5 items):
NPR 2,450
✓ Cash on Delivery across Nepal
All parts selected
NPR 1,000
NPR 350
NPR 250
NPR 500
NPR 350
Kathmandu Valley Air Quality & Gas Monitor with ESP32 & OLED Display
Educational Notes
This project is designed to be accessible to students from Class 4 to Masters level, with complexity scalable to match different age groups and skill levels.
Learning Objectives:
- Understand basic electronics and circuitry principles
- Learn sensor applications and data collection techniques
- Develop problem-solving skills through hands-on building and troubleshooting
- Apply programming concepts to control hardware and process data
- Connect projects to real-world Nepalese contexts and challenges
Adaptability:
- For younger students (Class 4-8): Focus on assembling pre-built circuits, observing results, and understanding basic concepts
- For intermediate students (Class 9-12): Modify code, experiment with parameters, and explore underlying principles
- For advanced students (Undergraduate/Masters): Optimize designs, add features, conduct research extensions, and analyze performance
Safety Note: Always supervise younger students when working with electricity, heat, or moving parts.
Construct a compact desktop air pollution and combustible gas monitor using components available directly from Ghumti Pasal.
Hardware Breakdown (Available at Ghumti Pasal):
- Microcontroller: ESP32 Dev Module Development Board with WiFi & Bluetooth
- Gas & Smoke Sensor: Module MQ 2 Smoke methane gas liquefied flammable gas sensor module
- Climate Sensor: DHT 11 Module
- Display: 0.91 inch OLED module blue OLED 128X32 GND-VCC-SCL-SDA
- Status Ring: WS2812 Round Modules RGB LED Ring
Circuit Pinout & Wiring Connections:
| Component / Sensor Pin | ESP32 GPIO Pin | Function / Description |
|---|---|---|
| MQ-2 VCC / GND | 5V (VIN) / GND | Gas Sensor Heater & Circuit Power |
| MQ-2 Analog OUT (A0) | GPIO 34 (ADC1_CH6) | Analog Smoke / Hydrocarbon Voltage |
| DHT11 VCC / GND | 3.3V / GND | Sensor Logic Power |
| DHT11 DATA | GPIO 4 | Digital Temperature & Humidity Stream |
| 0.91" OLED VCC / GND | 3.3V / GND | Display Power |
| 0.91" OLED SCL | GPIO 22 | I2C Clock Line |
| 0.91" OLED SDA | GPIO 21 | I2C Data Line |
| WS2812 Ring 5V / GND | 5V / GND | RGB LED Power |
| WS2812 Ring DIN | GPIO 18 | Digital Addressable Pixel Data |
Firmware Source Code (ESP32 C++)
#include <WiFi.h>
#include <HTTPClient.h>
#include <DHT.h>
#define DHTPIN 4
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
const char* wifiSSID = "GhumtiPasal_WiFi";
const char* wifiPass = "NepalMakers2026";
const char* serverApiUrl = "http://api.ghumtipasal.com.np/v1/telemetry";
void setup() {
Serial.begin(115200);
Serial.println("Initializing Environmental & Microclimate Telemetry Node...");
dht.begin();
WiFi.begin(wifiSSID, wifiPass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nWiFi Connected to GhumtiPasal Network!");
}
void loop() {
float temp = dht.readTemperature();
float humidity = dht.readHumidity();
if (isnan(temp) || isnan(humidity)) {
Serial.println("ERROR: Failed to read data from DHT sensor!");
delay(2000);
return;
}
Serial.printf("Telemetry Update -> Temp: %.1f C | Humidity: %.1f %%
", temp, humidity);
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
http.begin(serverApiUrl);
http.addHeader("Content-Type", "application/json");
String jsonBody = "{\"temp\":" + String(temp) + ",\"humidity\":" + String(humidity) + "}";
int httpResponseCode = http.POST(jsonBody);
Serial.printf("HTTP Server Response: %d
", httpResponseCode);
http.end();
}
delay(5000);
}
← Previous Guide
Autonomous Line Follower Robot with TCRT5000 IR Track Sensors
Next Guide →
Automated Hydroponic Nutrient (TDS) & pH Dosing System for Polyhouses
