logo elektroda
logo elektroda
X
logo elektroda

Small relay module for cloudless operation for £5? 100% local SB451/DS-1311WN 2023-10-05

p.kaczmarek2 3066 0

TL;DR

  • SB451/DS-1311WN is a £5 smart relay module dated 2023-10-05, opened and reflashed for local-only operation without the manufacturer’s servers.
  • Inside, the new CB2S module with BK7231N replaces WB2S, while the BP2525 supply, FH17-1A2TLE relay, and even a varistor keep the design close to the older ZN268131.
  • Flashing requires soldering power, RX, and TX after desoldering the CB2S, then reading Tuya configuration with BK7231GUIFlashTool; the pin map shows Relay on P8 and WiFi LED on P7.
  • OBK firmware makes the relay usable with Home Assistant, and PowerSave 1 is recommended in autoexec.bat to avoid damaging the inverter capacitor.
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • Interior of the new smart switch relay from 2023. .
    Today we are taking a look inside a fairly new "smart switch" relay, dated 2023-10-05 on the PCB. As standard here, I will show its construction and change its firmware to make it free from the manufacturer's servers. The product itself from this topic resembles the already discussed ZN268131 , but is an updated version of it, among other things the old WB2S has been replaced by CB2S. The whole thing is available to buy in many shops and often under other names, so look at the pictures.

    First - the packaging:
    Smart Switch Module packaging on a wooden surface, featuring Amazon Alexa and Google Assistant logos. Side of smart switch relay packaging with specification markings. .
    The set is quite poor:
    Packaging and smart switch SB451 with labels.
    Instructions:
    Smart switch user manual displayed on a wooden surface. Folded-out user manual for a smart switch.

    ADVERTISEMENT


    Now the interior:
    Close-up of the interior of a smart switch with a PCB and visible electronic components. PCB of a smart switch relay with visible components. Close-up of the printed circuit board inside a smart switch relay. .
    I don't see much change, in the linked older version of this product sat the AP8506, here is the BP2525 (classic), the rest similar.
    Image of the interior of a smart switch relay with a CB2S module on the circuit board. Close-up of the inside of a smart switch relay with a CB2S component on a PCB. Interior of an electronic relay with visible capacitors. .
    Here we have the FH17-1A2TLE relay at 5V (it is powered directly from the BP2525), the CB2S itself is powered from a 3.3V LDO.
    Of surprises, we also have a varistor present here - this is an exception, it is often overlooked.

    SB451/DS-1311WN firmware change [/size] .
    According to the flasher instructions - you need to solder the power supply, RX and TX:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    One would like to solder to the CB2S pad without removing it:
    Smart switch relay with CB2S module on a PCB View of the interior of a smart switch relay with CB2S module. .
    But that won't work. You need to desolder the CB2S, flux and braid will help:
    Close-up of a PCB with electronic components and colored wires. .
    Here's my whole circuit, together also with the 3.3V LDO (I'm using TC1264-3.3V, but you can use any or even take 3.3V from NodeMCU or Arduino):
    CB2S module PCB with soldered wires Printed circuit board with relay connected to a breadboard on a table. .
    When reading the batch, my flasher correctly discovers the Tuya configuration:
    Screenshot of firmware flashing software displaying JSON configuration. .
    JSON Tuya:
    Code: JSON
    Log in, to see the code

    Verbal description:
    
    Device seems to be using CB2S module, which is BK7231N chip.
    - Relay (channel 1) on P8
    - WiFi LED on P7
    - TglChannelToggle (channel 1) on P26
    - Pair/Toggle All Pin on P11
    

    OBK template:
    Code: JSON
    Log in, to see the code
    .
    A device configured in this way can also be paired with Home Assistant, details on our YT: https://www.youtube.com/playlist?list=PLzbXEc2ebpH0I8m_Cfbqv1MTlQuBKYvlx

    Summary
    The version in this topic is from 2023-10-05, the previously discussed version, ZN268131 , is from 2020-09-16. Rather not much has changed. The varistor is still present, the rest of the build is still almost identical, they've only swapped WB2S for CB2S, which is something I often encounter - BK7231N replaces BK7231T. In addition to this, since discussing the previous version I have added decoding of Tuya's JSON configuration so we no longer have to guess the GPIO configuration of this product manually. I can recommend its purchase.
    PS: In OBK it's still worth enabling PowerSave on this chip (type PowerSave 1 in autoexec.bat), otherwise you'll probably damage the capacitor from the poor quality inverter from the middle quickly - see theme on repair .

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14413 posts with rating 12361, helped 650 times. Been with us since 2014 year.
  • ADVERTISEMENT
