A Practical Solution to Human Presence Sensing at Last?

This is a heads up concerning an upcoming post, currently in progress, about what may well be the long sought after HPS (Human Presence Sensor) so important to many IoT, and other, projects. I want to let you know about this before writing it up extensively because it is very impressive and can be applied immediately as simply as much less capable and ultimately failing options.

The Problem

Many times the basis for activating or otherwise controlling some real world circuit is detecting the presence of a human being. While at first this seems like it would be easy, it turns out to be a vexed problem. The sensor technologies available to this point didn't detect human presence, they detected side effects of it that didn't offer any way to deal with the many cases where those effects were insufficient for a high reliability result,

Distinguish humans from, say, pets, or in some cases inanimate objects requires a lot more than what most "solutions" to this problem offer. Here's a brief rundown of the previous choices available to the designer:

  1. PIR (Passive Infrared) Sensor
    The PIR sensor is not a presence sensor, it is a motion sensor. In particular, it detects the motion of objects hotter than the ambient temperature. The way it does this is certainly very clever, and for things like alarm systems, it can be very effective indeed. But when you try to use it for presence it becomes clear that humans, in real life, often sit still and for some reason find it very annoying to have to wave their arms to turn the lights back on after a PIR-based occupancy sensor decided no one was in the room.

    1690703193187.png

    A typical PIR sensor without a housing. Note the 2.54mm pin header for scale.
  2. Conventional Radar
    A relatively new addition to the options available, inexpensive radar sensors operating at 2.4GHz, 10GHz, and 24GHz are a possible choice. They are cheap, easily interfaced (many actually use the chips designed for PIR detectors as a base), and readily available. They can also operate through walls and other solid obstacles which can be a feature or a bug, depending on your application. But, like PIR, they are motion detectors and suffer the same failures. So, no real help here.

    1690703544312.png
    1690703312213.png

    The ubiquitous and dirt cheap RCWL-0516 doppler radar motion sensor, operating at around 3GHz (left) and the still dirt cheap but somewhat better CDM324 CW radar motion sensor operating at 24GHz (right)

  3. Laser Rangefinders
    A new class of cheap sensors, in the form of small, cheap laser-based distance sensors seems promising in some applications where the place where a human is expected somehow constrains what can appear there, and so anything that is detected must be a human. Unfortunately, while you might find ways to use them in the more conventional applications (e.g.: heating or lighting management, occupancy tracking, etc.) they will suffer most to the same pitfalls as their motion detecting cousins.

    1690703883821.png


    TheVL53L0X ToF (Time-of-Flight) Laser Ranging Sensor using a 940nm laser integrated into the ST Mircoelectronics VL53L0X chip. Really impressive for about 3 bucks a pop.

  4. Switches, Tokens, and Other Things
    While you might have an application like the ones suited to the lasers above, where the space in which you need to detect human presence is constrained in such a way that any detection means it is a human, that's not the usual case. But, if you did have one, then something like a pressure mat which is a switch the is activated by being walked or stood upon, could be a solution. This doesn't help with the cases where you don't have control about what is going to show up—that is, most of them.

    You might also consider using some sort of token, such as an RFID tag or the (BT/WiFi) broadcast of a mobile device. This can actually be pretty effective, particularly the last, but the downside is that a person has to have the token or a registered device. It will also be fooled by leaving the device in the space. It is better, in some ways, than the motion detector route but it is still not very good for many reasons.

    One more recent option is a computer vision system of some sort. In many ways, this is actually a very good solution. But, it is a relatively expensive one, and doesn't easily scale because of this. Edge AI devices with ML-based human presence detection are surprisingly cheap, but compared to the classic PIR or more modern Radar options, they cost a fortune and price themselves out of most projects.

    Still, they can do much more including identify who the detected human is, so for some applications they are worth the cost. Definitely consider them when designing something that needs human presence detection to see if they are a fit

The Solution?
You will note that I specified, above, conventional radar. That's because a new technology appeared on the market a while ago with very great promise. It is based on FM-CW (Frequency Modulated Continuous Wave) methods. FM-CW (or variously FMCW, or CWFM) is not new. Its roots go back to the 1940s.

What is new is the combination of miniaturized FMCW circuitry with modern PCB-based patch antennas, and powerful, inexpensive microprocessors to process the data. This combination has the advantages of "seeing" a human the way the ML vision system above can do, but at a tiny fraction of the cost in money and space. FMCW sensors can detect moving or stationary humans, and distinguish them. They can be configured to do fall detection for applications like senior care facilities, then can also provide distance information which can be exceedingly useful.

When the miniature versions of these detectors first appeared, it was very exciting. They have so much potential. Unfortunately they also have a lot of complexity. So, while they could be used as really excellent human presence detectors, their application was often beyond the capacity of the person who would choose a PIR or conventional radar sensor with it's simple go-no go output.

Enter Hi-Link
The first of these detectors were still very exciting. I have several radar detectors operating in various bands which are in the queue for posts here as I have been testing them (though they are currently on hold due to other obligations, they will eventually show up here in a comparison post).

When the first of the FMCW devices began to appear, I immediately looked for a decent option, and the best I found were from Hi-Link, a Chinese company producing some really impressive sensors, both conventional doppler types and FMCW, along with a lot of other cool stuff. And, they work well but they require specialized programming boards and used uncommon, very fine pitch connectors. This made them less exciting to think of deploying widely or recommending to the average user or hobbyist.

But recently, I came across a new model on AliExpress and decided to order a few to add to the testing. Once I received them I had to make this quick post to get out the word because you don't need to wait for me to get all the details before you buy these things if you need presence detection.

1690702723598.png

The HLK-LD23410C 24GHz human presence detector is fantastic. It has the advantages of the earlier modules, but it adds simplicity and that changes everything. The module offers a simple go-no go GPIO output like the PIR sensor if that's all you need. It also offers a serial interface for configuration of the module, an data about what is being sensed, including distance if that's important to you.

But, it also offers BLE, along with applications for both the Android and iOS platforms. The software provides a read out of the data, and most importantly a configuration interface that lets you tune the parameters to your application. So, all you need is a mobile phone and you can set the module up and let it run. It will signal on the GPIO port is there is a human—whether moving or stationary—and it is that latter thing that is what makes this a game changer.

1690702854382.png
1690702925425.png

Some views of the HLKRadarTool app for iOS, which happens to be running
perfectly under MacOS Ventura, a new feature of MacOS that's really brilliant.

The application includes a tool to baseline environmental noise so you can eliminate false positives. It creates a profile based on your untended use after characterizing the noise. A couple of button presses to get this done. There are a lot of potential tuning points which you can use yourself, or thankfully, ignore. Or start with the auto-tuning and tweak it to make things exactly as you want them.

A quick check on current consumption without any attempts to make it better shows about 90mA while it is active. I don't know how much this can be reduced but obviously this would make the device not very useful for full time battery powered operation using small cells. More research is needed, but fortunately, you can get all of the documentation (datasheet, serial protocol specification, and 3D model) which, for convenience, I have uploaded here.

The sensors cost about $8.00 (at the link above) which is more expensive than the dirt cheap PIRs or doppler modules but offering far more functionality. They also have a kit with a USB ⇆ TTL serial adapter with a set of jumpers for another five bucks or so, and it's a decent one, but if you have a 3.3V USB ⇆ TTL you really don't need it.

It's amazingly easy to set up and just use so if you need a presence detector, don't hesitate to evaluate this one. I will have a lot more information in the follow up to the post as I learn more and test.

Blog entry information

Author
Ya’akov
Views
542
Last update

More entries in General

More entries from Ya’akov

Share this entry

Top