Low-latency presence sensor: mmWave + PIR using ESPHome

Works excellent. Has completely eliminated any lag in lights triggering and standing-still presence is a strength of the DFRobot sensor.

I did end up trying an EMKC and found it fractionally faster than the EMKB series. As a wired device the added power consumption isn’t a concern.

No pics, it’s full production-mode deployment and the case requires wall removal to disassemble.

It’s placed in a wall near the ceiling? Can you show some photos of the placements?

This works independently from the HA, right? If HA fail the device with ESPHOME will still works?

I was thinking, for an hallway case maybe just a PIR will do the job, because it’s rare to stand still.

Another thing, a vaccum robot moving around the house will also trigger the lights. Will be a good ideia to add some logic to not trigger the lights when we are not at home and the vaccum robot is working.

I do the same. Just a PIR in hallways.

Seems easy enough to achieve. Or just don’t point it at the floor :wink: Have cats, avoid ceiling placement.

Remind me next week and I’ll get an exterior photo.

Yes, it continues to work independently of HA; eg, have tested when HA is rebooting…

1 Like

The latest mmWave project has been posted…

2 Likes

Hi. Have you had the chance to take some photo? :slight_smile:

Right!

3 Likes

I got a few Panasonic 6ua PIRs in and want to make sure I understand the pinout, as they are not marked.

If it is oriented with the bottom pin down, the left would be ground, and the right 3.3v, right?

I tried hooking it up like that with the bottom pin to GPIO15, and it causes my ESP32 to act oddly. It turns off its LED and causes it to go offline

Recommend referring to the datasheet for the specific model you purchased.

Eg. https://api.pim.na.industrial.panasonic.com/file_stream/main/fileversion/235518
image

The pinout is orientation specific. And depending on how you plan to connect to it, be careful you do not ground-out the Vdd on the PIR.

I should have mentioned I had gone through the datasheet, I just wanted to confirm I was reading it properly. Ends up it was a dud, the other two work fine. Thanks!

This thing is impressive. After two days of tuning the DFrobot, the PIR is out of the box holding presence better than the radar.

There are three settings on the DFRobot that impact presence detection; distance, sensitivity and latency.

What on earth have you been testing in two days to get to the point of a PIR being better!? :crazy_face:

I have three of these PIR’s, they all turn off if you just “stand still right in front of them”.

Something sounds very off based on that statement.

More information on your tuning methodology would be needed to justify the statement that a PIR outperforms a mmwave in static presence including;

  • diagram of mmwave sensor placement and target zone
  • orientation of mmwave sensor
  • distance, sensitivity, latency parameters configured
  • size of target
  • type of target motion used for test
  • angle of target in relation to mmwave sensor perpendicular centerline
  • target_distance/SNR report of just before the mmwave reports no presence in the scenario in question

Actually, there seems to be something off about the location I have the PIR, it never clears there. Is there a way to adjust sensitivity on the PIR itself? I think it is picking up heat from the TV (which is in front of the couch)

To your questions…

  • diagram of mmwave sensor placement and target zone
    (attached)
  • orientation of mmwave sensor
    I have tried antenna lines horizontal, and vertical but I get confusing results. Sometimes it seems like
    vertical antenna lines is giving me horizontal FOV
  • distance, sensitivity, latency parameters configured
    9/9/5
  • size of target
    6’ 185lb
  • type of target motion used for test
    Sitting at desk
  • angle of target in relation to mmwave sensor perpendicular centerline
    45 degree
  • target_distance/SNR report of just before the mmwave reports no presence in the scenario in question
    6.5m/1.8snr

In the attached Position A about 7 feet up seems to be the most reliable. One issue with the room is there is a ceiling fan above the couch which creates some placement limitations. I believe the air from the fan can also cause small movements with some fuzzy pillow and the like.

Currently it is setup in Pos. A with antenna lines going horizontally.

Actually, there seems to be something off about the location I have the PIR, it never clears there. Is there a way to adjust sensitivity on the PIR itself? I think it is picking up heat from the TV (which is in front of the couch)

Scratch that… it seems to be an issue with the USB PSU I was using on that wall to power it. Very strange

