logo elektroda
logo elektroda
X
logo elektroda

Flashing ONENUO Tuya Wifi Door Sensor BK7231N CBU-NL with Tasmota Replacement

spln 
Module name: ONENUO Tuya Wifi Door Sensor - 19JWT
Protocol: WiFi 2,4GHz
Power: 3V (2x AAA battery)
Wifi module: Tuya CBU-NL (BK7231N) datasheet

This is the door sensor version of the module, but based on the PCB layout they also build other sensors with the same panel.
Bought it on aliexpress for $3.69 on sale: Link
Another sensor with seemingly the same PCB was discussed here, but this one has a different pin configuration. Probably a new PCB revision, however no labeling about it.

Flashed latest release with python flasher: hid_download_py
Code: Bash
Log in, to see the code


Pictures of the module:
Packaging of the Tuya Wi-Fi door and window sensor. Packaging of Tuya Wifi Door Sensor with SKU code and manufacturer information. Tuya Wi-Fi door sensor set with packaging and user manual.


Tear-down pictures:

ONENUO WiFi door sensor module with disassembled casing ONENUO Tuya door sensor module with visible PCB layout and Wi-Fi module CBU-NL.

Pin config:
Surprisingly the push button is connected to both P14 and P16, but with different pull-ups. This might be used for some kind of debouncing or?

P15: WifiLED_n (Bat+ > R8 10k > LED1 > R3 1k > P15)
P14: BTN_n (Bat+ > R8 10k > P14)
P16: BTN_n (Bat+ > R8 10k > P14 > R9 10k > P16)
P20: BAT_rel (R1 10k - R2 10k voltage divider switched with Q3 through R4 4k7)
P22: DoorSnsrWSleep (Q3 sensor directly connected)
P23: BAT_adc (Bat+ > R1 10k > ADC > R2 10k > GND)

Original firmware:


JSON config:
Code: JSON
Log in, to see the code

About Author
spln wrote 7 posts with rating 9 , helped 1 times. Been with us since 2023 year.

Comments

hojnikb 23 Feb 2024 16:57

Hi! Is there a deepsleep enabled in this profile? And when does it sleep; when the magnet is present or absent? Thank you! [Read more]

p.kaczmarek2 24 Feb 2024 08:59

The pin role called DoorSnsrWSleep is automatically starting DoorSensor driver on every reboot. There is no script required because all is done in the firmware. The DoorSensor driver handles the... [Read more]

%}