I would like to invite you to a demonstration of the interior and software changes of the Tuya universal IR remote control. The device shown here is capable of receiving and transmitting infrared signals in various remote control standards such as RC5, RC6, NEC, etc. The whole thing is controlled from Wi-Fi, so various complex mechanisms and automations can be created, and even potentially paired with Home Assistant.
I will skip the tests with the Tuya app in this topic, as this has been presented before.
The adventure begins with the purchase of the hardware - in our country for around £30, probably cheaper in China. The kit also includes a USB cable, but this won't be of much use to us as it doesn't have a data line.
Instructions (pairing with Tuya, etc):
Let's take a look inside:
The construction of this device is very simple. The whole thing is powered by 5V from USB, so no converters are needed. An LDO AMS1117-3.3V regulator is sufficient, which powers the BK7231N located directly on the PCB. There are also separate IR LEDs on the PCB from the transmitter, pointing in different directions, and a single IR receiver.
Due to the low performance of the microcontroller GPIO, transistors were used here to control the transmitters:
The Wi-Fi antenna is also in track form on the PCB:
On the bottom of the PCB there are pads for programming. The signals from UART and SPI can be distinguished here.
We program the device with our flasher, following the instructions from the repository:
https://github.com/openshwprojects/BK7231GUIFlashTool
We need a USB to UART converter. We solder the power supply, RX1 and TX1.
This also needs to be well powered. In the picture I have used an external LDO for this, although here you could just as well solder 5V to the input of the LDO found on the board. It's important that the BK7231 gets 3.3V at VDD, not a higher voltage. It can easily be damaged.
Flasher correctly detects GPIO configuration:
JSON Tuya:
Code: JSON
You can read from here:
- wfst_pin - pin with status LED on it
- reset_pin - pin with pairing button
- infrr - pin with IR receiver
- infre - pin with IR transmitter
Description from the converter:
- WiFi LED on P24
- IR Receiver on P8
- IR Sender on P7
- Pair/Reset All Pin on P9
OBK template:
Code: JSON
IR events can be handled according to our previous material:
It was also translated here:
Tutorial/presentation on operating the NiceMCU BK7238/T1 IR remote control - Home Assistant [EN]
Tutorial/presentation on operating the NiceMCU BK7238/T1 IR remote control - Home Assistant [EN]
The IRSend command is used to send data:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
Note that there are two versions of the OBK available - the main one is the Arduino-IRRemote integration and the other is the IRRemoteESP8266. The IRRemoteESP8266 version supports additional protocols and can be downloaded here:
OpenBeken is thoughtfully designed to support a wide range of use cases and anyone can select a version that suits them. If desired, you can also compile a custom configuration online - without having to install the compiler on your computer ( tutorial ).
https://github.com/openshwprojects/OpenBK7231T_App/releases/
For more information, I refer you to the documentation.
Command documentation:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
Documentation of control via MQTT:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/mqttTopics.md
In summary , a device reprogrammed in this way can be connected to the Home Assistant and controlled from MQTT. You can receive signals (in MQTT format compatible with Tasmota) from various remote controls and use them to trigger automation, e.g. to control lighting, roller-blinds or other devices. You can also send your own signals from the HA level via this gadget - e.g. to control the TV (to switch it off or on at a given time) or maybe even the air-conditioning (provided its protocol is supported - in this case, I recommend versions with IRRemoteESP). Sending is also possible from the HA - the IRSend command according to the OBK documentation is sending on a Tasmota-style cmnd.
What applications do you see for this type of IR 'gateway'?
Cool? Ranking DIY Helpful post? Buy me a coffee.