logo elektroda
logo elektroda
X
logo elektroda

[BK7231N CBU] Generic Temperature and Humidity Sensor

Chasbrot  359 70812 Cool? (+7)
Listen:

TL;DR

  • A generic AliExpress WiFi temperature and humidity sensor based on a BK7231N CBU module was torn down and identified.
  • The teardown includes device pinout notes and references for the BK7231N uC and Sensirion SHT30 sensor, with the specific part marked SHT30 DIAS7M.
  • The WiFi version arrived from de.aliexpress.com in about 2 weeks to Austria.
  • The latest BK7231N image could be flashed via console, but OpenBK7231T still lacks an SHT30 driver, tracked in GitHub issue 574.
AI summary based on the discussion. May contain errors.
Hi! Here is a teardown of a random super generic temperature and humdity sensor from aliexpress.

Bought From:
https://de.aliexpress.com/item/1005004854419532.html
Wifi Version, really quick delivery to austia ~ 2 weeks

Pictures:


Device Pinout:


Datasheets:
uC: https://developer.tuya.com/en/docs/iot/cbu-module-datasheet?id=Ka07pykl5dk4u
SHT30: https://sensirion.com/media/documents/213E6A3B/63A5A569/Datasheet_SHT3x_DIS.pdf
Specific Device ID: SHT30 DIAS7M

Flashing:


I could flash latest BK7231N Image via console.


Config:


Driver for SHT30 is missing but i have created a github issue:
https://github.com/openshwprojects/OpenBK7231T_App/issues/574

About Author
Chasbrot wrote 1 posts with rating 7 . Been with us since 2023 year.

Comments

p.kaczmarek2 01 Jan 2023 13:10

Thank you for posting this. I can see that's a battery powered device. We need to enable power save in order to save battery. First of all, please add "PowerSave" command to short startup command, but... [Read more]

gulson 02 Jan 2023 11:03

Thank you for your publications. I am curious how long the battery will last after changing the firmware and will there be a low battery notification? I wonder if the device can operate on 2 x AAA rechargeable... [Read more]

speedy9 02 Jan 2023 13:48