Thanks for the detailed reply and excellent diagram. I think this highlights some of the challenges and assumptions that are made that I myself have fallen trap to. Which has driven me to try and expel some of them in the mmWave Wars thread; albeit we aren’t at the stage of providing full test results yet.

Discussing placement location A - based on the diagram is it safe to say that

  • the distance between A and the chair at the desk is approx 6M ?

  • the target (you) is obscured by the desk. Only exposing your upper torso?

And is it fair so summarize that you expect;

  • the mmwave sensor to maintain static presence detection of an obscured target at 6M at 45° off centerline axis?

Without spoiling too much of the mmWave Wars results that are yet to be published I will tell you this much;

  • detection range is reduced at 45° off centerline axis
  • the “sitting at a desk” (aka an obscured target) has far reduced static detection range (below 3M depending on angle and level of movement in testing to date which is incomplete…).

A few thoughts…

Given that the 100x100° version removes two rows of antenna block, I’m going with vertical they don’t make it easy on us…

The challenge I have faced here is that a large target <2M from the sensor doesn’t necessarily obey this. I need a larger room w/ far targets to really confirm.

Given that my working assumption is; you are beyond the range of ultra-small movement detection as 1.8 is a pretty low SNR. Increasing latency is likely the only improvement available here.

That’ll do it.

This would indeed prove a challenge if the goal was for a single sensor to see everywhere and somehow ignore this. Which I don’t see being the case.

Which brings up expectations. What about more than one sensor? While a “mid-wall-placement” will be limited to that ceiling fan, a ceiling placement or “high wall, right at the ceiling, facing down” might be an alternative. And require additional sensors to cover the full room.

Testing Thoughts…

Try placing it in the corner behind the desk. All the way to the top of the wall right at the ceiling, facing 45° down. And then test for a day with the sensor vertical, and another horizonal.

Set a low latency while testing. Observe the SNR on your phone while doing so. The sensor reports “no presence” at roughly the time SNR dips below zero then add the latency duration.

If you can’t maintain presence with a 3sec latency, increasing the latency is a potential means to better report at the end-of-range for a particular application. But setting the latency low is the key in finding this “fringe” area.

For “nearfield standing applications”, a latency <10s is just fine.

For “off-axis sitting”, you may want to try 10-30s latency settings after you have confirmed you are at the fringes of sensor range for the application.

But only increase the latency when you have confirmed in testing w/ a latency of 3s that you are no longer “seen” and don’t go farther than this range. Increasing latency does not improve range.

1 Like

Fantastic information, I really appreciate the time you put into all this.

There is a lot to digest here and some things I will need to investigate to respond to, but here is what I know off the top of my head.

Upper torso behind the desk, with perhaps my feet in view, is all Pos. A gets me at the rear right desk,. However, the black rear left desk has even more issues with losing me, and it is at about 10 degrees.

Another oddity is beyond those desks is a bedroom, and it picks me up in there with the doors closed.

Multiple sensors are always the way to go, I was just hoping to get adequate coverage with just one for cost reasons, as I have many more room to hit after I work out the issues in this one…and these sensors are still backordered

I have come to realize that wall composition and radar behavior is something that is hard to predict. Therefore a sensor with max distance adjustment and suitable placement is the strategy I am going with atm.

“These” as in DFRobot or other sensors? The Ali link in the mmWave thread has availability.

I think I got all the bugs worked out by just putting everything in an enclosure with an adjustable arm. My POC setup lacked fine adjustments, but I was able to nail it with this setup.


I do wish I had got the white PIR sensors now, as I can see guests mistaking this for a blink camera or something

1 Like

Nice work :+1:

Hello, a great project, I also ordered two Panasonic Pir, EKMB1301112K not so many in Stock here in Germany :frowning:
I just wonder how you trigger their automation in terms of daytime brightness? Do they have an extra light sensor that is not listed here? I mean you didnt want to switch on the light at every daytime on a Day

I am experimenting a bit here once with just the SEN0395 and the combo with the Panasonic PIR.

I don’t know what a good scene or automation would look like in HA. I just like short turn off times, so far I can’t do that in the living room with the Hue Motion Sensor without waving my hands a lot. Thanks alot for your help