Elektroda.com
Elektroda.com
X

[BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

MnM1 198 9
  • Helpful post
    #1
    MnM1
    Level 8  
    Hi,

    Below is my journey to free up the Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light from the Tuya cloud.

    Part 1 - Preparation

    AliExpress device link: Link

    Some pictures of the device:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Below are some pictures of the actual device. Both the white LEDs and the RGB ones are very bright (a bit hard to tell from the pictures but they are).

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Opening the device is very easy - a few screws and then the lid can come off.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light


    After taking the cover off (be careful not break the wires when taking off the cover) this is what we find inside:

    - White LEDs:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    - RGB LEDs:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Below is a picture with an overview of the circuit board:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Also some closeup pictures of the components on the circuit board:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    The Tuya CB3S module - there are no markings on the CB3S Module at all. In the second picture you can notice that I have gently pushed the capacitor (assume it is a capacitor :) ) a little bit out of the way to expose the CB3S module connections.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Since the Tuya module has been identified as a Tuya CB3S module the device will need to be flashed with BK7231N
    Below are some pictures from a test module that I had which further strengthen the case that it is a Tuya CB3S module:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    I have added the light to Tuya Smart Life. Below are some screenshots of what options the device has in the Tuya app:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Through Tuya IoT I was able to get the DP IDs for the light (but I am not sure if Tuya MCU is actually used on this device):
    {
      "result": {
        "properties": [
          {
            "code": "switch_led",
            "custom_name": "",
            "dp_id": 20,
            "time": 1694525805773,
            "value": true
          },
          {
            "code": "work_mode",
            "custom_name": "",
            "dp_id": 21,
            "time": 1694524999630,
            "value": "white"
          },
          {
            "code": "bright_value",
            "custom_name": "",
            "dp_id": 22,
            "time": 1694524999630,
            "value": 1000
          },
          {
            "code": "temp_value",
            "custom_name": "",
            "dp_id": 23,
            "time": 1694524999630,
            "value": 1000
          },
          {
            "code": "colour_data",
            "custom_name": "",
            "dp_id": 24,
            "time": 1694524999630,
            "value": "000003e803e8"
          },
          {
            "code": "scene_data",
            "custom_name": "",
            "dp_id": 25,
            "time": 1694524999630,
            "value": "000e0d0000000000000000c803e8"
          },
          {
            "code": "countdown",
            "custom_name": "",
            "dp_id": 26,
            "time": 1694524999630,
            "value": 0
          },
          {
            "code": "music_data",
            "custom_name": "",
            "dp_id": 27,
            "time": 1694524996077,
            "value": ""
          },
          {
            "code": "control_data",
            "custom_name": "",
            "dp_id": 28,
            "time": 1694524996077,
            "value": ""
          },
          {
            "code": "mix_rgbcw",
            "custom_name": "",
            "dp_id": 51,
            "time": 1694525805471,
            "value": "AAUAAAPoA+gD6AOE"
          }
        ]
      },
      "success": true,
      "t": 1694526329122,
      "tid": "a2946995517211eeb3f09e6a0abc163a"
    }


    These are the "tools" that I will use to flash OBK to this device:

    1. UART 3.3V and 5V (selectable)

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    2. Arduino Uno R3 - I have used a starter kit with mains power supply

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Below are some pics on how I put the UART and Arduino Uno together:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Some notes for beginners like me :) on the above setup:
    - had to use additional power source as UART will not provide sufficient power
    - I tried intially to get power from the 5V pin on UART and use a 3.3V LDO but that did not work for me. So I got the Arduino Uno R3 kit that is powered with a mains external power supply
    - Ground had to be connected from the Arduino Uno to the chip and the UART

    3. BL7231 Easy UART Flasher
    I will be using used version 1.1.1 on a Windows PC

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Stay tuned for Part 2 - the OBK flashing process.

    Added after 10 [hours] 15 [minutes]:

    Part 2 - Flashing OBK

    As you can see in the picture below the Tuya CB3S module actually has some holes on the side.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    So instead of taking the whole PCB out and solder wires I have decided to leave it in place and use the Arduino wires to push them slightly in, just enough that they stay put in the holes and don't actually come out.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    In the picture below everything is connected and powered up.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Next I start BK7231 Easy UART Flasher on my Windows PC

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Started to do a read/write test (and in the process I had to quickly short the CEN wire to the Ground wire). The test completed successfuly.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Next step was to select the Do firmware backup (read) only in BK7231 Easy UART Flasher. Original Tuya backup completed successfully. Backup file is attached below.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Next I have selected Do firmware write (no backup) to flash the device with OpenBK7231N_QIO_1.17.244.bin file. The flash was successful.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    I have then removed all the wires from the device and put its cover back and tightened the screws. Next I have connected power to the device.
    I saw its AP, connected to it and added the WIFI configuration. After the reboot the device was on my network and I could connect to it web interface

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Stay tuned for Part 3 - Device Configuration.
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
  • Helpful post
    #2
    MnM1
    Level 8  
    Part 3 - Device Configuration

    As you can see from the Tuya app screenshot this device has 2 individual configurations, 1 for the white LEDs and another for the RGB LEDs.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    Also the GPIO config doesn't look like it had any meaningful information in it:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    So through some trial and error I have managed to find the configuration for the white LEDs. With it I can toggle ON/OFF, control the brightness and temperature of the white LEDs.

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light
    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    With the RGB LEDs things are getting more complex, at least for me.
    I have figured that if I set P8, 24 and 26 to LEDs at least I can confirm that I got the right pins. The result is:

    P8 = 3 = RED Color
    P24 = 4 = GREEN Color
    P26 = 5 = BLUE Color

    So at least I got the pins and color correct. However this is not how the configuration should be because I get 3 extra individual toggle buttons on the web interface. There is no brightness or color picker at all:

    [BK7231N] Teardown of Zemismart TUYA WiFi Ceiling Lamp 34W with CCT RGB Colorful Back Light

    What I think we should have there is a another toggle button for the RGB LEDs with its own brightness and RGB color picker.

    @p.kaczmarek2 - I might need your assistance to finish off the configuration of this device as I have no idea how to make the above happen. As mentioned white LEDs are working perfect is just the RGB ones that are not.
  • #3
    p.kaczmarek2
    Moderator Smart Home
    Hello, what is the expected use case of the ability to set the CCT and RGB modes independently? The following is currently not officially supported, because once you set 5 PWM pins, OBK tries to enable the classic RGB + CCT controller where you have to switch one of the two modes.
  • #4
    MnM1
    Level 8  

    That is how the device works with the Tuya firmware. So it will be good to have it work the same with OBK.
    If I set all the pins to PWM, there are a few things wrong with it:

    - One cannot independently control the on/off toggle of the white light and RGB ones as per Tuya firmware.
    - After you toggle the light on, if the dimmer/brightness is used, it switches off the white LEDs.
    - Similarly, for the temperature slider, if it turns off the white light.
    - The RGB color picker actually changes the white light temperature - the LEDs' color does not change at all.
    - The RGB LEDs are always red - I could not change them to another color.

    Maybe there are more issues, but this is what I have picked up through my testing.
  • #6
    MnM1
    Level 8  

    I just quickly tried that (enable Flag 3).

    It has 5 sliders that will control the lights.

    The top 2 sliders will control the white light, achieving in a way what the previous configuration did.
    The last 3 sliders sort of equal an RGB picker but in a weird way :)
    There are no on/off toggle buttons.

    Any chance you can have OBK support the functions as they were in the Tuya firmware?
  • #7
    MnM1
    Level 8  
    @p.kaczmarek2 - anything you can do to have this device supported in OBK? I really don't wanna got back to Tuya firmware.

    Added after 1 [hours] 16 [minutes]:

    Looks like Tasmota has this supported:

    https://templates.blakadder.com/taloya_GA300-24W-AI-WEMG.html

    "To enable independent handling of RGB and white channels the following must be run: SetOption37 128

    To enable the second PWM to control the color temp the following must be run: SetOption92 ON”

    Maybe it will make it easier to migrate the same config in OBK?
  • #8
    MnM1
    Level 8  

    Installed ESPHome on this device and it is fully supported - can individually control the white LEDs and RGB LEDs.

    It is OK for now but I would like to come back to OBK when this device will be supported.
  • #9
    ferbulous
    Level 16  
    Don't RGBCW pins usually configured like this?

    P8 = 1 = RED Color
    P24 = 2 = GREEN Color
    P26 = 3 = BLUE Color
    P7 = 4 = Cold
    P6 - 5 = Warm
  • #10
    MnM1
    Level 8  
    Yes - but is still a single toggle button for the 2 individual lights.