logo elektroda
logo elektroda
X
logo elektroda

How tightly will Tuya pack two relays? Small flush-mount AVATTO WSM16-W2 module

p.kaczmarek2 2814 2

TL;DR

  • AVATTO WSM16-W2 is a tiny Tuya flush-mount WiFi module with two relays, meant to control two loads from a 39mm x 39mm x 19mm enclosure.
  • The PCB is almost identical to the single-relay WSM16-W1, but it packs two very narrow HF49FD 005-1H11T relays rated 5A 250VAC.
  • The module costs PLN 56, almost double the single version at PLN 30, and each channel is limited to 150W.
  • OBK/Tuya configuration shows P8 pair/toggle, P6 WiFi LED, separate toggle and relay pins for both channels, and a CBU module using BK7231N.
  • PowerSave 1 is recommended to avoid premature failure, and the non-isolated power supply makes extra peripherals like DHT11 a cautious mains-connected modification.
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • AVATTO WSM16-W2 2-channel Wi-Fi switch module in packaging
    Some time ago I reviewed the Tuya single relay module AVATTO WSM16-W1 WiFi relay for PLN 30 , today it`s time for a similar gadget, but with two relays. All this in a small housing measuring 39mm x 39mm x 19mm. The maximum load on one channel is only 150W, but it is still worth giving this product a chance and taking a look inside...

    We bought AVATTO WSM16-W2 for PLN 56, which is quite a lot, considering the fact that its "single" version cost only PLN 30:
    Tuya WSM16-W2 switch front view with a mobile app illustration.
    Specification:
    Smart switch AVATTO WSM16-W2 with description and technical specifications.
    White WiFi relay module with two channels, markings, and terminals.
    In practice, we get a small box:
    Technical specifications on the packaging of the AVATTO WSM16-W2 relay module. Box of the AVATTO WSM16-W2 module with logo and compatibility information with Tuya Label on the box with information about INNPRO importer.
    There is even an importer`s logo on the switch:
    View of AVATTO dual relay Wi-Fi switch module in an open box. View of the AVATTO WSM16-W2 module with branding and certifications on top.
    Instruction:
    User manual of the AVATTO WSM16-W2 WiFi switch module with diagrams and technical specifications. User manual for pairing the AVATTO WSM16-W2 module with an app
    But I haven`t discussed pairing with Tuya for a long time, let`s look inside.

    Interior of AVATTO WSM16-W2
    I recommend comparing the interior of this product with its single version:
    [CBU/BK7231N] AVATTO WSM16-W1 WiFi relay module for PLN 30 - firmware change
    We remove the cover:
    PCB of AVATTO WSM16-W2 model with electronic components. Interior of the AVATTO WSM16-W2 smart module with two relays.
    PCB is practically the same. Even the date is correct - MK-Z2-001_V1.0 20221219
    We take out the plate:
    View of the interior of the AVATTO WSM16-W2 module in an open casing.
    You can see the first difference:
    Close-up of the AVATTO WSM16-W2 relay module with two relays.
    Yes, there are two relays and they are very narrow:
    AVATTO WSM16-W2 module with two relays on a wooden surface.
    The relay model is HF49FD 005-1H11T, 5A 250VAC.
    The rest is the same as in the case of the single version.

    ADVERTISEMENT


    Changing the AVATTO WSM16-W2 load
    The CBU module and its location are the same as in the single version:
    [CBU/BK7231N] AVATTO WSM16-W1 WiFi relay module for PLN 30 - firmware change
    The procedure is also the same, so I will not describe it here again. Photos:
    AVATTO WSM16-W2 module with two relays on a workbench. Close-up of the interior of the AVATTO WSM16-W2 module with electronic components.
    My flasher correctly detects configurations:
    View of the screen of the Tuya device configuration application in JSON format.
    Here is Tuya`s JSON:
    Code: JSON
    Log in, to see the code

    Verbal description:
    
    Device configuration, as extracted from Tuya: 
    - Pair/Toggle All Button on P8
    - WiFi LED on P6
    - TglChannelToggle (channel 1) on P14
    - TglChannelToggle (channel 2) on P16
    - Relay (channel 2) on P17
    - Relay (channel 1) on P20
    Device seems to be using CBU module, which is using BK7231N.
    And the Tuya section starts, as usual, at 2023424
    
    

    OBK template:
    Code: JSON
    Log in, to see the code


    Summary
    This is one of the smallest two-channel switches I have tested so far. I just don`t know why it is so much more expensive than the single version, PLN 30 compared to almost PLN 60 is rather too much.
    In addition, I would like to remind you to turn on PowerSave 1 (by entering this command into autoexec.bat in OBK), because without it we will probably repair this switch after half a year: How to fix a smart device that is chirping, squeaking and making strange sounds?
    Is it worth buying? Your decision, but if you have little space and need to control something, maybe this is not such a bad option. An additional advantage is the presence of a CBU module inside, which has slightly more pins, so you could also connect DHT11, but in this situation you should be very careful because the power supply of this module does not isolate it from the network...

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14612 posts with rating 12630, helped 655 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 21025112
    omniron
    Level 11  
    Posts: 114
    Help: 1
    Rate: 6
    This unit is a perfect candidate in case you would like to see how relays work with straight 3.3V (as mentioned here) .

    Relay:
    That relay company also has 3V relays, a bit wider but should fit easily.
    https://www.hongfa.com/en/Product/Item/HF46F.

    AC/DC
    The common BP2525 can also be easily switched to 3.3V operation by lifting the SEL pin and connecting it to VCC.
    PDF of BP2525

    The linear 5V to 3.3V regulator can then be bypassed and that's it!

    Relay savings (whenever the switch is "on"): 360mW vs 240mW (less if reduced to 3V),
    Lifetime power savings: 1.7V drop x "whatever tuya module consumes"mW vs. just "whatever tuya module consumes" mW.

    What suprises me is that the relays seem parallel.
    If relays are in close proximity (i.e. touching) they should be alternated by 180 degrees.
    Attachments:
    • HF46F.pdf (79.15 KB) You must be logged in to download this attachment.
  • #3 21339306
    zakdma
    Level 3  
    Posts: 27
    Hi!

    I just tried to do the same with my devices which are the same as yours.
    AVATTO WSM16-W2
    There are photos
    Circuit board with CBU module and pin labels RX, TX, GND, and 3.3V. Printed circuit board with various electronic components.

    There is CBU module which as you said is BK7231N
    So I downloaded BK7231 GUI Flash Tool v1.3.3 and tried to read the firmware first but failed.
    When the flasher asked me I off/on the module fastly.
    But it always hung on Reading 0x00...
    I tried BK7231N, BK7231T, BK7231M and different baud rates but the same.
    I tried a separate 3.3v power supply with high current capabilities but the same
    Could you please help me with it? Maybe I have to use CEN pin to be able to read and flash new firmware?

    There is log I received
    BK7231 Easy UART Flasher software interface with reading error.

    Backup name is set to WSM16-W2.
    Starting read!
    Read parms: start 0x00 (sector 0), len 0x200000 (0 sectors)
    Now is: 8 грудня 2024 р. 22:14:25.
    Flasher mode: BK7231N
    Going to open port: COM4.
    Serial port open!
    Getting bus... (now, please do reboot by CEN or by power off/on)
    Getting bus failed, will try again - 0/100!
    Getting bus failed, will try again - 1/100!
    Getting bus failed, will try again - 2/100!
    Getting bus failed, will try again - 3/100!
    Getting bus failed, will try again - 4/100!
    Getting bus failed, will try again - 5/100!
    Getting bus failed, will try again - 6/100!
    Getting bus failed, will try again - 7/100!
    Getting bus failed, will try again - 8/100!
    Getting bus success!
    Going to set baud rate setting (921600)!
    Will try to read device flash MID (for unprotect N):
    Flash MID loaded: 1560EB
    Will now search for Flash def in out database...
    Flash def found! For: 1560EB
    Flash information: mid: 1560EB, icName: TH25Q_16HB, manufacturer: TH, szMem: 1000000, szSR: 2, cwUnp: 0, cwEnp: 7, cwMsk: 407C, sb: 2, lb: 5, cwdRd: 05-35-FF-FF, cwdWr: 01-FF-FF-FF
    Entering SetProtectState(True)...
    sr: 34
    sr: 34
    final sr: 34
    msk: 407c
    cw: 0, sb: 2, lb: 5
    bfd: 0
    sr: 0
    sr: 0
    final sr: 0
    msk: 407c
    cw: 0, sb: 2, lb: 5
    bfd: 0
    SetProtectState(True) success!
    Going to read encryption key...
    Encryption key read done!
    Encryption key: 510fb093 a3cbeadc 5993a17e c7adeb03
    Going to start reading at offset 0x00...
    Reading 0x00... failed with serial.BytesToRead 3999 (expected 4111)
    The beginning of buffer in UART contains 040EFF01E0FCF4061009000000200069 data.
    Failed! There was no result to save.

    Added after 1 [hours] 8 [minutes]:

    I finally managed to make it work. Suddenly is starts reading flash and then I just flash it with latest OpenBaken and that's all.

    Added after 26 [minutes]:

    I have a question. Can't find this device here https://openbekeniot.github.io/webapp/devicesList.html
    Its AVATTO WSM16-W2
    Could you please add it?
