I have an old Daikin Inverter AC unit in my house, which is controlled manually with a ARC433 infrared remote. The idea behind this project is to make a device that can:
Note that there are many variants of the ARC433 remote, this project only implements the features that are present in mine and those that could be implemented safely without testing.
The device is based on a Wemos D1 Mini, which is an inexpensive MCU with integrated WiFi, a fairly powerful processor and enough memory to host a web server. It is based on the ESP8266 platform.
Connected to the MCU we have a Bosch BME280 sensor, and a DS3231 RTC, both connected via I2C. We also have a 940nm infrared emitter and a blue status LED connected to 2 digital pins.
Here's a schematic of the circuit:
I recommend using a half-size breadboard to build the device, using hot-melt glue to hold it in place, and keeping the BME280 sensor as far away from the processor as possible for better accuracy.
The software on the device has the following functions:
Note: since the device is intended for home usage and no sensitive data is transmitted, we assume that the network is trusted, the device has no security whatsoever.
To develop this software, the following libraries were used:
Note: the exact versions of the libraries used in my prototype are included in with the project. You can put them in your Arduino/libraries folder if you want.
After building the device, we need to load the software and configure it.
To load the software we need:
Now we can load the espac project in Arduino IDE and start uploading:
The device will now reboot into our program. If the status LED stays on after the device is flashed, check the wiring to the sensors.
At this point the device will boot into access point mode. You will see a WiFi network called ESPAC_AP, connect to it using the password ESP.
Open a web browser and go to http://192.168.4.1 and select Network configuration. Here, you can connect the device to your WiFi network:
After clicking apply, the device will turn off the access point and attempt to connect to your network for 5 minutes. If it fails, it will turn on the access point again. Note that this timeout is only triggered if the device was never able to connect, if your network goes down temporarily, it will attempt to reconnect indefinitely unless the device is rebooted, in which case, this 5 minutes timeout will apply.
Now you can reconnect your PC to your WiFi network and you should be able to reach the device by going to http://ESPAC (replace ESPAC with your hostname if you changed it) and you'll be back in the device settings.
After flashing, the device will be set to manual mode, where it can be used to control the AC unit as you would with its remote.
In this mode, the device can be programmed with a LUA script that is run every 60 seconds. There are many APIs that can be used in this script, allowing access to the virtual remote, the sensors and the RTC. A quick reference guide is provided on the page.
Here's an example script that you can try:
blink(100);
if getApparentTemperature()>=27.5 then
turnOn();
coolMode();
enablePowerful();
elseif getApparentTemperature()>24.5 and getApparentTemperature()<26 then
turnOn();
coolMode();
disablePowerful();
if getApparentTemperature()>25.5 then
disableComfort();
setFanSpeed(1);
elseif getApparentTemperature()<25.25 then
enableComfort();
end
elseif getApparentTemperature()>22 and getApparentTemperature()<24 then
turnOff();
elseif getApparentTemperature()<=20 then
turnOn();
heatMode();
setFanSpeed(1);
end
If you have a 3D printer, you can print a nice case for it like I did, the models are included in the project.
Project (code, schematic, case models): Download from here | Browse GitHub repository
Additional documentation (in Italian because it was a university project): Download from here
The project is licensed under the GNU GPL v3 license