This is an old revision of the document!
Author: Cristina Iordache
Master Program: ACES
Source code on GitLab: https://gitlab.com/iordache.cristinaa98/iot-project
The goal for this project is to create a smart remote controller for non-smart air conditioners. The system will be interfaced with Google Home and it will receive commands from Google and change the state of air conditioner depending on what is received. Also the mode of the air conditioner can also be changed depending on the data received by a temperature and humidity sensor.
I chose this project because I have a non-smart air conditioner and I want to control its state remotely.
The project has the following functionalities:
For the hardware were used the following components:
For software development, I used Arduino IDE.
Sinric Pro is a web platform that enables developers to integrate IoT development boards with devices like Google Home. The API can be used to retrieve device logs, find devices, and update devices. For this project, SinricPro was used in order to receive commands from Google devices and send them to the ESP32 Microcontroller.
First, an account on this platform must be made. After the account is created, log in and create an device on the platform, from Devices tab in the left page.
Here you must complete the Device Name, Description and to choose the device that is going to be controlled. There are many options, including an AC.
After completing all the tabs, the device will be created and visible in the platform and a key will be generated. A key that will be used from the program to update the data in the cloud. Also after the account was create an APP_KEY and APP_SECRET are created in order to connect to the platform from the program.
Sinrinc pro credentials
#define APP_KEY “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx”
#define APP_SECRET “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx”
#define DEVICE_ID “63bafbf161ff9a367127b578”
''
==== Google Home app ====
In order to connect a Google device with SinricPro platform, download the Google Home application. After that, select the ”+” button from the left corner and choose Set up a device.
Next choose Works with Google and there search for the platform SinricPro, in this case.
After this the connection is established.
==== ISSUES ====
* Working with tasks: In initial implementation, I tried to make use of both cores available on the ESP32 Microcontroller. The flow was designed to have one core that is always listening for commands sent by Google via SInricPro and the other core was designed to receive the IR signal from the remote controller and to send the commands to the AC. Searching for a solution, implementing tasks seemed to be a good approach. For this, two task were created, each one running on different a core. Each task had a specific function, in my case ListenToGoogle and RemoteController. The core that was running ListenToGoogle was working correctly, but the other task had an issue. Every time a command was sent to AC, the command was not received correctly and I could not identify why. But in my opinion the problem could be because the timers that were shared by the two cores. The solution was to move all the functionality to a single core.
* Google Home does not recognize some commands: When I was trying to tell Google to change operation mode to HEAT it was not working. Apparently only a thermostat supports the heating mode.
===== Demo =====
===== Resources =====
The resources and the tutorials that were followed for this project are:
* https://randomnerdtutorials.com/esp32-dht11-dht22-temperature-humidity-web-server-arduino-ide/
* https://esp32tutorials.com/esp32-esp-idf-freertos-tutorial-create-tasks/
* https://mschoeffler.com/2021/05/01/arduino-tutorial-ir-transmitter-and-ir-receiver-hx-m121-hx-53-ky-005-ky-022-keyes-iduino-open-smart/
* https://hutscape.com/tutorials/ir-raw-receive
* https://circuitdigest.com/microcontroller-projects/arduino-automatic-ac-temperature-control
* https://www.electronicwings.com/arduino/ir-communication-using-arduino-uno
* https://www.instructables.com/Arduino-Smart-Home-With-Alexa-Google-Assistant-Usi/
* https://sinric.pro/