Below is a copy-ready project specification draft for the ESP32 HVAC controller based on the PDF.
Project SpecificationESP32 HVAC Controller for Campus Air-Conditioning Energy ManagementProject Name
ESP32 HVAC Controller โ Smart Air-Conditioning Control and Energy Efficiency System
Project Context
This project is based on the proposal โControle, Gestรฃo e Eficiรชncia Energรฉtica dos Sistemas de Ar-Condicionado do Campus Avarรฉโ, which aims to reduce energy waste from air-conditioning systems at IFSP Campus Avarรฉ through IoT-based monitoring, automation, and data-driven management.
The system will monitor room conditions, detect occupancy, control air-conditioning operation, and send data to a central dashboard for real-time supervision and historical reporting.
1. Purpose
The purpose of this project is to design a low-cost, scalable ESP32-based HVAC controller that helps reduce unnecessary air-conditioning usage in classrooms, laboratories, and administrative rooms.
The controller should:
Monitor room temperature and humidity.
Detect room occupancy.
Communicate with a central server using Wi-Fi and MQTT.
Allow remote monitoring through a web dashboard.
Support automatic or semi-automatic control of air-conditioning units.
Generate data for energy-efficiency analysis.
Support future expansion to multiple rooms across the campus.
The project also has an educational purpose, giving students hands-on experience with embedded systems, IoT, energy management, automation, and sustainability.
2. Goals and Success Criteria2.1 Primary Goals
Reduce unnecessary operation of air-conditioning units.
Improve visibility of HVAC usage across campus rooms.
Provide real-time environmental and occupancy data.
Enable automated control decisions based on occupancy and temperature.
Support historical reporting for energy-efficiency evaluation.
2.2 Target Outcome
The initial deployment should be a functional prototype installed in at least three campus environments.
A target energy reduction of approximately 20% is expected for monitored air-conditioning systems, depending on room usage patterns and control policies.
2.3 Success Criteria
The project is considered successful if:
Each controller reliably reads temperature, humidity, and occupancy data.
Data is transmitted to the MQTT broker over Wi-Fi.
The dashboard displays room status in real time.
The system records historical usage data.
The controller can command or influence AC operation safely.
The system demonstrates measurable reduction in unnecessary AC runtime.
Users can override or adjust operation when needed.
The system does not significantly reduce occupant comfort.
3. System Overview
The proposed system consists of distributed ESP32-based controller nodes installed in individual rooms. Each node collects sensor data and communicates with a central MQTT broker. A server-side application subscribes to MQTT topics, stores data in a database, and presents the information through a web dashboard.
The controller can also receive commands from the dashboard or from an automation engine, allowing centralized or semi-autonomous HVAC control.
3.1 High-Level Architecture
Text
[Temperature/Humidity Sensor] [Presence Sensor]
| |
v v
[ESP32 HVAC Controller Node]
|
| Wi-Fi / MQTT
v
[MQTT Broker / Server]
|
-----------------------
| |
v v
[Database] [Web Dashboard]
|
v
[Reports and Energy Analysis]
Optional:
[Dashboard / Automation Logic]
|
| MQTT Command
v
[ESP32 HVAC Controller]
|
v
[AC Control Interface]
9. Backend and Dashboard Requirements9.1 Backend Services
The backend should include:
MQTT broker, such as Mosquitto.
Data ingestion service.
Database.
Dashboard/web application.
Optional automation/rules engine.
9.2 Database Data Types
The database should store:
Devices.
Rooms.
Sensor readings.
AC state history.
Occupancy events.
Commands.
Configuration changes.
Energy estimates or measured energy.
User overrides.
9.3 Dashboard Features
The dashboard should provide:
Real-time room status.
Historical temperature/humidity graphs.
Occupancy history.
AC runtime reports.
Estimated energy consumption.
Device online/offline indicators.
Manual control buttons.
Configuration interface.
Reports by room, shift, period, or building.
10. Energy Measurement and Analysis10.1 Initial Estimation Method
For early prototypes, energy savings may be estimated from AC runtime:
Text
Estimated Energy = AC Rated Power ร Runtime
Example:
Text
1.5 kW AC ร 4 hours = 6 kWh
10.2 Improved Measurement Method
For more accurate results, add real energy monitoring using:
Current transformer sensor.
Smart plug with power metering.
DIN-rail energy meter.
Dedicated power-monitoring IC/module.
10.3 Measurement Methodology
The project should define:
Baseline energy use before deployment.
Pilot period after deployment.
Similar comparison periods.
Weather/season adjustment if possible.
Room occupancy normalization.
Comfort feedback survey.
11. Design Choices and Trade-Offs11.1 ESP32 vs ESP8266
ESP32 is preferred because it offers:
More GPIO.
Better processing capability.
Bluetooth capability if needed later.
More robust development options.
Better long-term scalability.
ESP8266 may be cheaper but is less flexible.
11.2 DHT22 vs Higher-Accuracy Sensors
DHT22 is acceptable for educational prototypes because it is simple and inexpensive.
However, for reliable control, SHT31 or SHT40 is preferred because they generally offer better accuracy, stability, and response.
11.3 PIR vs Advanced Presence Detection
PIR is low cost and simple, but it detects motion rather than true presence.
A person sitting still may not be detected. For real classrooms, PIR should be combined with timeout logic, schedules, or better sensors.
11.4 IR Control vs Relay Control
IR control is safer and less invasive because it does not require modifying mains wiring or internal AC electronics.
Relay control may offer stronger control authority but introduces electrical safety, legal, and reliability concerns.
For a student prototype, IR control is the recommended first implementation.
11.5 Centralized vs Local Automation
Centralized control simplifies dashboard logic and policy management.
Local control improves resilience when the network is down.
Recommended approach:
Local ESP32 handles basic safety and fallback rules.
Server/dashboard handles reporting and higher-level policy.
12. Safety Considerations
The system should avoid direct mains switching during early prototyping.
If the final design interfaces with mains-powered HVAC equipment:
Use certified isolation.
Use properly rated relays/contactors.
Use fuses and surge protection.
Use flame-retardant enclosure materials.
Follow local electrical codes.
Require qualified supervision for installation.
The ESP32, sensors, and user-accessible controls should remain on SELV/low-voltage circuits.
13. Security Considerations
The system should not expose open MQTT control topics on an unsecured network.
Minimum security requirements:
MQTT username/password authentication.
Unique credentials per device.
Dashboard login.
Network segmentation if possible.
Restrict command topics.
Disable anonymous broker access.
Avoid hardcoding shared credentials in public firmware repositories.
Future security improvements:
TLS MQTT.
Certificate-based authentication.
Secure OTA updates.
Signed firmware.
Device provisioning workflow.
14. Performance Considerations
Important performance parameters:
Sensor update interval.
MQTT publish interval.
Wi-Fi reconnection time.
Command response latency.
Dashboard refresh latency.
Database write frequency.
MQTT broker capacity.
ESP32 memory usage.
OTA update reliability.
Suggested starting values:
Text
Sensor sample interval: 10 to 30 seconds
Telemetry publish interval: 30 to 60 seconds
Status publish interval: 60 to 300 seconds
Occupancy timeout: 10 to 20 minutes
Dashboard refresh: 5 to 30 seconds
15. Prototype Implementation PlanPhase 1: Requirements and Survey
Identify target rooms.
Record AC models and rated power.
Identify control method for each AC unit.
Interview users about comfort requirements.
Define pilot success metrics.
Phase 2: Bench Prototype
Build ESP32 prototype with temperature/humidity sensor.
Add PIR sensor.
Connect to Wi-Fi.
Publish MQTT telemetry.
Display data in simple dashboard.
Phase 3: AC Control Prototype
Implement IR transmitter or selected safe control interface.
Decode or reproduce AC remote commands.
Add manual override behavior.
Test AC control in a controlled environment.
Phase 4: Dashboard and Database
Store telemetry.
Display live status.
Add historical graphs.
Add runtime and energy reports.
Add manual command interface.
Phase 5: Pilot Deployment
Install in selected rooms.
Monitor system reliability.
Compare AC runtime and energy usage before/after.
Collect user feedback.
Tune control parameters.
Phase 6: Documentation and Dissemination
Produce user guide.
Produce installation guide.
Document firmware and dashboard.
Present results to the campus community.
Prepare educational materials for students.
16. Open Questions
The following items must be resolved before hardware finalization:
Which AC models will be controlled?
Do the AC units support IR remote control?
Is direct electrical control required, or is IR control acceptable?
Will actual energy be measured or only estimated?
What dashboard technology will be used?
What database will be used?
Will the system run on the campus network or a dedicated IoT network?
What cybersecurity requirements does the institution require?
What enclosure and installation method will be used?
Who will maintain deployed devices?
Are manual wall controls required?
What comfort temperature range should be used?
What accessibility requirements must be considered for students with specific educational needs?
17. Recommended Hardware for First PrototypeRequired
ESP32 development board.
Temperature/humidity sensor.
PIR motion sensor.
IR LED transmitter circuit or selected AC control interface.
5 V USB power supply.
Jumper wires or prototype PCB.
Enclosure.
Recommended Additions
Status LEDs.
Manual override button.
Buzzer or indicator for diagnostics, if appropriate.
Current sensor or smart meter for energy validation.
Better temperature/humidity sensor such as SHT31/SHT40.
Watchdog-enabled firmware.
OTA update support.
18. Future Enhancements
Potential future improvements include:
True energy metering per AC unit.
More accurate occupancy sensing.
COโ-based air-quality monitoring.
Predictive control based on schedules.
Integration with institutional room-booking systems.
Weather-aware HVAC control.
Machine-learning-based optimization.
Mobile dashboard.
OTA firmware update platform.
Centralized device provisioning.
Multi-campus deployment.
Integration with building management systems.
Support for demand-response energy policies.
19. Risks and Mitigations
Table
Risk
Impact
Mitigation
PIR misses stationary occupants
AC may turn off while room is occupied
Use timeout, schedule, manual override, or better presence sensor
Wi-Fi instability
Data/control interruption
Add reconnect logic and local fallback
Unsafe AC control
Electrical hazard
Prefer IR control; isolate all high-voltage interfaces
Inaccurate energy estimates
Weak savings claim
Add real energy measurement
Sensor placement error
Poor control decisions
Define installation guidelines
MQTT security weakness
Unauthorized control
Use authentication and restricted topics
User discomfort
Low adoption
Include manual override and comfort surveys
Device maintenance burden
Long-term failure
Use OTA updates, diagnostics, and modular deployment
20. Conclusion
The ESP32 HVAC Controller is a practical IoT system intended to improve energy efficiency in campus air-conditioning systems. It combines embedded sensing, Wi-Fi communication, MQTT messaging, dashboard visualization, and optional AC control.
The recommended first implementation should focus on a safe, non-invasive prototype using ESP32, temperature/humidity sensing, PIR occupancy detection, MQTT telemetry, and IR-based AC control. After validating the concept in a few rooms, the system can be expanded with better sensors, real energy measurement, secure device management, and scalable dashboard infrastructure.