Skip to content

LC Technology 5V 2 Channel Relay Board - ESPHome

I purchased several of these relay boards from AliExpress due to their low price point and had intended to use them with Home Assistant by either flashing Tasmota or ESPHome.
They contain a removable ESP-01 which is easy enough to reprogram, however, the relays are controlled by an onboard N76E003/STM8S003 via serial instead of a traditional relay board which pulls a pin high.
I tried to use the documentation from the Tasmota templates directory with no luck. The relays were not responsive.

My Solution

I decided to use ESPHome and its built-in UART Bus Component with the documentation to create a custom configuration file.

Uploading the Configuration

The following relies on the assumption that you have a configured instance of Home Assistant and the ESPHome Integration installed.

  1. Launch Home Assistant in Chrome (this is not required but makes it easier to program the ESP-01).
  2. Open ESPHome in Home Assistant and click "New Device".
    New Device
  3. Plug your programmer and ESP-01 into your computer.
  4. Click "Connect" and select the board from the menu that appears. It will likely appear as 'USB2.0 to Serial' or something similar.
    Select Board
    Board Selected
  5. Allow the board to be programmed, once completed you will see a message. If you encounter an error message, try disconnecting the programmer and connecting it to power again.
    Programming Message
    Error Message
  6. Once the board appears online, click edit and add the highlighted portions of code from my configuration.
    Edit Configuration
    Configuration Code
  7. Save and Click "Install" (I recommend Wirelessly), wait for the install to finish.
    Install Configuration
  8. Once the programming is done, remove the ESP-01 from the programmer and place it in the relay board.
    ESP-01 Installed
  9. Power up the relay board.
  10. Navigate to Integrations in Home Assistant, if it doesn't show up in auto-discovery, add it manually with the IP Address.
    Home Assistant Integration
  11. Test it out and verify that the functions work correctly.
    Testing Functionality

Extras: 3D Printed Case

On Thingiverse, I found an ESP-01 Dual Relay Housing Box by travio. This case works quite well. Depending on your 3D printer, you may need to scale down the dimensions of the lid to ensure a snug fit.

Comments