logo elektroda
logo elektroda
X
logo elektroda

How to Fix Random Relay Switching on BL602 IoT Devices with SM-028_V1.3?

pavlenkoblok 5658 19

TL;DR

  • A BL602L20-based SM-028_V1.3 relay switch randomly turns the relay on and off.
  • Fixing it requires soldering C6 0.1 uF and R1 10 kOhm onto the module.
  • The module was unsoldered, wired to a UART adapter with TX/RX/GND/3V3/BT, then flashed from a PC.
  • The flash command used blflash-windows-amd64.exe with OpenBL602_1.17.402.bin on COM7.
Generated by the language model.
ADVERTISEMENT
📢 Listen (AI):
  • View of SM-028_V1.3 module PCB with BL602L20 chip. SM-028_V1.3 relay module with visible circuit board and components. SM-028_V1.3 module with BL602L20 chip on a circuit board. SM-028_V1.3 module with BL602L20 chip on a green PCB, featuring electronic components and a screw terminal. Image of SM-028_V1.3 module with BL602L20 chip showing RM-BRK001-MAC2HG marking.
    Relay based on SM-028_V1.3 module with BL602L20 chip.
    These relays have a massive problem with the fact that they randomly turn the relay on and off. In order to fix this, you need to solder components C6 0.1 uF and R1 10 kOhm.
    Close-up of a PCB showing component locations for C6 and R1.
    For firmware, I unsoldered the SM-028_V1.3 module, connected the
    SM-028|UART
    TX--------RX
    RX--------TX
    GND-----GND
    3V3------3V
    BT--------3V module with the uart adapter, and then connected the uart adapter to the PC.
    I flashed it using the blflash program with the command '.\blflash-windows-amd64.exe' flash OpenBL602_1.17.402.bin --port COM7.
    Configuration:
    {
      "vendor": "eWelink",
      "bDetailed": "0",
      "name": "MINI Smart WI-FI switch",
      "model": "WI-FI switch",
      "chip": "BL602",
      "board": "SM-028_V1.3",
      "flags": "1024",
      "keywords": [
        "SM-028_V1.3",
        "BL602L20"
      ],
      "pins": {
        "3": "TglChanOnTgl;1",
        "14": "LED_n;1",
        "20": "Btn;1",
        "21": "Rel;1"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/9338489200_1705009676.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/viewtopic.php?p=20904492"
    }

    Cool? Ranking DIY
    About Author
    pavlenkoblok
    Level 2  
    Offline 
    pavlenkoblok wrote 2 posts with rating 5, helped 1 times. Been with us since 2023 year.
  • ADVERTISEMENT
  • #2 20904602
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14570
    Help: 654
    Rate: 12584
    Good tutorial. It's a shame that manufacturer tries so hardly to optimize the costs that they don't actually even want to solder those two cheap components.
    Helpful post? Buy me a coffee.
  • #3 20904710
    gulson
    System Administrator
    Posts: 29343
    Help: 148
    Rate: 6023
    After all, these components cost from $0.10 with assembly, I do not understand this savings.
  • ADVERTISEMENT
  • #4 20904798
    krzbor
    Level 29  
    Posts: 1755
    Help: 41
    Rate: 1063
    pavlenkoblok wrote:
    To fix this, the components C6 0.1 mF and R1 10 Kom should be soldered out.
    Maybe this should be corrected, as the sentence implies that these components should be removed, not added.
  • #5 20904846
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14570
    Help: 654
    Rate: 12584
    By the way, I didn't even know that you can flash BL602 from the command line:
    
    .\blflash-windows-amd64.exe flash OpenBL602_1.17.402.bin --port COM7
    

    I've always used BLDevCube.exe, and here's such a surprise. I wonder if blflash-windows-amd64.exe can also read the original batch?
    Helpful post? Buy me a coffee.
  • #6 20904939
    speedy9
    Helpful for users
    Posts: 12023
    Help: 1233
    Rate: 2420
    So I'm wondering if soldering these components corresponds to flashing in any way? Does soldering alone solve the relay switching problem in the original "ecosystem"?
    I have several switches under Tuya at home, and indeed some happen to change state on their own (especially to "off"). What are these two components responsible for?
  • #7 20904966
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14570
    Help: 654
    Rate: 12584
    speedy9 wrote:

    I have several switches under Tuya at home and indeed some happen to change state by themselves (especially to "off").
    But with the original firmware?

    speedy9 wrote:
    I wonder if soldering these components in any way corresponds to flashing?
    Firmware can indeed affect the switch state detection to some extent. For instance, it is up to the firmware to determine whether the GPIO used has programmable pull-up resistors enabled, or perhaps pull-down resistors, or perhaps none at all. Also, the debouncing algorithm could be improved, etc. Perhaps this switch on the BL602 needs some kind of fix or change of approach in the firmware to make it work better.

    I would have to have such a device for testing, but as bad as it is, even though I flash a relatively large number of devices, a smart switch on the BL602 hasn't hit me yet.
    Helpful post? Buy me a coffee.
  • #8 20904974
    speedy9
    Helpful for users
    Posts: 12023
    Help: 1233
    Rate: 2420
    p.kaczmarek2 wrote:
    Also, the debouncing algorithm could be improved
    I don't think the ac is the problem. I need to take apart a switch that plays tricks on me sometimes. It's annoying insofar as it works as a pseudo-weather switch for the furnace. And it can turn itself off for no reason at all. It is only controlled by the Tuya app. I thought it was a problem with the software and control from the Tuya cloud, but maybe it's just a problem with the electronics?
  • ADVERTISEMENT
  • #9 20905013
    zigipl
    Level 15  
    Posts: 130
    Help: 2
    Rate: 32
    >>20904710
    Look how much the parts are for on jlcpcb. A $0.10 would be 40 cents by now. With all the middlemen along the way it would probably make a buck. Well no two parts cost that much.
  • #10 20905059
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14570
    Help: 654
    Rate: 12584
    By the way, this whole board is quite poor in components, even by Chinese standards. Only a fuse resistor protects the input, I don't see a varistor or anything else, and what's more, I don't see a second electrolytic capacitor and a filter choke either (there's only the one from the inverter).

    Here, for comparison, is a schematic of a slightly more expensive product but with a similar construction idea:
    ZigBee relay module schematic with electronic components.
    Even in Tuya products I almost always see a circuit of C0, L2, C1 (from the above schematic) and on the PCB from the topic there is not even a place for it....

    @speedy9 I wouldn't split it like that, probably it would be possible to algorithmically eliminate these incorrect on/off, worse that probably the algorithm was made for another device, then someone changed something in hardware, and now the algorithm works badly
    Helpful post? Buy me a coffee.
  • #11 20905075
    speedy9
    Helpful for users
    Posts: 12023
    Help: 1233
    Rate: 2420
    p.kaczmarek2 wrote:
    I wouldn't split it like that, it would probably be possible to algorithmically eliminate these incorrect on/off switches, worse that probably the algorithm was made for another device, then someone changed something in hardware, and now the algorithm malfunctions
    Well, I don't know. These switches are rare and completely random in my opinion. It is difficult to talk about the influence of the algorithm here. On the other hand, an entry in the device log appears about the change of state.
  • #12 20905638
    gemiel
    Level 26  
    Posts: 578
    Help: 79
    Rate: 305
    pavlenkoblok wrote:
    To fix this, solder elements C6 0.1 mF and R1 10 kOhm in the place indicated in the photo.


    0.1 mF or maybe 0.1 uF ?
  • ADVERTISEMENT
  • #13 20905651
    pavlenkoblok
    Level 2  
    Posts: 2
    Help: 1
    Rate: 5
    >>20904846
    by supported commands - can read flash
    Screenshot of Windows PowerShell showing help for the blFlash program.
    I couldn't flash it using BLDevCube.exe, it throws an error and I couldn't do anything about it.
    Screenshot of Bouffalo Lab Dev Cube program displaying a flashing error.
    >>20904939
    Yes, on aliexpress everyone also complains about random switching and installing these elements eliminates these shortcomings.
    P.S. What unexpected activity in the topic I created! I even thought that this was not my topic :)

    Added after 10 [minutes]:

    >>20905059
    This is really a very cheap module, I bought it for $2. I'm just interested in understanding different platforms.
  • #14 20913044
    Epinet
    Level 1  
    Posts: 1
    >>20904492
    this modification is not necessary by replacing the bl602 module with an esp 02s and installing tasmota.
    I tested it and it works great
  • #15 20913301
    Adinfo
    Level 12  
    Posts: 26
    Rate: 5
    Just today I came across this thread (after last week's reprogramming of such a switch as in the thread) I took to testing with the swapped firmware on OBK.

    Unfortunately, I did not get a response to shorting contacts S1 and S2. I changed the settings in the configuration to do so, but to no avail (I thought there was something corrupted). Unfortunately, I did not check the operation of contacts S1 and S2 beforehand - before reprogramming the circuit.

    I found out that something is wrong on the way from the connector with pin S2 and pad R in the SM-028 board. I removed excess tin from the pad marked R, which caused the disconnection of this path from the board with BL602. I found the thread https://www.elektroda.pl/rtvforum/topic3945435.html helpful. Thanks to this, GPIO_3 - pin 4 (R) and, in addition, for testing, also GPIO_2 - pin 3 (W) - both signals began to work correctly - the circuit responded to shorting with GND. I made a bridge between the pads of the R board and the via at S2 (as a precaution I inserted an additional pull up 4k7) and cut the path so that there were no elements on the way that caused the above-mentioned problem - in the circuit from the main PCB. After this operation, the circuit responds correctly to the shorting of S1 and S2.

    However, there were repeated random changes of state (transient) which caused frequent clicking and switching of the contactor (even a dozen times in a minute) - inserting a pull up resistor did not improve anything. Only the creation of a bridge between GND as in the first post of this thread solved the problem with the random change of state of the switch.

    I did not detect a short circuit, the resistance of the path on this section close to zero - full transition (not counting the leads from the meter). As for the components at the top of the board - resistor and capacitor - in my case they are factory-installed such as in the photos in the thread - but their presence does not improve the stability of the circuit at least at the time I tested, only the bridge I wrote about to GND stabilized the operation of the circuit.

    Drawing/view photo.
    Printed circuit board with marked connections, track cut, and pull-up resistor. .
  • #16 20913377
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14570
    Help: 654
    Rate: 12584
    @Adinfo are you using the ToggleChannelOnToggle role here? Maybe it is indeed time to separate it into three versions (versions with pull up, with pull down and without pulls) and let users choose as required. Perhaps one of these versions would do better in the original configuration of this PCB.

    But in general it's hard for me to say more, I have such modules on BK7231 alone and on them nothing switches on its own (and I know, because I even have a night light on such and somehow it doesn't turn on by itself, exactly from this topic https://www.elektroda.pl/rtvforum/topic3895572.html )
    Helpful post? Buy me a coffee.
  • #17 20913404
    Adinfo
    Level 12  
    Posts: 26
    Rate: 5
    p.kaczmarek2 wrote:
    @Adinfo are you using the ToggleChannelOnToggle role here? Maybe it is indeed time to separate it into three versions...
    Yes, I am using ToggleChannelOnToggle - in this case the problem occurred, when I changed for testing, for example, to Btn then the problem with changing the state was not observed. As for the idea with versions of ToggleChannelOnToggle is great, by the way, this topic came up today during a conversation with a friend who has seen the behavior of this switch - he just happens to have experience with ESP and there he is sometimes resorted to pull up from the level of software and internal capabilities of a particular circuit. I will try to do more tests because I have 7 more similar switches to the one in the thread (different PCB versions, but most on BK7231N and one under ZigBee). The plan is to use some staircase solutions with two mechanical switches and the others under single switches wired to S1 and S2.
  • #18 21012867
    dhanushkadx
    Level 5  
    Posts: 8
    Rate: 2
    I also have BK7231N chip and its also chnage the state of S1 so it makes the relay on and off randomly. I removed the on board buttons but the issue is exist. I ll try to add a pull out resistor.
  • #19 21013733
    dhanushkadx
    Level 5  
    Posts: 8
    Rate: 2
    Circuit board with a blue LED and visible traces and solder joints.


    I made this external pulled up with 4.7k with 104 cap for low pass filter. It works 100%. Pcb down side button removed. My casing has no hole for downside button. BButton existence is not relevant to this problem . I think software pull up dosent seems to be worked. Laptop screen displaying logs and configuration for an electronic project.
  • #20 21463529
    luudi1
    Level 9  
    Posts: 4
    Rate: 2
    Adinfo wrote:
    only the bridge I wrote about to GND stabilised the circuit operation.
    .

    Printed circuit board with electronic components, including a jumper and a button. .
    Gentlemen, explain to me what gives this bridge that the circuit does not trigger itself?
📢 Listen (AI):

Topic summary

✨ The BL602L20-based SM-028_V1.3 relay modules exhibit random relay switching issues, often turning on and off unpredictably. A hardware fix involves soldering a 0.1 µF capacitor (C6) and a 10 kΩ resistor (R1) to stabilize the relay operation. The module can be unsoldered and flashed via UART using the blflash tool with the command line interface, as BLDevCube.exe may fail. Firmware influences relay behavior through GPIO pull-up/down configurations and debouncing algorithms, but hardware modifications are crucial for reliability. Some users report that replacing the BL602 module with an ESP-02S running Tasmota firmware eliminates the problem entirely. Additional hardware improvements include adding external pull-up resistors (e.g., 4.7 kΩ) and low-pass filtering capacitors to input lines, which have proven effective in preventing false triggers. The SM-028_V1.3 board is minimalistic, lacking common protective components like varistors, additional electrolytic capacitors, or filter chokes, which may contribute to instability. Software roles such as ToggleChannelOnToggle may require variants with configurable pull-up/down settings to better match hardware. Some users have identified PCB trace issues affecting input signals (e.g., between S2 and pad R), which when corrected, improve switch responsiveness. Overall, a combination of hardware component additions, firmware adjustments, and possibly module replacement is recommended to resolve random relay switching on these BL602-based IoT devices.
Generated by the language model.

FAQ

TL;DR: If your SM-028_V1.3 switch clicks randomly, add 2 parts—C6 0.1 uF and R1 10 kOhm—because, as one expert noted, "these two cheap components" were omitted. This FAQ helps BL602L20 switch owners stop self-triggering relays and flash OpenBL602 with blflash. [#20904492]

Why it matters: Random relay toggles can shut off loads unexpectedly, create repeated contactor chatter, and waste hours on software debugging when the fault is often on the input hardware.

Option What changed Reported result Main drawback
Add C6 0.1 uF + R1 10 kOhm Populate missing input parts Original poster reports random switching stops Requires SMD soldering
Add external 4.7k pull-up + 104 cap External pull-up and low-pass filter One user reports it works 100% Extra wiring, board modification
Replace BL602 with ESP-02S + Tasmota Swap Wi-Fi module entirely One user reports stable operation Biggest hardware change
Use blflash instead of BLDevCube Change flashing tool only Command-line flashing worked where BLDevCube failed Does not itself fix noisy hardware

Key insight: The thread points to a floating or poorly conditioned switch input, not a relay defect. Firmware can change behavior, but added pull-ups, filtering, or a GND bridge solved the false toggles most directly.

Quick Facts

  • The board fix named in the first post is C6 = 0.1 uF and R1 = 10 kOhm on the SM-028_V1.3 BL602L20 relay module. [#20904492]
  • The UART wiring used for flashing was TX→RX, RX→TX, GND→GND, 3V3→3V, with BT tied to 3V before connecting the adapter to the PC. [#20904492]
  • The working command-line flash example was blflash-windows-amd64.exe flash OpenBL602_1.17.402.bin --port COM7, while BLDevCube reportedly threw an error on the same hardware. [#20905651]
  • One owner bought the module for $2, and other replies argued the omitted input parts would add only about $0.10 with assembly. [#20905651]
  • A second hardware workaround used an external 4.7k pull-up with a 104 capacitor as a low-pass filter and was reported to work 100% after removing the underside button. [#21013733]

How do I stop random relay switching on an SM-028_V1.3 smart switch with a BL602L20 chip?

Add the missing input-conditioning parts first: C6 0.1 uF and R1 10 kOhm. The original repair report says this stops the relay from turning on and off randomly on the SM-028_V1.3 with a BL602L20. If your board still misbehaves, later posts show a GND bridge or an external 4.7k pull-up plus 104 capacitor can stabilize the input further. [#20904492]

Which components need to be added to the SM-028_V1.3 board to fix self-triggering relay clicks, and where exactly do they go?

You need to add C6 0.1 uF and R1 10 kOhm to the unpopulated footprints marked on the board. The first post shows the exact placement area and states these two parts must be soldered in, not removed. A later reply also corrected the unit wording, confirming the capacitor value is 0.1 uF, not 0.1 mF. [#20905638]

What is the purpose of the C6 0.1 uF capacitor and R1 10 kOhm resistor in this BL602 relay switch circuit?

They condition the switch input so noise does not look like a real press. Together, a 10 kOhm resistor and 0.1 uF capacitor form a simple pull and filter network that biases the GPIO and suppresses brief transients. The thread links their absence to random relay clicks and says installing them removes that behavior in the original ecosystem too. [#20905651]

How do I flash OpenBL602 firmware onto an SM-028_V1.3 module using blflash from the command line?

Use UART wiring and the blflash command shown in the thread. 1. Unsolder the SM-028_V1.3 module. 2. Wire TX→RX, RX→TX, GND→GND, 3V3→3V, and BT→3V. 3. Run blflash-windows-amd64.exe flash OpenBL602_1.17.402.bin --port COM7. The poster flashed OpenBL602 that way after connecting the UART adapter to a PC. [#20904492]

What is blflash, and how is it used for flashing or reading BL602 devices?

"blflash" is a command-line flashing tool that programs and reads BL602-family devices, using a serial port and explicit actions such as flash or read. In this thread, it was used with flash OpenBL602_1.17.402.bin --port COM7, and the author later showed that supported commands also allow reading flash contents. [#20905651]

BLDevCube vs blflash for BL602 modules — which tool works better when flashing SM-028_V1.3 boards?

blflash worked better in this thread for the SM-028_V1.3 board. The author said BLDevCube.exe produced an error and could not be made to work, while the command-line blflash-windows-amd64.exe successfully flashed OpenBL602 and could also read flash with supported commands. That makes blflash the proven tool here. [#20905651]

Why does the relay on some BL602 or BK7231N smart switches change state randomly even when only controlled from the app?

The thread points to unstable input circuitry, not app control alone. Users reported random state changes even when the switch was controlled only from Tuya, and one post noted a device log entry appeared for each false state change. Later fixes that added pull-ups, filtering, or a GND bridge stopped the phantom toggles, which fits a noisy GPIO path. [#20905075]

How much of the random switching problem is hardware-related versus firmware-related on these eWelink or Tuya-style Wi-Fi switches?

The thread shows both matter, but hardware dominates on these boards. Firmware can change pull-up, pull-down, and debounce behavior, yet several users fixed the problem only after adding C6 and R1, adding a 4.7k plus 104 filter, or bridging to GND. One expert also criticized the PCB for missing protective and filter parts found on better designs. [#20905059]

What is ToggleChannelOnToggle in OpenBeken, and how can its pull-up or pull-down behavior affect false relay toggles?

"ToggleChannelOnToggle" is an OpenBeken input role that changes a relay channel when a GPIO detects a toggle, with behavior shaped by the input biasing and edge detection. In the thread, an expert suggested separate versions with pull-up, pull-down, and no-pull behavior because the wrong bias can let a floating line generate false relay toggles. [#20913377]

Why did changing the input role from ToggleChannelOnToggle to Btn stop random state changes for some users?

Changing to Btn stopped the false toggles because it changed how the firmware interpreted the noisy input. One user said random state changes occurred with ToggleChannelOnToggle, but not when testing with Btn. That points to the trigger logic and input bias, not the relay output stage itself, as the source of the problem. [#20913404]

What does the added bridge to GND actually do in the SM-028_V1.3 fix, and why does it stop the switch from triggering itself?

The GND bridge gives the problematic input path a solid reference, so it no longer floats and self-triggers. A user reported that factory-fitted resistor and capacitor parts still did not stabilize his board, but a bridge to GND did. He also observed frequent chatter, even a dozen times per minute, before that bridge fixed the behavior. [#20913301]

How can I troubleshoot S1 and S2 inputs on an SM-028_V1.3 board when shorting them to GND does not produce any response?

Check continuity between the S1/S2 connector path and the SM-028 module pads before changing firmware settings. One repair found a fault between the S2 connector and the pad marked R; removing excess solder isolated the bad path, and a bridge from the R pad to the via near S2 restored response to shorting with GND. An added 4k7 pull-up was used as a precaution. [#20913301]

What is the best external pull-up and low-pass filter fix for BK7231N or BL602 switches that still toggle randomly after removing the onboard button?

Use an external 4.7k pull-up with a 104 capacitor as a low-pass filter. A BK7231N user reported that removing the onboard button did not solve the random toggling, but this external network worked 100%. He also concluded the underside button was not relevant and that the software pull-up did not seem effective on his board. [#21013733]

How does replacing the BL602 module with an ESP-02S running Tasmota compare with modifying the original board to cure random switching?

Replacing the BL602 with an ESP-02S running Tasmota is a working bypass, not a minimal fix. One user tested that swap and said it worked great without needing the modification discussed in the first post. Compared with adding C6 and R1, the ESP-02S route changes the whole radio module, so it is more invasive but avoids BL602-specific behavior. [#20913044]

What safety or design weaknesses should I watch for on these very cheap relay boards, such as missing varistors, filter chokes, or input protection parts?

Watch for stripped-down mains input protection and sparse filtering. One expert said this board had only a fuse resistor at the input and lacked a varistor, a second electrolytic capacitor, and the common C0-L2-C1 filter network seen on better Tuya-style designs. The original poster also said the module cost only $2, which matches the aggressive cost cutting noted throughout the thread. [#20905059]
Generated by the language model.
ADVERTISEMENT