[BK7231N] [CBU] Tuya Light + PIR Motion Sensor (FH_PIR_400A)
Hello,
I would like to present teardown and my user experience of this module:
Tuya Light + PIR Motion Sensor (FH_PIR_400A) --> AliExpress-Link
First, some photos of package and content:
Pry to open carefully under reset button, then insert some flat tool to separate the two halves of housing by stretching the gap:
Now have a look at parts and module:
We have a very similar module in this post: https://www.elektroda.com/rtvforum/topic3982613.html
But here we have a CBU module and an additional light sensor which can measure light intensity by Lux at a range between 0 ~ 6500, give or take:
A few things about device and flashing:
- it is not a TuyaMCU device
- there is no need to cut connections or desolder CBU module
- flashing works flawlessly with bk7231flasher Windows tool
- the device can be powered with 2xAAA batteries, which makes sense with deep sleep driver (Door Sensor function)
- it can also be powered with 5V via MicroUSB
- the reaction time until Wifi is connected and status reported with OpenBK deep sleep is about ~5 seconds
- without deep sleep the Wifi connection is kept stable and it reacts instantly on motion
- After detecting motion, it changes to "Clear" within ~5 seconds when no further motion is detected
--> edit: I have bought several of those devices, and actually only the first one I bought has this fast clearing of motion interval, all the others take 30 seconds to change the status to "Clear" when no further motion is detected.
I was able to assign following functions to pins:
P8: motion detector --> dInput(_n) / DoorSnsrWSleep (whichever suits better)
P16: LED --> LED(_n) / WifiLED
P23: Battery --> BAT_ADC (choose different channel here)
P24: Reset Button --> btn
bkflasher was unable to extract information from original firmware read.
Here is the file:
Home Assistant discovery works on the spot:
Unfortunately, I was unable to get the light sensor working. I tried GPIO doctor with all the pins dInput with and without pullup, no success. Any contribution to make the light sensor work would be appreciated.
Cheers!
I would like to present teardown and my user experience of this module:
Tuya Light + PIR Motion Sensor (FH_PIR_400A) --> AliExpress-Link
First, some photos of package and content:




Pry to open carefully under reset button, then insert some flat tool to separate the two halves of housing by stretching the gap:

Now have a look at parts and module:





We have a very similar module in this post: https://www.elektroda.com/rtvforum/topic3982613.html
But here we have a CBU module and an additional light sensor which can measure light intensity by Lux at a range between 0 ~ 6500, give or take:

A few things about device and flashing:
- it is not a TuyaMCU device
- there is no need to cut connections or desolder CBU module
- flashing works flawlessly with bk7231flasher Windows tool
- the device can be powered with 2xAAA batteries, which makes sense with deep sleep driver (Door Sensor function)
- it can also be powered with 5V via MicroUSB
- the reaction time until Wifi is connected and status reported with OpenBK deep sleep is about ~5 seconds
- without deep sleep the Wifi connection is kept stable and it reacts instantly on motion
- After detecting motion, it changes to "Clear" within ~5 seconds when no further motion is detected
--> edit: I have bought several of those devices, and actually only the first one I bought has this fast clearing of motion interval, all the others take 30 seconds to change the status to "Clear" when no further motion is detected.
I was able to assign following functions to pins:
P8: motion detector --> dInput(_n) / DoorSnsrWSleep (whichever suits better)
P16: LED --> LED(_n) / WifiLED
P23: Battery --> BAT_ADC (choose different channel here)
P24: Reset Button --> btn
bkflasher was unable to extract information from original firmware read.
Here is the file:
Home Assistant discovery works on the spot:

Unfortunately, I was unable to get the light sensor working. I tried GPIO doctor with all the pins dInput with and without pullup, no success. Any contribution to make the light sensor work would be appreciated.
Cheers!
Comments
So U4 is a light sensor? Are you able to check with multimeter to which GPIO it connects to? It looks like it might have two data lines, is it possible it's something like a I2C sensor? [Read more]
Hi, thanks for your reply! I was able to trace back the connections, there are 3 connections directly to CBU pins! That is very interesting!! Let's have a look: https://obrazki.elektroda.pl/2899859700_1694047439_thumb.jpg... [Read more]
Maybe we can search for I2C light sensors online and see if there are any similar to the one you have on the board. [Read more]
Hi, i have ordered this PiR Sensor : https://obrazki.elektroda.pl/2703368100_1694092230_thumb.jpg Inside it contain LED, BUTTON, PiR sensor, Battery monitor and Light sensor (U4 on the board): ... [Read more]
Hi, on the stock firmware Do you only get light sensor updates when there's motion detected? [Read more]
Hi, I had a look at mouser to see if I can find any. It seems not a very easy task, there are many different kinds which look similar, and it is hard do tell what is the difference as a non-professional.... [Read more]
Hi, On the stock firmware, the module stays in deep sleep mode. The motion or interrupt from a huge light source (flashlight from a mobile), and it updates 3 things: - motion - light (lumens) - battery... [Read more]
Oh, awesome! As I see, you have done the job of analyzing this light sensor? Yes, combining this topic would be the best. So, with your data, maybe the developers can try to make it work in OpenBK! [Read more]
Per footprint, it seems LTR-303-ALS-01. Others don't fit the footprint/pinout. [Read more]
It seems that I2C address is 38: https://obrazki.elektroda.pl/7653540400_1694104449_thumb.jpg I've read on the other thread that it may be LTR303, but it doesn't seem to match: https://github.com/automote/LTR303/blob/master/LTR303.h Also... [Read more]
Yes, the slave address doesn't match. But pinout exactly fits. I also looked for all LiteOn sensors and cannot find 0x38. Maybe something is wrong with my analyzer, it's a simple $5 board. I have a Keysight... [Read more]
The scan function you've found was for the hardware I2C bus. Apparently the hardware bus is not used often and our drivers are implemented now as bit-bang in software. Still, if you think that could helpful,... [Read more]
I think it will be great. Take pins marked as SoftSDA and SoftSCL (or some other type, just for scanning) and scan full addresses. It will be great for someone (like me) who wants to add some sensors... [Read more]
Wow! This is a really cool idea, to add weather sensors and extend the function of this sensor board. Could you share your project here in this thread and explain how you do it? I would be interested to... [Read more]
I2C scanner works: https://obrazki.elektroda.pl/5040169800_1695124136_bigthumb.jpg Usage: 1. set SoftSDA and SoftSCL pins 2. use: startDriver I2C scanI2C Soft [Read more]
Hi, thanks! I tried with setting P6 to SoftSCL and P7 to SoftSDA, as @dgel27 suggested thad I2C communication is handled through those. Then I set the driver via autoexec.bat and restarted. Now I use... [Read more]
No, it doesn't work that way. It's just I2C scanner, it will print addresses of I2C devices detected on the bus. It's not a complete device driver. Execute: scanI2C Soft from the Web App console... [Read more]
OK, I understand. I get Info:CMD:[WebApp Cmd 'scanI2C Soft' Result] OK but I don't get I2C result! Do I need to specify different channels for the data/clock buses? I tried both with channel 0 and... [Read more]
Channels will not affect behaviour of the scan. Maybe you've swapped SDA with SCL? It should detect a single device address, hm... Or maybe you haven't updated OBK? [Read more]