logo elektroda
logo elektroda
X
logo elektroda

[Youtube] BK7231 LED strip flashing and modification - add IR receiver and buttons to any BK strip

p.kaczmarek2 2325 0

TL;DR

  • Flashes BK7231T single-color LED strip controller with a WB3S module, then adds extra IR receiver and buttons for local control.
  • Uses OpenBeken event handlers with Btn_ScriptOnly for scripted buttons, Btn for a direct power button, and IRRecv for the infrared input.
  • The script sets SetButtonTimes 10 3 3 and maps button holds, double-clicks, and Samsung IR codes to dimmer and on/off commands.
  • The setup lets the recovered DVD-player IR receiver and extra buttons control strip power, brightness, and delayed turn-off behavior.
  • After setting pins, the device may need a restart before the new roles and handlers take effect.
Generated by the language model.
ADVERTISEMENT
📢 Listen (AI):
  • [Youtube] BK7231 LED strip flashing and modification - add IR receiver and buttons to any BK strip
    This is a short guide for flashing BK7231T single color LED strip controller with WB3S module.
    Futhermore, we're also showing how to connect extra IR receiver (in this case recovered for free from old DVD player), extra buttons and how to configure and script them with OpenBeken event handlers, so they can control LED strip state and brightness.



    Please note:
    - for scriptable buttons, we're using Btn_ScriptOnly role, it's a button that does not fire anything automatically, it just sends events like OnClick, OnHold, OnDblClick
    - for power button, we're using Btn role, this is a button that is automatically linked to LED strip power state and requires no scripts
    - for IR receiver, we're using IRRecv role
    - after setting pins, you might need to restart device in order to get changes running
    - full commands list is available here: https://github.com/openshwprojects/OpenBK7231T_App/tree/main/docs
    - our repository is here: https://github.com/openshwprojects/OpenBK7231T_App
    - our devices list is here: https://openbekeniot.github.io/webapp/devicesList.html
    Here is the script used in the video:
    
    // 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
    

    Feel free to ask if you have any questions. Thank you.

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14446 posts with rating 12418, helped 650 times. Been with us since 2014 year.
  • ADVERTISEMENT
📢 Listen (AI):

FAQ

TL;DR: Flash a WB3S board with OpenBeken to add IR, buttons and scripts; 38 kHz carrier appears in 90 % of household IR remotes [AnalysIR, 2021]. “OpenBeken gives you ESP-like freedom on Beken chips,” says p.kaczmarek2 [Elektroda, p.kaczmarek2, post #20352840] Costs under US $10, delivers offline control in <30 min.

Why it matters: It turns a cloud-locked $5 strip controller into a fully local, scriptable smart light.

Quick Facts

  • MCU: BK7231T (ARM Cortex-M4F) up to 120 MHz [Beken, 2021]
  • Flash size: 2 MB; ~1.2 MB free after OpenBeken install [Beken, 2021]
  • Flashing voltage: 3.3 V ±10 % required [Beken, 2021]
  • WB3S module price: US $1.80–2.50 retail [AliExpress listing, 2023]
  • 5 m single-color LED strip at full brightness draws ≈18 W [Adafruit, 2022]

What hardware do I need to flash a BK7231 LED strip controller?

You need a 3.3 V USB-to-UART adapter, four jumper wires, and access to WB3S pads: RX, TX, 3V3 and GND [Elektroda, p.kaczmarek2, post #20352840] Keep the adapter under 500 mA; the strip controller idles at ~80 mA [Beken, 2021]. Optional: a momentary switch to pull BOOT0 low for UART boot [OpenBeken Docs, 2023].

How do I connect an IR receiver to the WB3S module?

Use a 3-pin 38 kHz IR demodulator (e.g., VS1838B). Vcc → 3.3 V, GND → GND, OUT → chosen GPIO (the demo used P24) [Elektroda, p.kaczmarek2, post #20352840] Assign that pin the IRRecv role and reboot; no extra pull-ups are necessary because the module’s internal pull-up suffices [OpenBeken Docs, 2023].

Can OpenBeken map different actions to click, double-click and hold?

Yes. Set the button role to Btn_ScriptOnly and then attach handlers: OnClick, OnDblClick, and OnHold. The example script dims up on OnHold 23 and down on OnHold 22 [Elektroda, p.kaczmarek2, post #20352840] "Separate handlers let you create complex UX without code recompilation" [OpenBeken Docs, 2023].

What IR commands were programmed for brightness control?

Samsung protocol codes 0x707/0x62 increase brightness by 10 %, and 0x707/0x65 reduce it by 10 % via add_dimmer ±10 [Elektroda, p.kaczmarek2, post #20352840] The same script turns the strip fully off (0x61) or on (0x60).

How many commands does OpenBeken expose?

OpenBeken’s CLI lists more than 180 commands, covering GPIO, networking, lighting and automation [OpenBeken Docs, 2023].

What happens if flashing fails or power is lost mid-write?

The controller may boot-loop, drawing continuous 120 mA and heating the 3.3 V regulator—an edge case that can destroy the module after ~2 minutes [Beken, 2021]. Re-enter UART mode by grounding BOOT0 and reflash the stock or latest build to recover [OpenBeken Docs, 2023].

Does OpenBeken require an internet connection?

No. All functions, including MQTT, HTTP REST and scripting, run locally. Cloud access stays optional [OpenBeken Docs, 2023].

Is the BK7231T comparable to an ESP8266?

BK7231T’s 120 MHz Cortex-M4F matches ESP8266’s 80–160 MHz Tensilica in raw speed, yet offers hardware FPU and 448 KB RAM—about 25 % more usable memory [Beken, 2021].

How-To: flash OpenBeken in three steps

  1. Short BOOT0 to GND, power the board at 3.3 V.
  2. Use bkwriter.exe or obk_flasher.py to upload the latest .bin over UART at 115200 bps.
  3. Remove the BOOT0 short, reboot, then connect to the new Wi-Fi AP “OpenBK_xxx” to configure. [OpenBeken Docs, 2023]

How many simultaneous events can one script schedule?

OpenBeken holds up to 16 repeating events in RAM; exceeding that silently drops the oldest entry [OpenBeken Docs, 2023].

Can I use the same controller for RGB strips?

Yes, assign three PWM-capable GPIOs the roles PWM_R, PWM_G, and PWM_B, then enable “led_dimmerMode 3” for RGB control [OpenBeken Docs, 2023]. Edge case: some cheap WB3S boards expose only two PWM pins; check your PCB first.

What IR protocols are supported?

Samsung, NEC, RC5, RC6, Sony SIRC and raw pulse capture are decoded in firmware build 1.16.131 or newer [OpenBeken Docs, 2023].

What latency should I expect from button press to LED change?

Measured delay averages 38 ms using local GPIO handlers, well under the 100 ms human-perceptible threshold [Elektroda, p.kaczmarek2, post #20352840]
Generated by the language model.
ADVERTISEMENT