I have a similar sensor (I don't know if it's the same because I haven't disassembled it). On new good batteries it works 2-3 weeks depending on the temperature. It is worth mentioning that... [Read more]

lionboy 03 Jan 2023 22:27

Hello, anyone figured out how to config this device to show temp , humidity, battery lvl? [Read more]

p.kaczmarek2 04 Jan 2023 00:06

@lionboy if you have the same device type, you should wait for the implementation for two things: - deep sleep (so batteries won't drain fast). Current "powerSave" command will not be enough for that -... [Read more]

lionboy 04 Jan 2023 09:44

I have the same sensor, i wll wait until fix the problem, is flashed but no problem, i saw from last night until now battery is empty :D [Read more]

p.kaczmarek2 04 Jan 2023 10:36

Our team member and contributor, @btsimonh , has received a battery-powered PIR sensor (CBU module) few days ago with no MCU. He will be most likely looking into supporting that as well. [Read more]

btsimonh 05 Jan 2023 09:35

Mine is 3 x AAA powered, 'N' based (CBU). I bought it 2nd hand on ebay, just so I had one :). But no manual or mountings. Looking at a manual online for a similar device, they claim 5 months on 3 x... [Read more]

nelliug54 06 Jan 2023 21:38

Hi everibody, I'm new on the forum, I have some experience in "brain changes" to convert tuya devices to local control with Tasmota. At this moment I'm focussed in fotovoltaic generation and home energy... [Read more]

p.kaczmarek2 06 Jan 2023 22:58

There is no datasheet, just our own research. But we have that: https://obrazki.elektroda.pl/8109819400_1673043809_thumb.jpg And that datasheet (but it's not BK7231 chip datasheet, but for module): https://www.elektroda.pl/rtvforum/download.php?id=1133903 How... [Read more]

dheenhasty 14 Jan 2023 15:57

Hello, new on this forum. i have publish a merge request to add the sht3X support. it works but measurement is not ideal even if i have taken the constructor reference for the sht3X. i support that... [Read more]

p.kaczmarek2 14 Jan 2023 16:55

Hello, very good job. I will llook into your code, but have you considered using PowerSave command to reduce current consumption and lower heating? [Read more]

dheenhasty 14 Jan 2023 17:07

Yes it's activated at the init of the script. And i activate tuyamcu who suppose to deactivate wifi when not needed. For the moment the battery voltage is pretty stable. i have tested the measure... [Read more]

p.kaczmarek2 14 Jan 2023 18:42

But that would be a per-device calibration? [Read more]

dheenhasty 14 Jan 2023 19:16

I don't know it's a supposition .... maybe a missread the documentation and you have some sort of calibration that can be done at init ..... So batterie Died in 6h with a 10 min refresh. Will try... [Read more]

p.kaczmarek2 15 Jan 2023 08:51

@btsimonh , any progress with deep sleep? There is an API for deep sleep in the Beken SDK but I am not sure if I should point you towards it, @dheenhasty . If you enable deep sleep, then you might end... [Read more]

dheenhasty 15 Jan 2023 15:56

I have try to compile for the 8371N, but seems like the SDK is broken for the powe_save once i activate the manual power saving flag: beken378/func/power_save/manual_ps.c:190:20: error: 'SCTRL_LOW_PWR_CLK'... [Read more]

p.kaczmarek2 15 Jan 2023 16:22

I have tested it only for BK7231T. Here is the only change needed to compile: https://obrazki.elektroda.pl/2617583000_1673796073_thumb.jpg If you are compiling for N, and for example SCTRL_LOW_PWR_CLK... [Read more]

nelliug54 16 Jan 2023 10:28

@dheenhasty Very good job Here is the shematic. https://obrazki.elektroda.pl/9879827700_1673859980_thumb.jpg I think a new massurement could be taken, that is battery voltage. Just putting... [Read more]

FAQ

TL;DR: Stock firmware can empty two AAA cells in just 6 h at a 10-min refresh rate [Elektroda, dheenhasty, post #20385425] “SHT30 seems very simple to support” [Elektroda, p.kaczmarek2, post #20362193] Use DeepSleep + PowerSave to cut current by >90 %.

Why it matters: Proper scripting turns a one-week gadget into a months-long sensor.

Quick Facts

• MCU: Beken BK7231N CBU module, 3.3 V core, Wi-Fi b/g/n [Elektroda, p.kaczmarek2, post #20362193] • Temp/Humidity chips: SHT30 or CHT8310/8315, I²C @ 100 kHz [Sensirion, 2023] • Battery range: 2.0 – 3.0 V (two AAA) [Elektroda, user_param_key dump] • DeepSleep current: ≈ 6 µA; active Wi-Fi current: ≈ 70 mA [Elektroda, dheenhasty, post #20393117] • Typical script wake-time: 8–12 s, 15-min cycle ⇒ ~1 % duty-cycle power use.

How do I wire the UART for flashing?

Solder TX2 to the test pad marked TP2, RX2 to TP1 (labels on some boards are reversed), plus 3.3 V and GND. Pull CEN low during power-up to enter boot mode, then use BK7231 Flasher at 921 600 baud [Elektroda, sirhcsat, post #20905587]

My sensor shows −49 °C and 3 % RH. What’s wrong?

Those values appear when the I²C pins or driver don’t match the chip. Select CHT8305 roles if your board carries CHT8310/8315 instead of SHT30 [Elektroda, sirhcsat, post #20905846]

Why does the device sometimes brick after a flat battery?

Dropping below 2 V can corrupt the RF/flash area; the module then boots with constant 2 mA draw and no AP [Elektroda, Xinayder, post #20886949] Re-flash RF partition or do a full "Erase All" to recover.

How can I stop endless waiting for MQTT when broker is offline?

Add a guard timer: addRepeatingEventID 30 1 999 DeepSleep 900 before waitFor MQTTState 1; if MQTT is still down after 30 s the sensor sleeps for 15 min [Elektroda, erdeidominik1999, post #20792052]

What script gives longest battery life?

1 ) enable PowerSave. 2 ) measure once, publish, sleep:
startDriver SHT3XwaitFor MQTTState 1SHT_MeasurepublishChannelsDeepSleep 900. 3 ) Use flag 37 for quick Wi-Fi connect. Users report >30 days on AAA with a 15-min cycle [Elektroda, dheenhasty, post #20456982]

Edge case: device stays awake 60 s instead of 10 s

mqtt_broadcastInterval left at 1 s sends five retained topics, stretching awake time. Set it to 60 s or disable extra broadcasts to avoid triple publishes [Elektroda, Xinayder, post #20882846]

Can I combine a door switch and temperature on one PCB?

Yes. Add an SHT30 to the unused P7/P8 lines of the door-sensor board. Door events will wake the MCU, publish temp/RH, then DeepSleep. Expect one extra MQTT burst per open/close [Elektroda, p.kaczmarek2, post #20906906]

How do I calibrate the SHT30?

Run SHT_Calibrate <TempOffset> <RHOffset> once in autoexec, e.g. SHT_Calibrate -2.4 3 lowers reported temperature by 2.4 °C and raises humidity by 3 % RH [Elektroda, dheenhasty, post #20458926]

Quick 3-step UART flashing?

  1. Hold CEN low, power the board at 3.3 V. 2. Use BK7231 Flasher, select BK7231N, click Erase All then Write OpenBK. 3. Release CEN and reboot; connect to the OBK_XXXX AP.

How to round sensor output to two decimals?

Set channel type to temperature_div10 for 0.1 °C granularity or divide in publish: publishFloat temp $CH2/10. OBK trims trailing zeros from JSON [Elektroda, p.kaczmarek2, post #20458933]

What’s the failure threshold for Safe-Mode?

Five boots shorter than 5 s mark firmware as unstable and skip autoexec.bat, letting you reconfigure via AP without UART [Elektroda, p.kaczmarek2, post #21014538]
AI summary based on the discussion. May contain errors.
%}