Hello! now
HK In FortuneFree Shipping Over$200
Follow Us:

Giving a Device Ranging and Presence Detection

6/4/2026 9:25:00 AM

Ranging and presence detection sound like one job and are two. Ranging asks how far away something is and wants a number in millimeters or meters; presence detection asks only whether someone is there and wants a yes or no. The sensors split along the same line, so choosing one starts with deciding which question the device is asking, since a part built to measure distance is wasted on a light switch and a presence sensor cannot guide a robot toward a wall.

Both work by bouncing something off the target and timing or reading what comes back, and each medium gets fooled by a different thing. Light is fast and precise, sound is cheap and forgiving, radar sees through plastic, and infrared senses body heat. None is right for every scene, and the way each one fails matters as much as the numbers on its datasheet, so the surfaces in front of the device deserve as much thought as the range it has to cover.

Light, timed to the target

The cleanest way to measure a short distance is to time how long a pulse of light takes to fly to the target and back. Time-of-flight sensors do this with an infrared laser and an array of fast single-photon detectors, returning a distance in millimeters with no moving parts and no math left to the host. A whole family of them from one maker covers a wide span of the short-range cases a device meets, and they read in a few milliseconds per measurement, fast enough for a robot or a gesture. The trade they all share is that the reading is only as good as the light that comes back, which is where the surface gets a vote.

The VL53L0X measures short-range distance by time of flight, the part that brought ToF into hobby and consumer designs, reading out to a couple of meters over I²C from a package smaller than a grain of rice. It suits a robot sensing a wall, a phone confirming a face is near, or a dispenser noticing a hand, and it needs no calibration to give a usable number out of the box. Its limits are the limits of the method: a dark or steeply angled surface returns little light and reads short or drops out, and a cover glass in front of it reflects some light straight back as crosstalk unless the design leaves an air gap or tunes it out, both things the firmware has to expect rather than trust blindly. A measurement takes a few tens of milliseconds, and a faster timing budget trades range and accuracy for a higher update rate when a device has to react quickly to something moving toward it.

The VL53L1X extends time-of-flight ranging to about four meters and adds a programmable region of interest, so the same part can look down a narrow cone or open to a wide one under software control. That field control often matters more than the extra range, since narrowing the cone lets the sensor ignore a doorframe or a nearby wall and watch only the patch of floor or the approach it cares about, and a design can even scan the region around to fake a crude multizone read from a single-zone part. One part becomes several through configuration.

Where a single distance is not enough, the VL53L5CX does multizone sensing, returning a grid of up to sixty-four zones at once instead of one number, at frame rates fast enough to track motion across the grid. That grid is enough to tell a hand from a head, to count people crossing a threshold, or to map the rough shape of what is in front of the device without the cost, the data rate, or the privacy questions a camera carries. It is the step from knowing how far to knowing what, while staying a depth sensor and never becoming an imager that raises those questions.

The VL6180X combines close-range ranging with an ambient light sensor, measuring absolute distance over a few centimeters by time of flight in place of inferring it from reflected brightness the way a simple proximity sensor does. Inferring from brightness fails the moment the target changes color or shininess, while timing the photons does not, so the VL6180X gives an honest short-range number where it counts. That suits a phone deciding a finger is on the glass or a fixture sensing a hand right at it, and folding a light sensor into the same part covers two phone sensors that would otherwise sit as separate components.

An HC-SR04 ultrasonic ranging module
An HC-SR04 ultrasonic module: two transducers send a pulse and time its echo, reading distance off surfaces that defeat a laser.

Sound, slower and more forgiving

Where light fails, sound often works. Sound travels slowly enough to time with a cheap microcontroller and reflects off surfaces that swallow light, so the HC-SR04 does low-cost ultrasonic ranging by sending a burst of about forty kilohertz and timing its echo, reading from a few centimeters to a few meters for almost nothing. It sees a clear glass door a laser would pass through and a matte black surface a ToF sensor reads short, which is why it survives in robotics kits and parking sensors long after cheaper-looking optical parts arrived. The price is a wide beam that cannot say where in its cone the echo began, a blind zone right in front of the transducer while it stops ringing, and a reading that drifts with the temperature setting the speed of sound, so a careful design ranges past the blind zone and compensates for the air. Its interface is one trigger pin and one echo pin whose pulse width equals the round trip, simple enough for any microcontroller to read with a timer and an interrupt and nothing else.

How each method gets fooled

