The Automatic Room Temperature Controller is an IoT-based system designed to maintain a comfortable room temperature without requiring continuous manual operation.
In traditional systems, users need to manually switch fans or cooling devices ON and OFF. This can be inconvenient, especially when room temperature changes frequently.
To overcome this problem, this project uses an ESP32 microcontroller and a DHT22 temperature sensor to monitor the surrounding temperature.
When the temperature exceeds the predefined limit, the ESP32 automatically activates a cooling fan through a relay module. When the temperature returns to the desired range, the fan switches OFF.
The system also connects to the KiwisIoT Dashboard through Wi-Fi, allowing users to monitor temperature readings and device status remotely.
System Diagram:
KiwisIoT Dashboard is used to monitor room temperature, humidity, and automatic fan operation.
Step 1: Login to KiwisIoTOpen the KiwisIoT platform.
- Open the KiwisIoT platform.
Login using your account.
- Login using your account.
Navigate to the dashboard section.
- Navigate to the dashboard section.
Create a new dashboard with this name:
Automatic Room Temperature Controller
Step 3: Register the ESP32 DeviceOpen the device management section.
- Open the device management section.
Register your ESP32 device.
- Register your ESP32 device.
Obtain the MQTT connection details.
- Obtain the MQTT connection details.
Configure the device credentials.
- Configure the device credentials.
Copy the device topic.
- Copy the device topic.
Add the details to your Arduino program.
- Add the details to your Arduino program.
Add the following widgets to the dashboard:
Widget
Purpose
Temperature Gauge
Displays room temperature
Humidity Gauge
Displays humidity percentage
Status Indicator
Displays fan ON/OFF status
Line Chart
Shows temperature history
Number Display
Displays current temperature
Alert Indicator
Indicates high temperature
Step 5: Configure Data MappingThe example firmware sends this JSON data:
{
"temperature": 32.5,
"humidity": 65.0,
"fan_status": "ON"
}Map these fields to the corresponding dashboard widgets using the data integration supported by your KiwisIoT account.
Step 6: Test Dashboard ConnectivityUpload the ESP32 program.
Check whether:
ESP32 appears online.
- ESP32 appears online.
Temperature readings are updated.
- Temperature readings are updated.
Humidity readings are displayed.
- Humidity readings are displayed.
Fan status changes automatically.
- Fan status changes automatically.
Historical readings are recorded if chart history is enabled.
- Historical readings are recorded if chart history is enabled.
The system can notify users when the room temperature becomes too high.
Configure a supported KiwisIoT notification rule or external notification integration.
Example Alert ConditionsTemperature
Notification
Below 28°C
Normal
28°C–29.9°C
Approaching limit
30°C or above
High-temperature alert
Example Mobile NotificationHIGH TEMPERATURE ALERT
Room temperature is above the configured limit!
Room Temperature: 32.5°C
Humidity: 65%
Fan Status: ON
Action: Automatic cooling activated.
The notification service must be configured separately. Sending MQTT telemetry to the dashboard alone does not guarantee that a mobile push notification will be delivered.
10. Complete Project WorkingNormal ConditionESP32 is powered ON.
- ESP32 is powered ON.
DHT22 measures room temperature.
- DHT22 measures room temperature.
Temperature is displayed on the KiwisIoT Dashboard.
- Temperature is displayed on the KiwisIoT Dashboard.
Cooling fan remains OFF when the temperature is below the activation threshold.
- Cooling fan remains OFF when the temperature is below the activation threshold.
Room temperature reaches 30°C.
- Room temperature reaches 30°C.
ESP32 detects the temperature increase.
- ESP32 detects the temperature increase.
Relay switches ON.
- Relay switches ON.
Cooling fan starts automatically.
- Cooling fan starts automatically.
Dashboard updates the fan status.
- Dashboard updates the fan status.
Configured notification service sends a high-temperature alert.
- Configured notification service sends a high-temperature alert.
Room temperature drops below 28°C.
- Room temperature drops below 28°C.
ESP32 switches the relay OFF.
- ESP32 switches the relay OFF.
Cooling fan stops.
- Cooling fan stops.
Dashboard updates the latest status.
- Dashboard updates the latest status.
System returns to automatic monitoring mode.
- System returns to automatic monitoring mode.
Test Case
Expected Result
Temperature at 25°C
Fan OFF
Temperature at 29°C
Fan OFF if previously OFF
Temperature at 30°C
Fan ON
Temperature at 29°C after activation
Fan remains ON
Temperature at 27°C
Fan OFF
Wi-Fi disconnected
Local automatic control continues
Sensor disconnected
Fan switches OFF in example firmware





_JnuTDtq8iW.jpeg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)



Comments