logo elektroda
logo elektroda
X
logo elektroda

[BK7321N] IR smart receiver with CHT8305 sensor with CBU module

DeDaMrAz 2436 14
ADVERTISEMENT
  • Helpful post
    #1 20560227
    DeDaMrAz
    Level 22  
    Here is a short teardown of a generic IR controller with CBU module and CHT8305 temperature sensor. Sorry now links or prices but it looks very similar to this topic - https://www.elektroda.com/rtvforum/topic3933390.html#20348190

    Easy to open and disassemble:

    [BK7321N] IR smart receiver with CHT8305 sensor with CBU module [BK7321N] IR smart receiver with CHT8305 sensor with CBU module

    You can now use new features in the web app to get the templates and save them locally, this is mine for this device

    [BK7321N] IR smart receiver with CHT8305 sensor with CBU module

    also see here is the working config:

    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Full Device Name Here",
      "model": "enter short model name here",
      "chip": "BK7231N",
      "board": "TODO",
      "flags": "4244484",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "6": "CHT8305_SDA;1",
        "8": "IRSend;0",
        "15": "LED_n;0",
        "17": "WifiLED;0",
        "24": "IRRecv;0",
        "26": "CHT8305_SCK;0",
        "28": "Btn;0"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
  • ADVERTISEMENT
  • #2 20560614
    p.kaczmarek2
    Moderator Smart Home
    It's very nice to see Tuya using a step down converter to get efficient 3.3V source instead of bulky, power-hungry AMS1117-3.3V. Are you able to tell which chip is used there, marked as U1 on the silkscreen?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 20585737
    baidedov5
    Level 4  
    Hi all Thanks for great work and sharing your settings here.
    I'm newbie in electronics and will be more than happy if someone can help
    I've created exactly the same config and sensor reading are Temperature:125.000000C Humidity:100.000000%
    When I short press the button for a sec they are going back to normal for 1 time and then back to :125.000000C Humidity:100.000000%

    
    
    Info:SENSOR:DRV_CHT8304_readEnv: Temperature:125.000000C Humidity:100.000000%
    Info:GEN:28 key_short_press
    Info:MQTT:Channel has changed! Publishing 0 to channel 0 
    Info:MQTT:Publishing val 0 to my_def_int/0/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic my_def_int/0/get
    Debug:MQTT:channelSet topic 4208968 with arg 0
    Info:GEN:CHANNEL_Set channel 1 has changed to 219 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 219 to channel 1 
    Info:MQTT:Publishing val 219 to my_def_int/1/get retain=0
    Info:GEN:CHANNEL_Set channel 0 has changed to 57 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 57 to channel 0 
    Info:MQTT:Publishing val 57 to my_def_int/0/get retain=0
    Info:SENSOR:DRV_CHT8304_readEnv: Temperature:21.976654C Humidity:57.361713%
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic my_def_int/1/get
    Debug:MQTT:channelSet topic 4208968 with arg 219
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic my_def_int/0/get
    Debug:MQTT:channelSet topic 4208968 with arg 57
    Info:GEN:CHANNEL_Set channel 1 has changed to 1250 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1250 to channel 1 
    Info:MQTT:Publishing val 1250 to my_def_int/1/get retain=0
    Info:GEN:CHANNEL_Set channel 0 has changed to 100 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 100 to channel 0 
    Info:MQTT:Publishing val 100 to my_def_int/0/get retain=0
    Info:SENSOR:DRV_CHT8304_readEnv: Temperature:125.000000C Humidity:100.000000%
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic my_def_int/1/get
    Debug:MQTT:channelSet topic 4208968 with arg 1250
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic my_def_int/0/get
    Debug:MQTT:channelSet topic 4208968 with arg 100
    Info:GEN:No change in channel 1 (still set to 1250) - ignoring
    
    Info:GEN:No change in channel 0 (still set to 100) - ignoring
    
    Info:SENSOR:DRV_CHT8304_readEnv: Temperature:125.000000C Humidity:100.000000%
    
  • #5 20585834
    baidedov5
    Level 4  
    Hi,

    I'm referring to the values in the log file taken out of WEB application:
    Temperature: 21.976654C Humidity: 57.361713%
    I might find something. In device config that is different. In my case Flags: 0, but on the picture they are 424484
    Is this some kind of default value that needs to be changed. It's highly possible to be something wrong on my end, since this is my first flash.
  • ADVERTISEMENT
  • #6 20585842
    p.kaczmarek2
    Moderator Smart Home
    Well, we've never focused on adding rounding to Web App log, as it's only for debugging. So basically your feature request is that you want to have rounding on Web App log values?

    Or do you also get non-rounded values on the WWW panel?

    Added after 36 [seconds]:

    EDIT: Flags can be changed in the Configure Flags menu.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 20585855
    baidedov5
    Level 4  
    Hi,

    We are not on the same page here. Rounding is not what I'm looking for. My problem is that sensor readings are wrong
    Temperature:125.000000C Humidity:100.000000%

    When I short press button one single measurement is correct for a fraction of a second
    Temperature:21.976654C Humidity:57.361713%

    and then it shows wrong values again
    Temperature:125.000000C Humidity:100.000000%
  • #8 20585892
    p.kaczmarek2
    Moderator Smart Home
    Now I see. This is very strange. I was sure those are example/test values, but yet you somehow get invalid/stock results.

    Does it work correctly at random or ONLY when pressing button?
    Helpful post? Buy me a coffee.
  • #9 20585909
    baidedov5
    Level 4  
    Hi,

    It is showing correct values only when button is short pressed.
    I have second device like this and I re-flashed it as well - configuration is exactly the same and it is working perfectly fine.
    Could be something fried or shorted on the first device.
    Last thing I need to understand is how to read IR codes.
    Awesome work with this project.
  • #10 20585942
    p.kaczmarek2
    Moderator Smart Home
    I am totally confused right now.

    I understand your description (I was wrong at first, so I cleared some posts) but still confused.

    Okay, let's do one test. Please clear all pins (maybe even reset whole device, if that's not a problem - ClearConfig command), configure it via AP again, and then, set ONLY CH8305 GPIO in the Configure module.
    Remember, set also two channels for CH8305 (two separate channels), and then post a screenshot and check.
    Helpful post? Buy me a coffee.
  • #11 20585985
    baidedov5
    Level 4  
    Hi,

    Thanks for the reset command. I was looking for it. So after config reset same behavior is observed. I even re-uploaded the firmware to the BK7321N chip, however this device is still problematic. Now I'm 99% sure, that hardware of the device is damaged.
    I have 2 more devices exact same IR circuits with CH8305 and I've flashed them just now, reconfigured them the same way, and CH8305 sensors are working perfectly. Thank you for the cooperation here. One last question. How to get IR receive codes. I'm trying in the web application log page and shooting the device with air conditioner remote, but nothing show up.
    Thanks in advance
  • #12 20586013
    p.kaczmarek2
    Moderator Smart Home
    Wait a moment, maybe this is something that can be fixed.

    So, even with clear config, the CHT8305 works only when button is hold?

    What if you use PowerSave 1 in console or use another power supply?
    Helpful post? Buy me a coffee.
  • #13 20586049
    baidedov5
    Level 4  
    Found out what's happening. There was a thin lead wire shortening pin 18 (CEN pin) of the CBU module and the pin next to it.
    After clearing the spot CH8305 is back in operation. Thanks so much for the assistance. Still struggling to understand how to read IR codes.
  • #14 20586314
    p.kaczmarek2
    Moderator Smart Home
    So it was a hardware issue... I am still not sure how a short could create such behavior, but it's good it's solved now.

    Regarding IR codes, not all codes are currently supported. The basic ones like Samsung, etc, Sony, are working fine, but if you need something more advanced, there is a pull request for better IR:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/723
    You can download PR build artifacts (binaries) from Github directly, if you click into the build results in the given pull request.
    Helpful post? Buy me a coffee.
  • #15 20588089
    DeDaMrAz
    Level 22  
    To compliment the CHT driver, a CHT_Cycle command has been added with latest 1.17.119 build - usage:

    //CHT_Cycle (sample time in seconds)
    CHT_Cycle 60

    You can add this in autoexec.bat script and adapt to your needs.