Every ranging method is a bet that the target reflects the signal back the way the sensor expects, and each is fooled where that bet fails. Light time-of-flight is the precise one and the fussy one: a matte black surface absorbs the infrared and returns almost nothing, clear glass passes it straight through, a mirror or a steep angle bounces it away from the detector, and bright sun floods the receiver with the same wavelength it listens for, so an outdoor reading leans hard on the sensor's ambient rejection. A reflection off a near edge can also fold into the reading as a false short return, the multipath that trips a ToF sensor in a cluttered scene. Ultrasonic ranging gives up that precision for robustness, since it ignores color and transparency, but its beam spreads into a wide cone that blurs where the echo came from, soft materials like foam or cloth absorb the pulse and return silence, and the speed of sound shifts with temperature enough to skew an uncompensated reading by a noticeable margin. Passive infrared is different in kind, since it emits nothing and only senses the heat a warm body radiates as it crosses the sensor's zones, so a person sitting still slowly fades from view and a draught of warm air can trip it. Radar threads between these, seeing through a plastic housing and reading motion as small as breathing, at a cost in money and in the regulatory approval its emissions need. The lesson under all of them is to pick the method for the surfaces and the scene rather than the headline range, since the range is honest only when the target plays along. A device that has to work against unknown surfaces, a public kiosk or an outdoor gate, often carries two methods and trusts whichever agrees, because no single one survives every target a stranger presents to it.

When the question is only whether someone is there

Plenty of devices need no distance at all, only to know a person is present, to wake a display or switch on a light. The cheap and standard answer is passive infrared, which watches for the moving heat of a body and draws almost nothing while it waits, which is why it sits in nearly every motion-activated light and battery doorbell camera made.

The AS312 is an integrated PIR occupancy sensor with the pyroelectric element, the amplifier and the detection logic together in one small can, so a design drops it in behind a Fresnel lens and gets a clean motion output with no analog front end to build. The lens is half the sensor, since it divides the field into stripes so a body moving across them chops the heat into the pulses the part triggers on, which is why coverage and reach depend on the optics as much as the silicon. It triggers on a person crossing its field while ignoring slow background drift, and its low standby current lets it watch for months on a cell. Its weakness is the weakness of all PIR, that it sees change rather than presence, so a person who stops moving disappears from it. The detection logic also holds its output for a set time after each trigger and ignores retriggers during it, so a light it switches stays on for a tunable interval instead of flickering with every step.

The EKMB series does low-power passive infrared detection for designs where the standby current has to fall lower still, a quartz-based PIR drawing on the order of a microamp so a sensor node can run years on a coin cell rather than months. It gives up some range and accepts a higher price for that frugality, the choice when a device sleeps almost all of its life and has to wake only when a person arrives, and the long battery life is the whole reason it sits in the catalog beside cheaper PIR parts.

When PIR is not enough, because people sit still or the device has to sense breathing, radar steps in. The BGT60TR13C uses 60 gigahertz radar for presence and gesture, sweeping a frequency-modulated signal and reading both the distance and the tiny Doppler shift of a moving target, down to the rise and fall of a chest, which lets it hold a presence true for a person reading quietly in a chair where a PIR would give up. It sees through a plastic housing so it can hide behind a panel with no visible opening, reads hand motion for touchless control, and asks for more cost and more signal processing than a PIR, the trade a design accepts when still-presence or gesture is the real requirement.

An inexpensive PIR motion sensor module with its Fresnel lens
A PIR module under its white Fresnel lens: it watches for the moving heat of a body and draws almost nothing while it waits.

Choosing by the scene, not the spec sheet

The first cut is the question itself. A device that needs a distance reaches for time-of-flight indoors and at short range, for ultrasonic where surfaces are dark or clear, or for radar where it has to see through a cover. A device that needs only presence reaches for PIR when the target moves and for radar when it might sit still, and the power budget usually decides between them when both could serve.

The second cut is the scene. A black plastic trim, the glass of a display case, the foam in a seat, the still posture of a reading user, each one defeats a different method, so the real surfaces and the way people occupy the space narrow the field long before a datasheet does. A sensor chosen on its range alone, without that walk through the scene, tends to be the one returned as faulty when it was only ever pointed at the wrong kind of target.

Get those two cuts right and the part follows from them. The range and resolution on the front page mean what they say only when the target reflects the way the sensor assumed, and the rest of the time it is the method, not the number, that decides whether the device sees what is standing in front of it.

Related information

HK In Fortune

Search

HK In Fortune

Products

HK In Fortune

Phone

HK In Fortune

User