📢 Listen (AI):

FAQ

TL;DR: For users who want a £5 Tuya relay to run fully local, this SB451/DS-1311WN board dated 2023-10-05 can be flashed after removing the CB2S module; as the author notes, "You need to desolder the CB2S" first. It uses a BK7231N-based CB2S, a 5V relay, and a 3.3V LDO, so OpenBeken can replace the cloud firmware cleanly. [#21107014]

Why it matters: This FAQ shows exactly how to identify, flash, and configure a cheap single-relay module for reliable local control and Home Assistant use.

Hardware point SB451 / DS-1311WN (2023-10-05) Older ZN268131 (2020-09-16)
Wi-Fi module CB2S WB2S
Main chip family noted BK7231N BK7231T-era module
AC/DC supply chip BP2525 AP8506
Varistor present Yes Yes
Overall design change Small update Earlier revision

Key insight: The practical breakthrough is not the hardware revision itself. The important change is that Tuya JSON can now be decoded automatically, so the GPIO mapping no longer has to be guessed by hand.

Quick Facts

  • The relay on this board is an FH17-1A2TLE rated at 5V, while the CB2S logic side is powered from a 3.3V LDO. That split matters during flashing, because the module must not be powered from mains. [#21107014]
  • The decoded Tuya configuration maps the hardware clearly: relay on P8, WiFi LED on P7, channel toggle on P26, and pair/toggle-all button on P11. That gives you a ready-to-use OpenBeken template. [#21107014]
  • The PCB date in this revision is 2023-10-05. The older related board discussed for comparison is dated 2020-09-16, so the documented hardware gap is a little over 3 years. [#21107014]
  • OpenBeken setup on this BK7231N device benefits from enabling PowerSave 1 in autoexec.bat. The thread warns this helps protect capacitors when the relay runs from a poor-quality inverter. [#21107014]

How do I flash OpenBeken on the SB451/DS-1311WN relay module with a CB2S board and BK7231N chip?

You flash it by removing the CB2S module, wiring it for serial flashing, and then loading OpenBeken with BK7231GUIFlashTool. Use 3.3V, RX, and TX on the CB2S, not mains power. After flashing, apply the detected pin mapping: P8 relay, P7 WiFi LED, P11 button, and P26 toggle input. That gives the SB451 local control without the Tuya cloud. [#21107014]

Why doesn't soldering directly to the CB2S pads work for flashing this SB451 relay, and why does the module need to be desoldered first?

Direct soldering to the CB2S pads does not work reliably on this board, so the module must be removed first. The author tried soldering to the pads without removing CB2S and states that it would not work. After desoldering, access becomes clean enough for 3.3V, RX, and TX connections. Flux and braid were used to remove the module safely before flashing. [#21107014]

What is the CB2S module, and how is it related to the BK7231N chip used in Tuya smart relays?

CB2S is the plug-in Wi-Fi module used on this relay, and it contains the BK7231N platform targeted by OpenBeken. “CB2S” is a Wi‑Fi module that carries the BK7231N chip, exposes firmware and GPIO functions, and replaces older Tuya modules such as WB2S in this single-relay design. In this SB451 revision, CB2S replaces the older WB2S noted in the earlier version. [#21107014]

What is OpenBeken (OBK), and how does it make the SB451/DS-1311WN work without the manufacturer's cloud?

OpenBeken is replacement firmware that lets this relay work fully locally after the Tuya firmware is removed. “OpenBeken” is device firmware that runs on Tuya-style Wi‑Fi modules, controls GPIO pins directly, and removes the need for the original vendor cloud service. On this SB451, it uses the decoded mapping for P7, P8, P11, and P26, and it can then pair with Home Assistant. [#21107014]

Which GPIO pins are used for the relay, WiFi LED, button, and toggle input in the SB451 single switch module ver 20231005?

The relay uses P8, the WiFi LED uses P7, the pair or toggle-all button uses P11, and the channel toggle input uses P26. The thread lists these values twice: in the verbal pin description and again in the OBK template for the SB451 single switch module ver 20231005. That makes the pinout directly reusable after flashing. [#21107014]

What steps are needed to read and decode the Tuya JSON configuration with BK7231GUIFlashTool on this relay module?

You need three steps. 1. Desolder the CB2S and wire 3.3V, RX, and TX to a safe flashing setup. 2. Read the batch in BK7231GUIFlashTool so the tool detects the Tuya configuration. 3. Use the decoded JSON to extract the GPIO roles, including P8, P7, P11, and P26, then build the OBK template. This removes manual GPIO guessing. [#21107014]

How does the 2023-10-05 SB451/DS-1311WN version compare with the older ZN268131 2020-09-16 version?

It is mostly the same hardware with a newer Wi-Fi module and a different power-supply chip. The newer board is dated 2023-10-05, while the older ZN268131 is dated 2020-09-16. The thread says the varistor is still present and the design is almost identical, but WB2S was replaced by CB2S, and AP8506 was replaced by BP2525. [#21107014]

What are the practical differences between CB2S and WB2S when replacing stock Tuya firmware with local firmware?

The practical difference here is mainly the module generation, not a radically different flashing outcome. The thread describes CB2S as replacing WB2S in this updated board and notes that this mirrors a common shift from BK7231T to BK7231N. With the newer JSON decoding support, you no longer need to infer the GPIOs manually, so the migration to local firmware is simpler on the newer board. [#21107014]

Why is the presence of a varistor in this small relay module important, and what protection does it provide?

The varistor matters because it adds surge protection that many cheap relay boards omit. The author calls its presence an exception and notes that manufacturers often skip it. In a mains-powered relay module, that extra component helps absorb voltage spikes, which is especially valuable in compact, low-cost designs sold around £5. [#21107014]

How can I power the CB2S safely during flashing if I don't have a TC1264-3.3V regulator, and what alternatives work?

You can power the CB2S safely from any stable 3.3V source, not only a TC1264-3.3V regulator. The author used a TC1264-3.3V, but also states that any suitable 3.3V LDO will work. You can even take 3.3V from a NodeMCU or Arduino during flashing, as long as the module is flashed off-board and not from mains. [#21107014]

What does the BP2525 power supply chip do in this relay module, and how is it different from the AP8506 used in the older version?

BP2525 is the mains power-supply chip used in this relay revision, and it directly powers the 5V relay. The thread says the older linked version used AP8506, while this board uses BP2525 instead. The rest of the construction stays similar, so the change is a revision update rather than a full redesign. [#21107014]

How do I use the OBK template for the SB451 model so it works correctly with Home Assistant after flashing?

Use the provided OBK template, then assign its four pins exactly as listed before pairing with Home Assistant. The template names the board as CB2S, the chip as BK7231N, and maps 7 = WifiLED_n;0, 8 = Rel;1, 11 = Btn_Tgl_All;0, and 26 = TglChanOnTgl;1. The thread states that a device configured this way can then be paired with Home Assistant. [#21107014]

Why is enabling PowerSave 1 in OpenBeken recommended on BK7231N devices, especially when the relay is powered from a poor-quality inverter?

It is recommended because it reduces stress that can quickly damage a capacitor when the relay runs from a poor-quality inverter. The thread specifically advises typing PowerSave 1 in autoexec.bat on this chip. That warning is not generic; it is tied to a documented repair issue referenced by the author for these BK7231N-based devices. [#21107014]

What troubleshooting steps help when BK7231GUIFlashTool detects the device but flashing or boot communication still fails on a CB2S module?

First remove the CB2S instead of trying to flash through the soldered board pads. Second confirm a clean 3.3V supply and solid RX/TX wiring. Third reuse the tool's detected Tuya configuration to verify that you are working with the expected CB2S / BK7231N hardware. This thread's main failure case is clear: pad access on the installed module was not sufficient, but desoldering solved it. [#21107014]

Where can I find this SB451/DS-1311WN relay sold under other names, and what visual details help identify the correct hardware revision?

You should look for it in multiple online shops and compare the photos, because the same hardware is sold under other names. The thread says the product is widely available and often rebranded, so image matching matters more than the listing title. The best identifiers are the 2023-10-05 PCB date, the CB2S module, the BP2525 supply chip, and the overall single-relay layout shown in the photos. [#21107014]
Generated by the language model.
ADVERTISEMENT