Topic summary

✨ The discussion revolves around the teardown and configuration of an IR smart receiver utilizing the BK7321N chip, CHT8305 temperature sensor, and CBU module. Users share insights on the device's performance, including issues with incorrect temperature and humidity readings, which were initially reported as 125°C and 100% humidity. Troubleshooting steps included resetting configurations and re-flashing firmware, leading to the discovery of a hardware issue caused by a short circuit. The conversation also touches on the ability to read IR codes, with some basic protocols supported and a pull request for enhanced IR functionality mentioned. A new command, CHT_Cycle, was introduced in the latest firmware build to complement the CHT driver.
Generated by the language model.

FAQ

TL;DR: Fix BK7231N + CHT8305 IR receivers showing stuck values, set correct pins, and use CHT_Cycle for a 60 s sample interval—"a CHT_Cycle command has been added." Advanced IR decoding needs the PR build. [Elektroda, DeDaMrAz, post #20588089]

Why it matters: This FAQ helps OpenBK7231N tinkerers fix CHT8305 misreads and enable IR decoding on Tuya IR remotes without the cloud.

Quick Facts

How do I map pins for the BK7231N IR receiver with a CHT8305 sensor?

Use the shared CBU template. Assign: P6 → CHT8305_SDA, P26 → CHT8305_SCK, P8 → IRSend, P24 → IRRecv, P15 → LED_n, P17 → WifiLED, P28 → Btn. This matches the posted working JSON. Export or import the template via the Web App. After saving, confirm two channels appear for temperature and humidity. [Elektroda, DeDaMrAz, post #20560227]

My CHT8305 shows wrong values until I press the button. What hardware issue caused it?

A thin solder whisker shorted CBU pin 18 (CEN) to the adjacent pin. That short forced bad readings. Cleaning the spot restored normal operation. Inspect the module edges under magnification and remove any bridges. After clearing the short, the sensor worked without button presses. [Elektroda, baidedov5, post #20586049]

Why do I see 125.000000b0C and 100% humidity, then one valid sample after a short press?

Logs showed 125.000000b0C and 100% humidity repeatedly, with one normal sample like 21.976654b0C and 57.361713% after a short press. That pattern points to a compromised sensor path or intermittent bus. Check wiring and module pins carefully. If needed, reset the device and re-test only the sensor roles before adding others. [Elektroda, baidedov5, post #20585737]

How do I reset and test only the CHT8305 after flashing?

Try this:
  1. Run ClearConfig in the console, then reconnect through the AP.
  2. In Configure Module, set only CHT8305 GPIO roles and two channels.
  3. Check the Web Log for stable values, then add IR and LEDs. [Elektroda, p.kaczmarek2, post #20585942]

How do I decode and read IR codes in OpenBK7231?

Basic protocols like Samsung and Sony decode in the stock build. For broader coverage and AC remotes, use the IR-improvement build from PR #723. "There is a pull request for better IR." Download the PR’s build artifacts, flash the binary, then watch the Web Log while pressing remote buttons. Ensure IRRecv is assigned on the correct GPIO. [Elektroda, p.kaczmarek2, post #20586314]

Nothing shows when I point my AC remote at the device. How can I capture codes?

Assign the IRRecv role to the IR receiver pin and open the Web Log. If nothing appears, flash the PR #723 build that adds improved IR decoding for complex AC protocols. Many air-con remotes use nonstandard frames that the stock firmware may not parse. Retest after flashing the PR build. [Elektroda, p.kaczmarek2, post #20586314]

What do the Flags do, and where can I change them?

You can change Flags in the Configure Flags menu in the Web UI. Values may differ between devices or templates. Adjust only if your template specifies a value. Decimal-heavy log values relate to debug formatting, not Flags. [Elektroda, p.kaczmarek2, post #20585842]

Why does the Web App log show so many decimal places?

The Web App log is primarily for debugging, so rounding was not added. Expect full-precision floats there. The WWW panel may show cleaner values, but the log remains detailed for diagnostics. [Elektroda, p.kaczmarek2, post #20585842]

Power issues: should I try PowerSave or a different power supply?

Yes. Test PowerSave 1 from the console and try another power supply. These steps help isolate rail stability or noise issues that can affect sensors and peripherals. Use them during troubleshooting to check if behavior improves. [Elektroda, p.kaczmarek2, post #20586013]

What regulator does this board use instead of AMS1117-3.3?

The teardown notes a step-down converter provides the 3.3 V rail. This improves efficiency and reduces bulk versus an AMS1117 LDO. The regulator is marked as U1 on the silkscreen. It’s a better match for Wi‑Fi loads. [Elektroda, p.kaczmarek2, post #20560614]

Can we identify the U1 regulator with marking bPDGG?

A contributor matched it to an MP2128DG-class buck regulator and shared the datasheet link. The exact identification remains unconfirmed due to custom marking. Treat it as a similar device reference until proven. [Elektroda, DeDaMrAz, post #20560630]

How do I set a periodic sample interval for the CHT8305?

Use CHT_Cycle. Example: CHT_Cycle 60 sets a 60-second interval. Add the same line to autoexec.bat to persist after reboots. This complements the CHT driver and lets you tune reporting for your application.
  1. Open Console.
  2. Run CHT_Cycle 60.
  3. Add to autoexec.bat and reboot. [Elektroda, DeDaMrAz, post #20588089]

Was the root cause software or hardware in the reported case?

Hardware. "So it was a hardware issue..." After clearing a short near the CEN pin, readings normalized. The firmware and configuration were fine. This outcome supports checking for physical faults early in troubleshooting. [Elektroda, p.kaczmarek2, post #20586314]

Where can I get and save a working template for this device?

Use the Web App template tools to fetch and store profiles. The shared post includes a ready JSON for this BK7231N + CHT8305 IR controller. Load it, adjust fields, and save locally. This speeds repeat flashes and keeps pin roles consistent. [Elektroda, DeDaMrAz, post #20560227]
Generated by the language model.
ADVERTISEMENT