logo elektroda
logo elektroda
X
logo elektroda

On-PCB BK7231N TH01 Battery Temp/Humidity Sensor with SHT30 Sensor - Another Variant

divadiow 4056 15
ADVERTISEMENT
  • #1 21110006
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    Hi

    I won't go mad with detail because it's just another TH01 type battery temperature/humidity sensor that other threads can be consulted on for more intimate detail on this kind of device. Posting so this can be another +1 for the device list.

    This one appears to vary in that it has no module. The BK7231N is soldered directly to the PCB and is accompanied by an SHT30 temperature and humidity sensor.

    TH01 temperature and humidity sensor with attached test wires on a wooden table next to the casing. TH01 temperature and humidity sensor with connected wires on a wooden floor background. User manual brochure for a temperature and humidity sensor. Sensor box with a label containing barcodes and compatibility icons. Wi-Fi temperature and humidity sensor kit, user manual, and reset tool. Close-up of a printed circuit board with a BK7231N chip and other electronic components. Close-up of a PCB with a BK7231N chip. Close-up of a circuit board with a soldered integrated circuit and components. Circuit board with mounted integrated circuit and electronic components.

    The test pads are

    Printed circuit board of a temperature and humidity sensor with BK7231N chip.

    The two unlabelled in the middle are two of these 4 I believe

    Diagram of connections with labeled pins on a circuit board.

    which means there is no readily available UART2_TXD for the output log. The underside of the PCB is plain but for a ground pad.

    Dump attached. Firmware version 1.1.17, which looks to be cloudcuttable. Extracted pin assignments:

    Code: Text
    Log in, to see the code


    and the user params

    Code: JSON
    Log in, to see the code


    The presence of "net_led_pin":"26" in the json but not in the plain text assignment list means Easy Flasher forgot to include P26 for the WifiLED.

    It's good to see the new additions showing

    Code: Text
    Log in, to see the code


    which means we assign the SHT:
    Screenshot of the pin configuration interface for P7 and P8 with SHT3X assignments.

    The alert pin is not yet usable.

    basic autoexec to config battery:

    Code: Text
    Log in, to see the code


    P20 button swapped for DoorSnsrWSleep so the button can wake the device from deep sleep.

    Data table for DoorSensorWithDeepSleep driver.

    Code: JSON
    Log in, to see the code
    Attachments:
    • readResult_BK7231N_QIO_2024-06-6-19-22-03.bin (2 MB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • #3 21110323
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14620
    Help: 655
    Rate: 12635
    That's a nice discovery, I haven't seen any such sensor (door/humidity/water) with BK7231 directly on PCB. Is that yet another method used to reduce costs by Tuya?
    Helpful post? Buy me a coffee.
  • #4 21111898
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    A reasonable assumption
  • ADVERTISEMENT
  • #5 21516997
    fernandorpeixeiro
    Level 4  
    Posts: 4
    Hi and congratulations for your excellent work.

    I've a problem with a sensor, it's like the one posted in the first message.
    It doesn't show temperature nor humidity.
    I've flashed it with openbeken, last version. It shows battery percentage, although I'm feeding it with a lm1117.

    In the log is showing a clear message that states: "Info:MAIN:Driver SHT3X is not known in this build."

    Is there a way to test if sht30 isn't damaged? I'm not using this sensor for a few months, without batteries.

    This is the startup command:
    addEventHandler OnClick 20 startScript this runmeas 456

    init:
    echo "Init driver and powersave "
    startDriver TuyaMCU
    setChannelType 3 toggle
    setChannelType 1 temperature_div10
    setChannelType 2 humidity

    again:
    echo "activate SHT3X Sensor"
    startDriver SHT3X
    setChannel 3 1
    echo "Send some measure"
    delay_s 2
    echo "stop SHT3X driver"
    stopDriver SHT3X
    setChannel 3 0
    echo "wait 10min"
    delay_s 10
    goto again

    runmeas:
    // stopScript ID bExcludeSelf
    // this will stop all other instances
    stopScript 456 1
    echo "Force measurement"
    startDriver SHT3X
    setChannel 3 1
    delay_s 2
    stopDriver SHT3X
    setChannel 3 0
    echo "go back to loop"
    goto again;

    For now I'm only interested in having temp and humidity values, because probably the sensor will be permanently energized, so don't mind about power save modes.

    Thanks for any help.
    Fernando

    Screenshot of system logs, showing channel changes, MQTT connections, and errors related to unknown SHT3X driver.

    Screenshot of the OpenBekenX user interface showing device status information.

    GPIO interface configuration showing a list of pins and their functions.
  • #6 21517270
    max4elektroda
    Level 24  
    Posts: 755
    Help: 48
    Rate: 187
    SHT3X driver is not enabled in the firmware by default.
    If you have a git account, you can download a version with this driver in the artifacts of
    PR #1601.
  • ADVERTISEMENT
  • #7 21517587
    fernandorpeixeiro
    Level 4  
    Posts: 4
    >>21517270
    Good morning
    Thanks max4elektroda, you nailed it.
  • #8 21614248
    fernandorpeixeiro
    Level 4  
    Posts: 4
    Hi,
    Today I was trying to connect other Tuya sensor to my Home Assistant setup, and I saw that there was an upgrade. As soon as the upgrade started to roll, the sensor, I have the one above, stopped publishing temperature and humidity.
    On the log was the same that I posted on 5#, I tried to roll back to version "OpenBK7231N_1.18.118.rbl", no luck.
    Can someone get me the ota file with sht3x driver, or explain what am I doing wrong?

    Thanks.
  • #9 21614257
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14620
    Help: 655
    Rate: 12635
    I think that Releases section has _sensors build version of OpenBeken available for download. https://github.com/openshwprojects/OpenBK7231T_App
    Helpful post? Buy me a coffee.
  • #10 21615280
    fernandorpeixeiro
    Level 4  
    Posts: 4
    >>21614257
    Thanks p.kaczmarek2, by the way, why so many versions? Couldn't they all fit in one single release?
  • #11 21743694
    jacgerri
    Level 4  
    Posts: 4
    Help: 1
    Rate: 1
    Hi,

    I've the same TH01 as posted in the first message but it doesn't show temperature or humidity.
    Running on Built on Oct 26 2025 04:10:36, version 1.18.206.
    In the log nothing is mentioned about missing driver. I've added in autoexec.bat: startDriver SHT3X

    BK7231T microcontroller pin configuration with functions and values mapped

    But only one driver is loaded

    Screenshot of OpenBK7231N interface showing system status and control buttons

    I took a good look at the sensor and it's an 8-pin GTH30 (https://www.lcsc.com/datasheet/C3010791.pdf) instead of a SHT30, but don't know if I need another driver. All the pins are connected as earlier mentioned (GHT30 pin1 SDA to PWM2/P8 pin 24, and GHT30 pin4 SCL to PWM1/P7 pin 23)


    Close-up of a GTH30 sensor on a green PCB with visible traces and electronic components.


    I've tried it on two others with the same result. I'm curious if one of you faced the same issue and if you have a solution.
    Thanks
  • Helpful post
    #12 21743731
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    SHT30 driver is available in the Sensors release of OpenBeken

    https://github.com/divadiow/OpenBK7231T_App/blob/main/src/obk_config.h#L340

    List of OpenBK7231N binary firmware files with configuration variants

    Not heard of GHT30 before.

    You could swap SHT3X assignment now for SoftSDA and SoftSCL, run startdriver i2c then try scani2c soft command

    do you get an i2c address back like

    Code: Text
    Log in, to see the code


    it looks like SHT3X driver expects 0x44
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/driver/drv_sht3x.c#L16
  • ADVERTISEMENT
  • #13 21743974
    jacgerri
    Level 4  
    Posts: 4
    Help: 1
    Rate: 1
    Yes, brilliant. It cost me days, but this is the solution! Thanks.

    startdriver i2c gave me the feedback that it was loaded; startDriver SHT3X gave me this:

    Driver list in the OpenBK7231N command tool console interface

    So I've flashed the release which you mentioned and I've finally the sensor output.

    IoT device status panel with temperature, humidity, and battery level data

    Thanks again.
  • #14 21743978
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    interesting. Good to know this GHT30 is compatible.
  • #15 21745073
    divadiow
    Level 38  
    Posts: 5062
    Help: 438
    Rate: 893
    Please post config template json from web app and I'll add to device list. Any other pics or keywords from PCB, make, model etc unique to your variant, welcome. 😊
  • Helpful post
    #16 21749525
    jacgerri
    Level 4  
    Posts: 4
    Help: 1
    Rate: 1
    Sure. My board looks exactly like the first post but with a GHT30.


    White sensor with thermometer and droplet icon on wooden surface
    Green PCB with electronic SMD components on wooden surface
    GHT30 sensor and several SMD components on a green PCB


    After flashing with OpenBK7231N_X.X.X_sensors.rbl, my config template:
    Code: YAML
    Log in, to see the code

Topic summary

✨ A new variant of the TH01 battery temperature/humidity sensor was presented, featuring the BK7231N chip soldered directly onto the PCB alongside an SHT30 temperature and humidity sensor, differing from previous versions that used a CBU module. The pin assignment matches earlier devices, with some discussion on the alert pin configuration. This design may represent a cost-reduction approach by Tuya. A user reported issues with temperature and humidity readings after flashing the sensor with OpenBeken firmware, noting the log message "Driver SHT3X is not known in this build," indicating the SHT3X driver is not enabled by default. The solution involves using a firmware build that includes the SHT3X driver, available in the artifacts of pull request #1601 on the OpenBeken GitHub repository.
Generated by the language model.

FAQ

TL;DR: Fix TH01 sensors that show no temp/humidity by using the OpenBeken Sensors build; SHT3X expects I2C 0x44, some boards respond at 0x38. "SHT30 driver is available in the Sensors release." [Elektroda, divadiow, post #21743731]

Why it matters: This FAQ helps tinkerers quickly restore temperature/humidity readings on BK7231N-based TH01 boards and avoid dead ends.

Quick Facts

How do I fix a TH01 that shows no temperature or humidity after flashing?

Install an OpenBeken Sensors build, then startDriver SHT3X. If still blank, scan I2C and confirm the sensor responds (0x44 or 0x38). Users reported success after switching to the Sensors build and enabling SHT3X. "SHT30 driver is available in the Sensors release." [Elektroda, divadiow, post #21743731]

What does the log message "Driver SHT3X is not known in this build" mean?

Your firmware lacks the SHT3X driver. Flash a build that includes it. Grab artifacts that ship with SHT3X, or use a Sensors release image, then reboot and load the driver. This resolved missing readings for affected users. [Elektroda, max4elektroda, post #21517270]

Which OpenBeken file should I flash for SHT30/GHT30 sensors?

Use the OpenBeken Sensors build (e.g., OpenBK7231N_x.x.x_sensors.rbl). It enables sensor drivers like SHT3X. After flashing, assign SCL=P7 and SDA=P8, then run startDriver SHT3X. Users confirmed readings after this change. [Elektroda, jacgerri, post #21743974]

Is the GHT30 drop-in compatible with SHT30 on these boards?

Yes. Community testing showed GHT30 worked when using the Sensors build with the SHT3X driver. One user got stable readings after switching firmware and enabling the driver. "Good to know this GHT30 is compatible." [Elektroda, divadiow, post #21743978]

How do I scan the I2C bus to find my sensor address?

Assign SoftSDA to P8 and SoftSCL to P7, startdriver i2c, then run scani2c soft. Expect 0x44 for SHT3X, but some boards return 0x38. Use that clue to confirm wiring and driver. [Elektroda, divadiow, post #21743731]

What are the typical pin assignments for this TH01 PCB?

I2C SCL=P7, SDA=P8; BAT_ADC=P23; BAT_Relay=P17; Button=P20; Wi‑Fi LED=P26. ALT on P16 is present, and UART2_TXD isn’t easily exposed. These match the posted dump and photos. [Elektroda, divadiow, post #21110006]

Why does the device still show a battery percentage when powered from a regulator?

The firmware samples BAT_ADC on P23 and computes a percentage from configured min/max voltage. If you feed regulated power, the ADC can still report a computed ā€œbatteryā€ value. This is expected behavior from the posted configs. [Elektroda, fernandorpeixeiro, post #21516997]

How do I configure battery measurement and save power on AAA cells?

Add an autoexec snippet: powersave 1; Battery_Setup 2200 3000 2.10 2400 4096. This enables power-saving and sets voltage thresholds for 2ƗAAA use. It mirrors the working example from the teardown. [Elektroda, divadiow, post #21110006]

Can the front button wake the board from deep sleep?

Yes. Assign P20 to DoorSnsrWSleep in the template. This lets the button wake the MCU from deep sleep states while preserving low power consumption between samples. [Elektroda, divadiow, post #21110006]

What is OpenBeken?

OpenBeken is an open-source firmware for BK7231-based IoT devices. It replaces Tuya firmware, giving local control, sensor drivers, and templates. Sensor-inclusive releases provide SHT3X, which is needed for these TH01 variants. [Elektroda, p.kaczmarek2, post #21614257]

What is Tuya in this context?

Tuya is an IoT platform used by many low-cost sensors. These TH01 units ship as Tuya devices and can be flashed to OpenBeken. The dump shows Tuya config with pins and battery parameters. [Elektroda, divadiow, post #21110006]

Why are there multiple OpenBeken release variants instead of one build?

Builds differ by included drivers and footprint. The Sensors build bundles sensor drivers like SHT3X to fit space and needs. Use the Sensors variant for TH01 temperature/humidity boards. [Elektroda, p.kaczmarek2, post #21614257]

How do I wire or verify the SHT30/GHT30 connections on the PCB?

Check that SDA goes to P8 and SCL to P7. The shared photos confirm these routes. If readings fail, scan I2C and confirm an address (0x44 typical; 0x38 observed). [Elektroda, jacgerri, post #21743694]

Is UART2_TXD available for serial logs on this variant?

No easy UART2_TXD pad exists. The board exposes test pads, but the underside is bare except ground. Use Wi‑Fi logs, web console, or I2C scan for diagnostics. [Elektroda, divadiow, post #21110006]

I updated firmware and lost readings again. What should I do?

Reflash a Sensors build that includes SHT3X, then startDriver SHT3X. Some updates use a non-sensors image, which drops the driver and stops readings. Return to Sensors build to restore. [Elektroda, fernandorpeixeiro, post #21614248]

Quick start: how do I get measurements after flashing?

  1. Flash OpenBK7231N_x.x.x_sensors.rbl and reboot.
  2. Map SCL=P7, SDA=P8; save.
  3. Run startDriver SHT3X; confirm channels update. Users reported success with this flow. [Elektroda, jacgerri, post #21743974]
Generated by the language model.
ADVERTISEMENT