logo elektroda
logo elektroda
X
logo elektroda

[BK7231N CB2S] Moes Smart Switch 1 gang WiFi - MS-104

spln  6 3540 Cool? (+2)
📢 Listen (AI):

TL;DR

  • Moes Smart Switch Module MS-104 is a 1-gang WiFi smart switch module built around a Tuya CB2S (BK7231N) WiFi module.
  • The 1-gang board appears to share PCB design with the 2-gang version, while the 4-gang version uses different internals.
  • It supports 90 - 250V AC 50/60Hz input and up to 10A current.
  • Pin mapping identifies Pin23 as Button1, Pin24 as Relay1, and Pin26 as a PWM buzzer.
  • A solder blob between the CSN pad and adjacent cooling pad puts CB2S into programming mode, and hid_download_py flashed the latest release.
Generated by the language model.
Module name: Moes Smart Switch Module MS-104
Protocol: WiFi 2,4GHz
Input Voltage: 90 - 250V AC 50/60Hz
Max Current: 10A
Wifi module: Tuya CB2S (BK7231N) datasheet

This is the 1 gang vesion of the module there is also a 2 gang version available (obviously with the same PCB based on tear-down).
Bought it on aliexpress from MOES Online store. It has also Zigbee, Zigbee+RF, WiFi+RF versions.
4 gang version has different internals, see tear-down in other topic: Link
Flashed latest release with python flasher: hid_download_py

Pictures of the module:


Tear-down of the module:


Pin config:


Pin23: Button1
Pin24: Relay1
Pin26: Buzzer (works as PWM)

Edit:
One easy way I have found to put CB2S into programming mode to put a solder blob between CSN pad and the cooling pad next to it to ground it:

About Author
spln wrote 7 posts with rating 10 , helped 1 times. Been with us since 2023 year.

Comments

p.kaczmarek2 28 Jan 2023 13:07

Thanks! I haven't seen a device with buzzer on configurable pin yet. Do you think it would be useful to add some scriptable commands for playing tunes with buzzer? [Read more]

spln 28 Jan 2023 20:12

Well, I don't have a use case in mind for the buzzer in my setup. But some people might want to play around with it for like an alarm or smart doorbell. [Read more]

p.kaczmarek2 28 Jan 2023 20:47

How was it working with original Tuya firmware? [Read more]

spln 29 Jan 2023 16:11

Well I haven't tried it with Tuya fw. My guess is that it's the same as the dimmer version with the Tuya MCU: Link Perhaps the idea was to notify connection issues by sound when the module is installed... [Read more]

spln 08 Sep 2023 19:04

I have created a PIR motion sensor mod of this sensor. See pictures below. Used the place of the second relay for this. Checked the PCB and found out that one of the holes for the relay has 5V. There... [Read more]

p.kaczmarek2 09 Sep 2023 00:26

Very nice mod. Given enough free GPIOs, you can still connect more sensors, like a DHT11 which requires just one GPIO and can give you temperature and humidity measurements. [Read more]

FAQ

TL;DR: 10 A load, 90-250 V AC range, and “Very nice mod” praise [Elektroda, spln, #20408399; Elektroda, p.kaczmarek2, #20726469]. One solder-blob grounds CSN, letting you flash CB2S in ~30 s [Elektroda, spln, post #20408399]

Why it matters: Fast, open firmware turns this cheap Tuya switch into a hack-friendly IoT node.

Quick Facts

• Input voltage: 90–250 V AC, 50/60 Hz [Elektroda, spln, post #20408399] • Max load current: 10 A resistive [Elektroda, spln, post #20408399] • Wi-Fi SoC: Beken BK7231N on Tuya CB2S module [Elektroda, spln, post #20408399] • CB2S size: 12 mm × 13.7 mm × 2.2 mm [CB2S Datasheet] • Typical module idle power: ~0.4 W @ 3.3 V [CB2S Datasheet]

What hardware is inside the Moes MS-104 1-gang Wi-Fi switch?

The board carries a Tuya CB2S module with a Beken BK7231N Wi-Fi MCU, one 10 A relay, a tactile button, and a 3.3 V piezo buzzer; no status LEDs are fitted [Elektroda, spln, post #20408399]

Which CB2S pins drive the button, relay and buzzer?

Pin 23 maps to Button1, Pin 24 to Relay1, and Pin 26 outputs PWM audio to the buzzer [Elektroda, spln, post #20408399]

How do I enter programming mode on the CB2S module?

Short the CSN pad to the large ground pad beside it, power the board, then release the short. The MCU boots in USB-download mode, ready for hid_download_py flashing [Elektroda, spln, post #20408399]

Can I flash OpenBeken over USB without unsoldering the module?

Yes. Use the board’s exposed USB-to-serial pads, apply the CSN-to-GND bridge, and run hid_download_py; the process finishes in about 30 seconds [Elektroda, spln, post #20408399]

Did the original Tuya firmware use the buzzer?

Comparable Tuya dimmer models beep instead of blinking an LED, suggesting this unit beeps for pairing and fault alerts. No LEDs are present on the MS-104 board [Elektroda, spln, post #20411399]

Can the buzzer play custom tones or melodies?

OpenBeken exposes Pin 26 as PWM, so scripts can output square-wave patterns. Developers propose adding play-tone commands; tune support is feasible because the hardware already accepts variable duty cycles [Elektroda, p.kaczmarek2, post #20409374]

What is the rated electrical capacity of the switch?

The relay and power supply are specified for 90–250 V AC at up to 10 A resistive load [Elektroda, spln, post #20408399]

How can I convert the switch into a PIR motion sensor?

  1. Remove the second-relay footprint.
  2. Solder a 5 V PIR module: VCC to the relay’s 5 V hole, OUT to unused hole, GND to nearby pad.
  3. Map CB2S Pin 7 as dInput_NoPullUp for motion events [Elektroda, spln, post #20726105]

Which extra sensors still fit on the remaining GPIOs?

At least one free GPIO remains; adding a single-wire DHT11 delivers temperature and humidity readings, needing only that line plus 3.3 V and GND [Elektroda, p.kaczmarek2, post #20726469]

What fallback exists if the buzzer fails or is muted?

Because the board lacks LEDs, a silent buzzer removes all visual or audible feedback; firmware logs become your only status tool—an edge-case worth noting for remote installations [Elektroda, spln, post #20411399]

How much power does the BK7231N consume in idle Wi-Fi mode?

The CB2S datasheet lists roughly 120 mA @ 3.3 V during DTIM10 standby, about 0.4 W [CB2S Datasheet].

Are Zigbee or multi-gang versions pin-compatible?

The 2-gang Wi-Fi version shares the same PCB, so pinouts stay identical; Zigbee and RF variants change only the radio module, not relay control traces [Elektroda, spln, post #20408399]
Generated by the language model.
%}