📢 Listen (AI):

FAQ

TL;DR: At 39×39×19 mm, the AVATTO WSM16-W2 fits two narrow 5A relays into a very small flush-mount module; as the teardown notes, "there are two relays and they are very narrow." This FAQ is for installers and OpenBeken users who need the pinout, flashing steps, and failure fixes for firmware backup issues. [#21023178]

Why it matters: This thread answers the two practical questions that decide whether the WSM16-W2 is useful: will it physically fit, and can you reliably reflash its CBU/BK7231N platform.

Feature AVATTO WSM16-W2 AVATTO WSM16-W1
Channels 2 1
Housing size 39×39×19 mm Not stated in this thread
Price mentioned PLN 56 PLN 30
Relay load per channel 150 W max Not stated in this thread
Module/platform CBU / BK7231N CBU / BK7231N

Key insight: The WSM16-W2 is attractive when space is the hard limit, not when value is. You pay almost double the W1 price mainly to get two channels inside one very compact box. [#21023178]

Quick Facts

  • The AVATTO WSM16-W2 housing measures 39 mm × 39 mm × 19 mm, making it one of the smallest two-channel modules tested in the thread. [#21023178]
  • The thread lists a maximum load of 150 W per channel and shows Hongfa HF49FD 005-1H11T, 5A 250VAC relays inside. [#21023178]
  • Price in the thread was PLN 56 for the WSM16-W2 versus PLN 30 for the single-channel WSM16-W1. [#21023178]
  • The Tuya module inside is CBU, and the board is identified as BK7231N with PCB marking MK-Z2-001_V1.0 20221219. [#21023178]
  • The successful failed-read log exposed a flash chip identified as TH25Q_16HB, with an attempted backup length of 0x200000 and a read failure at 0x00 after the key was read. [#21339306]

How tightly are the two relays packed inside the AVATTO WSM16-W2, and what relay model does it use?

They are packed very tightly inside a 39×39×19 mm enclosure, and the relays are described as very narrow. The teardown identifies both parts as HF49FD 005-1H11T relays rated 5A at 250VAC. That compact relay choice is what lets Tuya fit two channels into such a small flush-mount body. [#21023178]

What are the main hardware differences between the AVATTO WSM16-W2 and the single-channel AVATTO WSM16-W1?

The main difference is simple: the WSM16-W2 adds a second narrow relay and a second channel while keeping nearly the same PCB concept. The author states the PCB is "practically the same" as the W1, uses the same CBU/BK7231N platform, and even carries the same board family marking MK-Z2-001_V1.0 20221219. The big practical differences in this thread are 2 channels instead of 1 and PLN 56 instead of PLN 30. [#21023178]

How do I flash OpenBeken on the AVATTO WSM16-W2 with the CBU/BK7231N module?

You flash it the same way as the single-channel version because the module and layout are the same. 1. Connect to the CBU/BK7231N programming pads. 2. Reboot the board when the flasher asks, by power-cycling it or using CEN. 3. Read or write firmware, then apply the WSM16-W2 pin template in OpenBeken. The author explicitly says the procedure is the same as the W1, and a later user confirmed they finally read flash and then flashed the latest OpenBeken successfully. [#21339306]

Which GPIO pins are used on the AVATTO WSM16-W2 for the relays, wall switch inputs, WiFi LED, and pair button?

The thread gives a complete pin map. P20 drives relay 1, P17 drives relay 2, P14 is the toggle input for channel 1, P16 is the toggle input for channel 2, P6 drives the WiFi LED, and P8 is the pair or toggle-all button. Those values appear both in the extracted Tuya configuration and in the posted OpenBeken template. [#21023178]

Why does BK7231 GUI Flash Tool get stuck on "Reading 0x00..." when backing up firmware from a WSM16-W2?

It can fail even after the tool detects the bus, flash chip, and encryption key. In the posted case, the tool reached "Reading 0x00..." and then failed with serial.BytesToRead 3999 when 4111 were expected, so the problem occurred during actual data transfer, not during chip detection. That means a successful handshake does not guarantee a stable readout on this device. [#21339306]

What troubleshooting steps help when BK7231 GUI Flash Tool detects the flash chip and encryption key but fails during firmware readout?

The thread shows three useful steps: 1. Try several baud rates and verify the chip family selection. 2. Reboot the module exactly when the tool asks. 3. Repeat the attempt, because the user eventually got a successful read after earlier failures. In that report, the tool already identified TH25Q_16HB and read the encryption key, so persistence and reboot timing mattered more than basic detection. [#21339306]

How should the CEN pin be used when trying to reboot or enter flashing mode on a BK7231N-based AVATTO WSM16-W2?

Use CEN as a reset trigger when the flasher asks for a reboot. The log text explicitly says, "please do reboot by CEN or by power off/on," which means CEN is a practical way to restart the BK7231N at the right moment for bus acquisition. The user asked whether CEN was needed, and the successful session confirms that correct reboot timing is part of the process. [#21339306]

What is the CBU module in Tuya devices, and how is it related to the BK7231N chip?

"CBU" is a Tuya Wi‑Fi module that carries the main control chip and exposes GPIOs for relays, buttons, and LEDs, with more available pins than some smaller Tuya modules. In this device, the thread identifies the module as CBU and states it is using BK7231N. That means CBU is the module board, while BK7231N is the actual SoC on it. [#21023178]

What is OpenBeken (OBK), and what does an OBK template do for a device like the AVATTO WSM16-W2?

"OpenBeken" is replacement firmware for BK7231-based smart devices that lets you control the hardware locally by assigning each physical pin to a defined function. On the WSM16-W2, the posted OBK template maps P6, P8, P14, P16, P17, and P20 to the LED, button, switch inputs, and both relays. That template turns a generic flashed board into a correctly working two-channel relay module. [#21023178]

AVATTO WSM16-W2 vs WSM16-W1: which one is the better buy for a small flush-mount installation?

The WSM16-W2 is the better fit when you need two channels in the least space, but the WSM16-W1 is the better value on price. The author calls the WSM16-W2 one of the smallest two-channel switches tested, yet also questions the price jump from PLN 30 to almost PLN 60. Buy the W2 for density; buy the W1 when one channel is enough and cost matters more. [#21023178]

Why is PowerSave 1 recommended on this AVATTO relay module, and how does it help prevent chirping or squeaking failures?

PowerSave 1 is recommended because the author warns the module may otherwise need repair after about half a year. The advice is to add the command to autoexec.bat in OpenBeken. That setting is linked in the thread to avoiding the chirping, squeaking, or strange-sound failure seen on similar smart devices with this power design. [#21023178]

What safety issues should I consider before connecting extra sensors like a DHT11 to the CBU pins in the AVATTO WSM16-W2?

The main safety issue is that the power supply is not isolated from the mains. The author says you could use spare CBU pins for something like a DHT11, but warns you must be very careful because the module supply has no mains isolation. That makes external wiring and sensor access much riskier than on a low-voltage isolated board. [#21023178]

How could the AVATTO WSM16-W2 be modified to run the relays from 3.3V instead of 5V, including BP2525 and relay replacement ideas?

One commenter suggests changing the supply and relay choices so the relays run from 3.3 V instead of 5 V. The proposed path is to switch the BP2525 to 3.3 V by lifting the SEL pin and tying it to VCC, then bypass the linear 5 V to 3.3 V regulator. They also note the relay vendor offers 3 V relays and estimate savings of 360 mW vs 240 mW while the switch is on. [#21025112]

Why might relay orientation matter when two relays are mounted very close together, and what does alternating them by 180 degrees change?

Relay orientation can matter because two relays mounted side by side may interact mechanically or magnetically if they sit too close in the same direction. The commenter says that when relays are touching or nearly touching, they should be alternated by 180 degrees instead of being parallel. That layout change is presented as a better practice for very tight relay packing. [#21025112]

How do I get the AVATTO WSM16-W2 added to the OpenBeken devices list after successfully flashing it?

Ask for the device to be added after you confirm the flash worked and provide the model name and evidence. In the thread, the user reports a successful OpenBeken flash on the AVATTO WSM16-W2, notes it was missing from the device list, and then directly asks for it to be added. The practical requirement shown here is simple: verify the device first, then submit the model request with photos or configuration details. [#21339306]
Generated by the language model.
ADVERTISEMENT