This is an old revision of the document!
Autor: Burciu Iustin Florian Email: iustin.burciu@stud.fiir.upb.ro Grupa: AAC
This project focuses on building an embedded system to monitor environmental comfort using the ESP32 development board, along with an LM35 temperature sensor and an MQ-4 gas sensor. It continuously evaluates environmental conditions and computes a comfort score based on temperature and gas readings.
The implementation was initially created as a local web server hosted directly on the ESP32, allowing real-time monitoring from any browser within the same Wi-Fi network. Later, a second version was developed using Firebase Realtime Database, enabling remote data access and logging in real time from anywhere in the world.
The project includes:
Used Components:
ESP32 Connections:
Component | ESP32 Pin | Description |
---|---|---|
LM35 VCC | 3.3V | Power supply |
LM35 GND | GND | Ground |
LM35 OUT | GPIO34 | Temperature signal |
MQ-4 VCC | VIN | Power supply (regulated) |
MQ-4 GND | GND | Ground |
MQ-4 A0 | GPIO32 | Gas level (analog) |
LED Blue | GPIO25 | Lights up at comfort score 100 |
LED Red | GPIO26 | Lights up if gas > 30 |
The designed system aims to monitor indoor environmental comfort by evaluating two essential parameters: temperature and gas concentration. These values are processed to calculate a comfort score ranging from 0 to 100, which reflects the overall air quality and thermal comfort.
The core functionalities of the system include:
This system provides continuous assessment of the indoor environment, with a user-friendly interface that enables real-time monitoring and alerts, both locally and remotely via cloud services.
The implementation of this project was carried out in two main phases, using two distinct Arduino sketches for flexibility and modularity.
In the first implementation, a local web server is hosted directly on the ESP32 microcontroller. This server delivers an interactive dashboard accessible via any device connected to the same Wi-Fi network. Key elements include:
This implementation is self-contained and requires no internet connection beyond local Wi-Fi access.
To enable remote monitoring and cloud-based data storage, a second Arduino sketch was developed using the Firebase ESP Client library. In this version:
Each sketch controls the same hardware setup (sensors and LEDs) but uses different methods to present and store the data. This modular design ensures flexibility and adaptability for different deployment scenarios (local vs. cloud).
1. Read Temperature and Gas:
```c float citesteTemperatura() {
int adc = analogRead(pinLM35); float voltaj = adc * (5.0 / 4095.0); return voltaj * 100.0;
}
int citesteGaz() {
return analogRead(pinMQ4);
}