Using ultrasonic sensors for occupancy detection

Hello, I live in an apartmant flat. I have only one main enterance. And to all rooms, there is only one enterance. I want to make a counter for every room and a counter for the main enterance. It should be possible doing this by using two ultrasonic sensors (two will be needed to understand the direction. Are you leaving the room? Or entering?)

Then, let’s imagine there is an excel sheet.

As a person goes in to the flat, the maindoor counter will count +1 in enterance of the flat. The system will add 1 to enterance. From enterance I can go to living room, closet room, toilet, kitchen or corridor. As I enter any of these, from excel sheet, 1 will be deducted from enterance, and 1 will be added to anywhere I go in. Let’s say from corridor, I entered to bedroom #1. 1 will be deducted from corridor and added to bedroom #1. By this, I will be actually mapping and monitoring the occupancy in all of my apartmant flat. Occording to this data I can automise lights.

In my mind, there should be some kind of a datasheet approach, because of the corridor.

Using radar occupancy sensors Like LD2410 can be an easier approach; but my living room, main bedroom is big and corridor is long. In this three regions, I would need to use multiple LG2410 modules. Also, I would need to purchase LD2410 from China. They are new. They can’t be found in my country. Without testing, I would need to buy around 14 of them. And they are not that cheap.

How can I do this? Do you have any opinion?

I don’t know how reliable we could do it with hobbyist skills. Another way to do it could be with low resolution infrared cameras like the AMG8833 mounted on the ceiling near the doors facing down and some image processing to detect persons as individual blobs count them and detect their movement direction. Not easy and not cheap…

MFM

Thank you for your response. I changed my approach for now. I bought 8 LD2410 radar sensor from China. I am thinkering with them right now. These little devices can be programmed beforehand and without a processor need, they trigger one of their connectors when sense a presence. They sense both movement and presence (They are active radars). So if it works, programming need for these will be very little.

If they don’t work, I will sell them in my country. If they do work, I will buy 7 more. For my entire house, I will be needing around 15 of them.