logo elektroda
logo elektroda
X
logo elektroda

[BK7231N / CBU] SK26 Galaxy Star Projector

similicious 2133 15
ADVERTISEMENT
  • Overview

    Galaxy projector displaying colorful lights and a mobile app for control.

    This projector has 5 components
    - RGB LED, projected through a lens (nebula)
    - Laser, projected through a screen (stars)
    - Motor, turns the lense and screen, resulting in movement of the nebula and stars
    - Microphone, to sync the light to music
    - 3 Buttons on the front, to turn on the projector, cycle scenes, activate music mode

    Info:
    - Chip: BK7231N
    - Module: CBU

    Close-up view of the projector's circuit board with labeled ports and buttons.

    It's quite close to the device showcased here, but it features a different chip, Tuya module and construction, so I figured it would be worth documenting. Nevertheless, most of the work has been done for the Genio projector so it was easy to get this one running. Thanks @joelstevens1101 and @p.kaczmarek2 for your work!

    Teardown

    Remove the 4 screws at the bottom of the device. They are quite hard to reach, you need a very short phillips head screwdriver.

    Lift off the top cover to right hand side. Caution: The button board is connected with the main board, so you need to unplug the red cable before removing the cover completely.
    Close-up of the projector's interior with an open casing, showing a red cable connecting the buttons to the main board.

    Remove 6 more screws from the black middle frame.
    Interior view of a starry sky projector with labeled components.
    Remove the lense and the screen. The motor is attached to the frame on the bottom. When moving the frame make sure you don't damage the cables. Either put the frame to the side or unplug the cable with pliers.

    The main board is glued in place. I had to wiggle it for some time with moderate force to get it out. When pulling out the board, again pay attention to the cables.
    Interior of a disassembled projector showing electronic components.

    Unplug the rest of the cables. They are also glued to the connectors, so make sure you pull on the plug, not on the cables.

    You did it! The board looks like this:
    Top view of an SK26 projector circuit board with component and connector labels.
    LED projector circuit board with various components and a CBU module on the surface.

    Flashing

    For VCC and GND I used the pads below the module, as they are easier to solder to. They are labelled. TX (Pin 15) and RX (Pin 16) are on the right hand side of the chip. Tin your wires and pads, flux will help you. To solder, just connect the wire with the pad and touch it with the iron briefly.
    Circuit board with marked RX, TX, VCC, and GND pins

    Connect the soldered wires to your programmer. I used a NodeMCU that I had lying around as described here. Conveniently it also operates on 3.3V so I had no issue with voltage conversion.

    The BK7231 GUI Flash Tool works just fine for flashing. It is quite straightforward: Make sure you select the correct COM port and BK7231N as the chip. Start the backup and flashing procedure and power cycle the chip when prompted. Note: Only reset the chip, not the programmer. You can find the backup of my devices ROM attached to this thread.
    readResult...-23-05.bin Download (2 MB)

    Should you not able be able to get a connection to in the flash tool, double check your solder joints. The ones on the chip in my picture actually short TX and RX, so I had to redo them.

    After flashing is complete, power cycle the device again. A new Wifi network should appear. Set up the device to join your local network. Confirm you can connect the device to it using your Wifi.

    Congrats! That was the hard part - the new firmware is flashed. You can now desolder the wires you used for flashing and put the device back together.

    Setup

    Launch the webapp and head to Import. Paste the template in the first column and click Clear OBK and apply new script from above.

    
    {
      "vendor": "Generic",
      "bDetailed": "0",
      "name": "Smart LED Galaxy Projector",
      "model": "SK26",
      "chip": "BK7231N",
      "board": "CBU",
      "flags": "1446912",
      "keywords": [
        "led",
        "rgb",
        "star",
        "nebula",
        "projector",
        "laser",
        "motor"
      ],
      "pins": {
        "6": "PWM_n;3",
        "7": "PWM;5",
        "8": "PWM;4",
        "14": "Btn_SmartLED;0",
        "20": "Btn_ScriptOnly;0",
        "22": "Btn_ScriptOnly;0",
        "24": "PWM_n;2",
        "26": "PWM_n;1"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/2917649700_1702586359.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/viewtopic.php?p=20863828#20863828"
    }
    

    After restarting, on the main page you should be already able to control the RGB LED. But we are not done yet.

    To get the motor and laser working head over to Filesystem, click Create File, confirm autoexec.bat as the name and paste the following content into it. It will couple the state of the of the LED to the motor and laser and set startup values for them.

    
    // PWM TOGGLER SETUP
    
    // enable toggler driver
    startDriver PWMToggler
    
    // toggler slot one is the laser, channel 4
    toggler_channel0 4
    toggler_name0 Laser
    
    // toggler slot two is the motor, channel 5
    toggler_channel1 5
    toggler_name1 Motor
    
    // set startup values for laser
    toggler_set0 100
    toggler_enable0 1
    
    // set startup values for motor
    toggler_set1 100
    toggler_enable1 1
    
    // LED, LASER, MOTOR COUPLING
    
    // when disabling the LED, also disable laser and motor
    addEventHandler LEDState 0 backlog toggler_enable0 0; toggler_enable1 0; 
    
    // when enabling the LED, also enable laser and motor
    addEventHandler LEDState 1 backlog toggler_enable0 1; toggler_enable1 1; 
    
    // BUTTONS
    
    // TOGGLE LASER
    alias enable_laser toggler_enable0 1
    alias disable_laser toggler_enable0 0
    
    addEventHandler OnClick 20 if $CH4==100 then disable_laser else enable_laser
    
    // TOGGLE MOTOR
    alias enable_motor toggler_enable1 1
    alias disable_motor toggler_enable1 0
    
    addEventHandler OnDblClick 20 if $CH5==100 then disable_motor else enable_motor
    
    // CYCLE FEATURE
    setChannelType 10 Toggle
    setChannelLabel 10 "color cycle" 0
    
    alias add_color_cycle_event addRepeatingEventID 10 -1 420 led_nextcolor
    alias remove_color_cycle_event cancelRepeatingEvent 420
    
    addChangeHandler Channel10 == 1 add_color_cycle_event
    addChangeHandler Channel10 == 0 remove_color_cycle_event
    
    alias enable_color_cycle SetChannel 10 1
    alias disable_color_cycle SetChannel 10 0
    
    addEventHandler OnClick 22 if $CH10==1 then disable_color_cycle else enable_color_cycle
    addEventHandler LEDState 0 disable_color_cycle
    
    // COLOR PALETTE
    SPC 0 FF00AE
    SPC 1 BB00FF
    SPC 2 5500FF
    SPC 3 0008FF
    SPC 4 0040FF
    SPC 5 0D6CD2
    SPC 6 17D1FF
    SPC 7 1EFF30
    SPC 8 FCD023
    SPC 9 FC8F00
    SPC 10 FF0000
    SPC 11 FF0088
    SPC 12 FF00DD
    

    Confirm with Save, Reset SVM and run file as script thread.

    Now the main menu should look like this:
    LED projector control panel with various options such as mode switching and brightness settings.

    You can toggle the LED, Motor and Laser and control the brightness and speed. Also there is a button to automatically cycle the colors. The color pallete can be customized at the bottom of the script.

    Buttons

    The buttons are configured like this
    - Music: 1x Click: toggle laser, 2x Click: toggle motor
    - Switch: 1x Click: toggle LED + laser + motor, 2x Click: next color, Hold: change brightness
    - Scene: Toggle automatic color palette cycle

    Homeassistant

    This config adds the light, motor, rgb and the color cycle mode to Homeassistant. You will need to adjust the mqtt topics to match your configuration.

    Projector 3000 app interface with control options enabled.

    
    mqtt:
      light:
    
        - unique_id: "star_projector_rgb"
          name: "RGB"
          availability_topic: "home/living-room/star-projector/connected"
    
          device:
            name: "Star Projector"
            model: "SK26"
            manufacturer: "Tuya"
            identifiers: "sk26affe"
    
          # on / off
          state_topic: "home/living-room/star-projector/led_enableAll/get"
          command_topic: "cmnd/home/living-room/star-projector/led_enableAll"
          payload_on: 1
          payload_off: 0
    
          # rgb
          rgb_state_topic: "home/living-room/star-projector/led_basecolor_rgb/get"
          rgb_value_template: "{{ value[0:2]|int(base=16) }},{{ value[2:4]|int(base=16) }},{{ value[4:6]|int(base=16) }}"
          rgb_command_topic: "cmnd/home/living-room/star-projector/led_basecolor_rgb"
          rgb_command_template: "{{ '#%02x%02x%02x0000' | format(red, green, blue)}}"
    
          # brightness
          brightness_command_topic: "cmnd/home/living-room/star-projector/led_dimmer"
          brightness_state_topic: "home/living-room/star-projector/led_dimmer/get"
          brightness_scale: 100
    
        - unique_id: "star_projector_laser"
          name: "Laser"
    
          state_topic: "home/living-room/star-projector/toggler_enable0/get"
          command_topic: "cmnd/home/living-room/star-projector/toggler_enable0"
          payload_on: 1
          payload_off: 0
    
          brightness_state_topic: "home/living-room/star-projector/toggler_set0/get"
          brightness_value_template: "{{value}}"
          brightness_command_topic: "cmnd/home/living-room/star-projector/toggler_set0"
          brightness_scale: 100
    
          device:
            identifiers: "sk26affe"
    
        - unique_id: "star_projector_motor"
          name: "Motor"
    
          state_topic: "home/living-room/star-projector/toggler_enable1/get"
          command_topic: "cmnd/home/living-room/star-projector/toggler_enable1"
          payload_on: 1
          payload_off: 0
    
          brightness_state_topic: "home/living-room/star-projector/toggler_set1/get"
          brightness_value_template: "{{value}}"
          brightness_command_topic: "cmnd/home/living-room/star-projector/toggler_set1"
          brightness_scale: 100
    
          device:
            identifiers: "sk26affe"
    
      switch:
    
        - unique_id: "star_projector_color_cycle"
          name: "Color cycle"
    
          state_topic: "home/living-room/star-projector/10/get"
          command_topic: "home/living-room/star-projector/10/set"
          payload_on: 1
          payload_off: 0
          
          device:
            identifiers: "sk26affe"
    


    What doesn't work

    Microphone
    The projector has a builtin piezo microphone to sync the light to music. I wasn't able to get that working. I assume it's connected to PIN 5 (ADC) but I can't tell if the readings correlate to the music.
    Graph showing fluctuating raw values on the y-axis over time.

    Cool? Ranking DIY
    About Author
    similicious
    Level 3  
    Offline 
    similicious wrote 8 posts with. Been with us since 2023 year.
  • ADVERTISEMENT
  • #2 20863864
    similicious
    Level 3  

    Not sure how my post ended up in this forum. Or was it moved here automatically? Anyways, feel free to move it to the appropriate place.
  • #3 20863886
    p.kaczmarek2
    Moderator Smart Home
    Thank you for this detailed guide, @similicious ! That will certainly be helpful for both beginners and advanced IoT tinkerers. Don't worry about it being temporary in the "Temp" section, we just need to review your tutorial and in a moment. I will also help you finish the integration, and then we will move it to front page.

    similicious wrote:

    Buttons
    Also it would be cool to make the buttons more useful, but I couldn't figure out how to set it up.

    There are two ways to configure buttons in OpenBeken. You can either use one of the predefined roles, just like you did (Btn_SmartLED, etc), or you can script them directly. Just remember, for scripting, set their role to Btn_ScriptOnly. Then you can look at our examples here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    Here is a sample script from the documentation:
    
    // IR driver will start itself automatically after reboot
    
    // P21 role is Btn, a power button that works without scripting
    // set button hold/repeat/etc times
    SetButtonTimes 10 3 3
    // alias to turn off LED after 4 secs (repeating event with 1 repeat)
    alias add_turnoff_event addRepeatingEvent 4 1 led_enableAll 0
    // button events - 23, 22, etc are pin numbers
    addEventHandler OnHold 23 add_dimmer 10
    addEventHandler OnHold 22 add_dimmer -10
    addEventHandler OnDblClick 22 led_dimmer 5
    addEventHandler OnDblClick 23 led_dimmer 100
    addEventHandler OnClick 20 add_turnoff_event
    // IR events
    addEventHandler2 IR_Samsung 0x707 0x62 add_dimmer 10
    addEventHandler2 IR_Samsung 0x707 0x65 add_dimmer -10
    addEventHandler2 IR_Samsung 0x707 0x61 led_enableAll 0
    addEventHandler2 IR_Samsung 0x707 0x60 led_enableAll 1
    

    This is also for IR, but for now, let's focus on button events. You can use button events like OnHold, OnClick, OnDblClick to execute custom script commands or even to run a new script thread.


    similicious wrote:

    Colors
    The colors the button cycles through don't look great. It would be cool to customize them.

    We are using the same palette as Tasmota, would you like to be able to modify it?
    Or maybe would you like to do a fully scriptable approach?

    The color table can be made fully in script. A Choice command can be used for that. See example below:
    
    
    alias col1 led_basecolor_rgb 0xFF0000
    alias col2 led_basecolor_rgb 0x00FF00
    alias col3 led_basecolor_rgb 0x0000FF
    alias col4 led_basecolor_rgb 0xFFFF00
    alias col5 led_basecolor_rgb 0xFF00FF
    alias col6 led_basecolor_rgb 0x00FFFF
    
    // use choice to choose effect by index stored in $CH10
    alias do_chosen_effect Choice $CH10 col1 col2 col3 col4 col5 col6
    // when click on Btn_ScriptOnly on P24 happens, add 1 to $CH10 (wrap to 0-5) and do effect
    addEventHandler OnClick 24 backlog addChannel 10 1 0 5 1; do_chosen_effect
    
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 20863956
    similicious
    Level 3  
    Amazing, thanks for your help!

    I will use that to map laser and motor controls to the buttons.

    As for the color palette, it would be pretty cool to be able to configure the palette, so Btn_SmartLED can be reused.
  • #5 20863970
    p.kaczmarek2
    Moderator Smart Home
    So basically you want a command to set palette color by index?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #6 20863981
    similicious
    Level 3  
    It would be amazing to have a command to toggle a toggler. And also one to add to it, like so

    
    addEventHandler OnClick 20 toggler_toggle0
    addEventHandler OnDblClick 20 toggler_add0 10
    
    addEventHandler OnClick 22 toggler_toggle1
    addEventHandler OnDblClick 22 toggler_add1 10
    


    p.kaczmarek2 wrote:
    So basically you want a command to set palette color by index?

    That would be helpful. But since it can be worked around, it's not that important.
  • ADVERTISEMENT
  • Helpful post
    #7 20864016
    p.kaczmarek2
    Moderator Smart Home
    For now, I've added ability to set the palette. Can you check?
    https://github.com/openshwprojects/OpenBK7231...mmit/2b43acdbb670a5a37cf7b37c6407950b2031ff87
    Build is ready.
    Usage is:
    
    SPC 0 FF0000
    

    This sets palette color 0 to red. The default palette is same as in Tasmota.
    Helpful post? Buy me a coffee.
  • #8 20864046
    similicious
    Level 3  
    p.kaczmarek2 wrote:
    Can you check?


    It works, thanks a lot!
  • #9 20864071
    p.kaczmarek2
    Moderator Smart Home
    similicious wrote:
    And also one to add to it, like so
    
    addEventHandler OnDblClick 20 toggler_add0 10
    addEventHandler OnDblClick 22 toggler_add1 10
    


    This is a good idea but I need to respect flash size limits. What about supporting the following syntax:

    
    // sets the toggler to 25
    toggler_set1 25
    // add 25 to the toggler (and clamp)
    toggler_set1 +25
    // sub 25 to the toggler (and clamp)
    toggler_set1 -25
    

    Keep in mind that we didn't support negative togglers so using -25 as "subtract 25" will not break anything. Togglers are in 0-100 range....

    Added:
    https://github.com/openshwprojects/OpenBK7231...mmit/5a4dc0241eb9aadcbe55f9bedb07fec1ea17a9e3
    Helpful post? Buy me a coffee.
  • #10 20864426
    similicious
    Level 3  

    Alright, I had to figure out the scripting language a bit, but I got it now.

    Buttons now toggle laser, motor, and automatic color palette cycle mode.
    I did not end up using the new toggler set feature, as changes within the 0 - 100 range are barely noticeable anyway. So I configured the buttons to only toggle them instead.
    I updated the guide accordingly.

    The only thing left would be the microphone, although I'm not sure if it's worth the effort. The feature also did not work properly with the original firmware.
  • #11 20864476
    p.kaczmarek2
    Moderator Smart Home
    How is the microphone supposed to work?
    Helpful post? Buy me a coffee.
  • #12 20864806
    similicious
    Level 3  

    I'm not sure. The microphone is connected via two wires. If I follow the traces correctly, they go into an LM358 IC, which is an amplifier of some kind. Then I just assume that the signal goes to Pin 5 of the module, which is the ADC. I set that pin to ADC in OBK and plotted the readings in MQTT-Explorer - you can see the graph in the post. That data could be used to find peaks in the audio and then sync to color changes or to toggle the laser. But I don't know how to go about that.

    Maybe I will look into it someday. For now, I'm more than happy with the integration. Thanks again! :)
  • #13 21041909
    divadiow
    Level 34  
    similicious wrote:
    You can find the backup of my devices ROM attached to this thread.


    and from that comes

    Code: JSON
    Log in, to see the code


    Code: JSON
    Log in, to see the code
  • #14 21041916
    similicious
    Level 3  
    Cool! How have you read this data?
  • #15 21045634
    helge1
    Level 4  
    Hi, thank you for this great work! I received my sk26 today which I ordered after I had discovered this thread. I already use two sk20 star projectors with ESPHome (there's a software jailbreak available for them but the security exploit doesn't work for the sk26). The reason why I wanted the sk26 in addition to the sk20 is because of the availability of blue laser while for the sk20 only green laser is available for purchase (at least in Europe and on Aliexpress).

    I wanted to inform you about this ESPHome project for the sk20 which could probably server as good starting point for building an ESPHome configuration also for the sk26:

    https://github.com/M4GNV5/esphome-SK20-Nebula-Light/blob/master/nebula_light_device.yaml

    I will certainly look into this myself later, right now I have some other ESPHome projects that I want to finish first. But maybe someone else has time and interest in checking out the ESPHome config https://github.com/M4GNV5/esphome-SK20-Nebula-Light/blob/master/nebula_light_device.yaml for the sk20 already.

    This is a picture of the sk20:

    White SK20 star projector with a blue laser on the side.
  • #16 21061833
    helge1
    Level 4  
    Quick update for everyone who is maybe also interested in using ESPHome for this Tuya MCU: I flashed the configuration from https://github.com/M4GNV5/esphome-SK20-Nebula-Light which was developed for the sk20 projector (https://www.elektroda.com/rtvforum/topic3939064.html) without making any adjustments to the config. Luckily the projector didn't blow up and the config already provides some working functionality of the projector, nevertheless it will need some config adjustments to provide a fully working user experience. I will work on this some time later and then share an updated config.

Topic summary

The SK26 Galaxy Star Projector features a BK7231N chip and a CBU module, incorporating five main components: an RGB LED for nebula projection, a laser for star projection, a motor for movement, a microphone for music synchronization, and three buttons for control. Users have discussed integrating the projector with OpenBeken firmware, allowing for button configuration and scripting to control the laser, motor, and color palette. A user shared their experience with ESPHome configurations for similar devices, noting the potential for adapting existing configurations for the SK26. The microphone's functionality remains uncertain, with suggestions for using its output to sync light changes to audio peaks.
Summary generated by the language model.
ADVERTISEMENT