How I Made a Cheap Air Conditioner Get Smart and Listen to Alice

Everyone knows that in Krasnodar Krai, especially in summer, you can't live without an air conditioner. In winter, they also help save nerves and money. Heating is very important here.

I installed three DEXP AC-CH9ONF air conditioners in my 3-room apartment. This is the simplest and most budget option, I did not expect any special capabilities from it.

At first everything was fine, but considering that the apartment has a simple smart home system based on the Zigbee SLS controller (https://slsys.io/), I would like to control air conditioners remotely.

I immediately rejected control via IR commands, as it is inconvenient.

Why?

  • Lack of feedback: It is impossible to understand whether the air conditioner is currently on.

  • Signal unreliability: The IR signal can get lost along the way and the air conditioner won't turn on even though we thought it did.

  • Limited control: the operating algorithm and temperature control remain the same.

Problems with the algorithm

  • Cooling mode: After the compressor switches off (upon reaching the set temperature), the air conditioner continues to blow (like drying?), as a result of which the humidity in the room increases, an unpleasant smell appears and it becomes very stuffy.

  • Heating mode: in the off-season, when you want to warm up a little, the air conditioner turns on for heating, works for 15 minutes and turns off. The sensor inside thinks that the room is warm, although in fact it is not. The heating efficiency is very low.

Solution

When it became really cold, and I started to freeze with my two children, I decided to start upgrading the air conditioners.

I took apart the control board and found all the tracks leading to the main controls:

  • Compressor ON Relay Control Transistor

  • External unit fan relay control transistor

  • Transistor check valve of the external unit (heating/cooling)

  • Indoor unit fan control

For control I used my favorite ESP32 controllers – WeMos (Lolin) S2 mini.

ready version, esp32 successfully attached to mothership :)

ready version, esp32 successfully attached to mothership 🙂

Having cut the tracks of the onboard controller to the controls, I connected the ESP32. All connections were made directly without additional galvanic isolation (except for one moment, more on that below).

Next I wrote the logic of the work:

  • Getting temperature from external ZigBee sensor in the room

  • Switching the air conditioner on/off at a set temperature (hysteresis about 0.5 degrees)

The first firmware was uploaded within an hour.

I have provided for remote firmware upload via Wi-Fi – OTA, because disassembling the air conditioner every time is not very convenient.

Difficulties

  • Internal fan control: it is controlled via a thyristor, not a transistor (as I assumed), and applying a simple PWM of different frequencies to it did not give the desired result. It turned out that this is an AC motor, and is controlled via a 50 Hz PWM, cutting off half-periods. This is a kind of dimming with the opening of the thyristor at the right moment of the half-period of the network, which limits the voltage and speed of the fan. How this works is described well, for example, here: https://habr.com/ru/articles/410467/

To implement this method, the controller must receive a digitized signal of 100 Hz – double the network frequency, characterizing the timing of each half-period and passing through zero.

I had to disassemble the air conditioner again, find this circuit and output the signal to the controller. Since the controller on the board is 5V, I connected it through a 5kOhm resistor so that the ESP32 would not get nervous from such an amplitude (it works from 3.3v and does not have 5v tolerance protection, but the limiting resistor is quite enough).

  • Getting temperature: in the implementation of a smart home at this facility there is no local MQTT, a cloud service is used, which immediately makes all devices friends with Yandex Alice. But if the Internet goes out, would you like the air conditioner to continue working?

I I read about HTTP API SLS and realized that you can get the state of the sensors directly from the controller. So I did.

Result

I implemented a simple web interface with basic controls and debugging capabilities (click relays, control speed, set temperature and operating mode).

web interface on phone

web interface on phone

  • Now in heating mode it is very warm: control by external sensor.

  • There are no foreign odors in cooling mode (I stop the fan almost immediately after the compressor is turned off – 20 sec).

  • The room is quiet, nothing is spinning or making noise in standby mode.

  • Clear (within 0.5 degree hysteresis) control of the state of each room.

Next, I connected the ESP32 controller to the cloud MQTT and forwarded all the parameters to Yandex's smart home. Now Alice also controls the air conditioner and reports its current state.

This is how you can see the air conditioner in Yandex's smart home, the feedback shows the temperature in the room and the compressor's operation.

This is how you can see the air conditioner in Yandex's smart home, the feedback shows the temperature in the room and the compressor's operation.

Attentive people may notice that there is no mention of air conditioner blinds?
– It's not that hard to control them, there's a stepper motor. But I've never touched them, and even adjusted them manually the way I needed. So, they're just always open and pointed in the right direction.

All the best! I'm interested in comments on the implementation 🙂

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *