Implement an IoT infrared remote controller that can remotely control air conditioners and electric fans, while also recording the temperature and humidity.
-
Air Conditioner:
-
Use an ESP32 to convert various remote infrared signals with a 2N2222 transistor and send them out via an IR LED. The infrared signals use a library that matches the communication protocol of the air conditioner brand. Use a DHT11 module to record the current environmental temperature and humidity. The IoT platform used is Blynk.
-
Physical Components Used:
-
Circuit Diagram:
-
Blynk:
-
-
Electric Fan:
-
First, use an Arduino UNO with a vs1838B module to receive the raw infrared signal, record the raw signal, then use an ESP32 to convert various remote infrared signals with a 2N2222 transistor and send them out via an IR LED. Use a DHT11 module to record the current environmental temperature and humidity. The IoT platform used is Blynk.
-
Library for Arduino to receive IR raw data:
GitHub - cyborg5/IRLib2: Library for receiving, decoding, and sending infrared signals using Arduino
-
Library for ESP32 to send IR raw data:
-
-
Physical Components Used:
-
Circuit Diagram:
-
Blynk:
-
Example of Raw Infrared Signal:
- Electric Fan Power Switch:
#define FAN_SWITCH_RAW_DATA_LEN 68 uint16_t FAN_SWITCH_rawData[FAN_SWITCH_RAW_DATA_LEN] = { 9030, 4466, 594, 558, 574, 558, 578, 558, 574, 558, 578, 1662, 578, 1662, 578, 558, 574, 558, 574, 1666, 578, 1662, 578, 1666, 574, 1666, 574, 558, 578, 554, 578, 1662, 578, 1662, 582, 554, 578, 554, 578, 558, 578, 1662, 578, 554, 578, 554, 578, 558, 578, 1662, 578, 1662, 578, 1662, 578, 1662, 582, 554, 602, 1638, 578, 1662, 578, 1662, 578, 554, 582, 1000 };
-
- In the implementation for the fan, the method of copying and storing the original infrared signal for transmission was not applicable to air conditioners. This might be due to air conditioners having a stricter communication protocol compared to fans. Fortunately, a library containing various brand communication protocols was eventually found.
- Next to 5V is CMD, not GND!!!
Due to Blynk's data stream limitations, the project was divided into two separate boards, and not all controller functions could be covered. However, all essential functions were implemented, as shown in detail in the videos.
- ESP32 Fan IR remote control demo