This repo contains a project for controlling an air conditioning unit wirelessly using an ESP8266 microcontroller. The system allows users to operate the AC unit via a web interface accessible from a smartphone or PC, eliminating the need for a traditional remote control. This project is part of a broader lab automation initiative aimed at enhancing the convenience and efficiency of managing home appliances.
- Wireless Control: Operate your AC unit from anywhere within Wi-Fi range using a web browser.
- User-Friendly Interface: Simple web interface to control power, temperature, fan speed, and mode.
- Customizable Settings: Easily modify the code to adapt to different AC models or functionalities.
- Persistent Settings: The settings are saved in the SPIFFS file system, allowing them to persist across reboots.
-
Hardware:
- ESP8266 microcontroller (e.g., NodeMCU, Wemos D1 R1 Mini)
- IR LED for sending commands to the AC unit
- Power supply for the ESP8266
-
Software:
- Arduino IDE with ESP8266 board support
- Required libraries:
- ESP8266WiFi
- IRremoteESP8266
- IRsend
- FS
- ArduinoJson
-
Clone the Repository:
git clone https://github.com/iot-lab-kiit/controlAC cd controlAC
-
Open in Arduino IDE:
- Open the
.ino
file in Arduino IDE.
- Open the
-
Install Libraries:
- Ensure you have the required libraries installed via the Library Manager in Arduino IDE.
-
Configure Wi-Fi Credentials:
- Update the
ssid
andpassword
variables in the code with your Wi-Fi credentials.
- Update the
-
Upload Code:
- Connect your ESP8266 to your computer and upload the code using Arduino IDE.
- After uploading, open the Serial Monitor (set to 115200 baud) to view connection status.
- Once connected, access the web interface by entering the ESP8266's IP address in your web browser.
- Use the buttons on the interface to control power, temperature, fan speed, and mode of your AC unit.
The code is designed to be easily modified for different AC models or additional features:
- To change IR codes for different AC brands/models, update the corresponding functions (
convertFan
,convertMode
, etc.) with appropriate values. - Adjust temperature limits and fan speed settings as needed.
- Endpoints: Control Endpoints
These endpoints handle different actions for controlling the AC:
/power
Toggles the power state of the AC (ON/OFF).
/tempup
Increases the temperature setting of the AC by 1 degree, as long as it is below the maximum limit (kLgAcMaxTemp).
/tempdown
Decreases the temperature setting of the AC by 1 degree, as long as it is above the minimum limit (kLgAcMinTemp).
/fan
Cycles through available fan speed settings (e.g., low, medium, high, auto).
/mode
Cycles through the available AC modes (e.g., cool, dry, fan, auto, heat).
/swing (optional, appears in JavaScript but not implemented in the provided C++ code)
Controls the swing functionality if implemented.
This project is built upon various open-source resources. Special thanks to:
- IRremoteESP8266 for providing IR communication capabilities.
- ArduinoJson for handling JSON data storage.
- ESP8266WiFi library for Wi-Fi connectivity.
This project is licensed under the MIT License. See the LICENSE file for details.