If you are deciding which range sensor is best for short distance measurement under 5 meters, a Time-of-Flight (ToF) sensor delivers the best balance of accuracy, cost, and reliability, while laser distance sensors lead when sub-millimeter precision is non-negotiable, and infrared sensors remain the most cost-effective choice for basic proximity detection. The right sensor depends on your specific requirements for range, accuracy, budget, and operating environment.
Key Takeaways
– ToF sensors offer the best overall balance for short-range measurement: ±1-5% accuracy from 4 cm to 8 m, with strong ambient light immunity
– Laser distance sensors achieve sub-millimeter precision but cost 3-5x more than ToF or IR alternatives
– Infrared sensors are the most affordable option for basic proximity sensing under 1.5 m, but accuracy degrades with surface color and ambient light
– Ultrasonic sensors outperform optical sensors on transparent, reflective, or dark surfaces
– Proximity sensors (inductive/capacitive) detect presence reliably but do not measure distance
– Match your sensor to your environment first: lighting conditions, target surface properties, and temperature range determine real-world performance more than datasheet specs alone
Quick Comparison: Sensor Types at a Glance
Before diving into each technology, here is how the five major sensor categories compare on the metrics that matter for short distance measurement:
| Sensor Type | Typical Range | Accuracy | Ambient Light Immunity | Surface Sensitivity | Relative Cost | Best For |
|---|---|---|---|---|---|---|
| Infrared (IR) | 10 cm–1.5 m | ±5–10% | Poor (direct sunlight interference) | High (color/reflectivity matter) | $ | Proximity sensing, motion detection, touchless switches |
| Laser | 5 cm–200 m | ±1 mm | Good | Moderate (transparent surfaces) | $$$ | Industrial QC, 3D scanning, precision alignment |
| Time-of-Flight (ToF) | 4 cm–8 m | ±1–5% | Excellent (up to 100k lux) | Low (glass still problematic) | $$ | Drones, robotics, consumer electronics, gesture recognition |
| Ultrasonic | 2 cm–10 m | ±1–3 cm | Unaffected by light | Low (works on glass, liquid, dark surfaces) | $ | Level sensing, transparent object detection, parking sensors |
| Proximity (Inductive/Capacitive) | 0–5 cm | Presence only | Unaffected by light | Low | $ | Manufacturing presence detection, position sensing, safety interlocks |
Infrared Sensors for Short Range Measurement
Infrared sensors detect distance by emitting IR light and measuring the intensity of the reflected signal. They are widely used for short-range proximity sensing and presence detection in consumer electronics, home appliances, and basic automation tasks.
How IR Sensors Perform at Close Range
IR triangulation sensors like the Sharp GP2Y0A21YK series produce an analog voltage output proportional to distance, with a typical effective range of 10 cm to 80 cm. The output is nonlinear, requiring a lookup table or calibration curve in firmware. At distances under 30 cm, these sensors can achieve reasonable repeatability, but accuracy varies significantly with target surface color and ambient lighting.
Strengths and Limitations
The primary advantage of IR sensors is cost. A complete IR ranging module costs under $2 in volume, making it the cheapest option for applications that only need coarse distance information. IR sensors also draw very little power, which matters for battery-operated devices.
The trade-offs are real. IR readings shift noticeably when target color changes from white to black. Direct sunlight saturates most IR receivers. And the narrow effective range, typically under 1.5 meters, limits these sensors to close-proximity roles.
When to Choose Infrared
IR sensors make sense when you need basic proximity detection at the lowest possible cost: touchless light switches, paper detection in printers, simple obstacle sensing in low-cost robots, and presence detection in appliances. If your requirements include accuracy better than 5%, consistent performance across surface colors, or outdoor operation, move up to ToF or ultrasonic.
Laser Distance Sensors: Maximum Accuracy for Precision Applications
Laser distance sensors use phase-shift or time-of-flight measurement with a collimated laser beam to achieve the highest accuracy available in short-range measurement: typically ±1 mm or better, even at close distances.
How Laser Distance Sensors Achieve High Accuracy
Phase-shift laser sensors modulate the emitted beam at a known frequency and measure the phase difference between the outgoing and returning signal. This technique produces millimeter-level accuracy across ranges from a few centimeters to 200 meters, independent of target color under most conditions. The narrow beam, often under 1 degree of divergence, also enables precise targeting of small features that wider-beam sensors cannot resolve.
Trade-offs: Cost, Complexity, and Surface Limitations
The primary limitation of laser distance sensors is cost. Industrial-grade modules with ±1 mm accuracy typically range from $50 to $500, placing them in a different budget category than IR, ultrasonic, or even ToF sensors. Laser sensors also struggle with transparent surfaces (glass, clear plastics) and highly reflective targets unless specifically designed for those conditions. Eye safety classification adds another constraint: Class 2 and above lasers require safety labeling and controlled deployment per IEC 60825-1 .
When Laser Is the Right Choice
Laser distance sensors are the correct choice when accuracy requirements demand sub-millimeter precision: industrial quality control, 3D scanning and metrology, precision alignment in manufacturing, and applications where measurement error translates directly to product defects. For most general-purpose short distance measurement tasks, the precision of a laser sensor exceeds what the application actually requires, and a ToF sensor will deliver sufficient accuracy at a fraction of the cost.
Time-of-Flight (ToF) Sensors: The Versatile All-Rounder
Time-of-Flight sensors emit a pulse of infrared light (typically at 850 nm or 940 nm) and measure the round-trip time to calculate distance with high accuracy, making the ToF sensor a standout choice for short range measurement. Over the past five years, ToF technology has moved from premium smartphones into mainstream consumer electronics, robotics and drones, and industrial automation.
How ToF Technology Works
A ToF sensor integrates a VCSEL (Vertical Cavity Surface Emitting Laser) emitter, a SPAD (Single Photon Avalanche Diode) receiver array, and a timing circuit into a single compact module. When the sensor fires a light pulse, a precision timer starts. The SPAD array detects the returning photons, and the elapsed time converts directly to distance using the speed of light.
Direct ToF (dToF) sensors count individual photon arrival times, producing millimeter-accurate readings largely independent of target color and ambient light. Leading dToF sensors like the DOMI DM0301 maintain consistent accuracy at up to 100,000 lux, meaning they work reliably in direct sunlight as well as complete darkness. Indirect ToF (iToF) sensors measure phase shift instead of direct pulse timing, offering lower cost but reduced ambient light immunity.
Accuracy, Range, and Environmental Performance
A modern dToF sensor achieves ±1-5% accuracy across its full range, typically 4 cm to 5-8 meters depending on the module. This accuracy holds across most surface colors and indoor lighting conditions. The key environmental limitation for ToF sensors is transparent or highly reflective targets: glass windows, mirrors, and polished metal can cause multipath reflections or complete signal loss.
DOMI ToF Sensor Solutions
DOMI Sensor manufactures a range of ToF sensing modules built on vertically integrated VCSEL and SPAD technology. The DM0301 1D ToF Sensor delivers ranging up to 5 meters with pin-to-pin compatibility with the ST VL53L4CD, offering 3.8x longer range in the same LGA package. For applications requiring depth maps rather than single-point ranging, the DMAS2M001 dToF Array Module provides 40×30 resolution at 10 FPS across a 60-degree field of view, operating reliably from 0.2 m to 8 m in ambient light up to 100,000 lux.
Ultrasonic Sensors: The Budget Choice for Difficult Surfaces
For short distance measurement where optical sensors fall short, ultrasonic sensors measure distance by emitting a sound pulse (typically 40 kHz) and timing the echo return. Because they use sound rather than light, they solve surface-detection problems that frustrate every optical sensor type.
Why Ultrasonic Excels Where Optical Fails
Ultrasonic sensors detect glass walls, clear plastic panels, dark matte surfaces, and highly reflective mirrors with equal reliability. Sound waves reflect off any solid surface regardless of color or transparency, and ambient light, whether darkness or direct sun, has zero effect on measurement accuracy.
The HC-SR04 , a widely available ultrasonic module, offers 2 cm to 4 m range with approximately 3 mm accuracy at close distances, all for under $2. The main limitations are a blind zone (typically 2-4 cm minimum range), a wide beam angle (15-30 degrees), and sensitivity to temperature and airflow, which change the speed of sound.
When to Choose Ultrasonic
Ultrasonic sensors are the go-to choice for liquid level sensing, transparent object detection, parking assistance systems, and any application where the target surface is optically challenging. They are also widely used in beginner and educational robotics due to their low cost and forgiving operation. For applications requiring narrow beam targeting or fast update rates, pair an ultrasonic sensor with a ToF or IR sensor in a complementary configuration.
Proximity Sensors for Object Detection Range
Proximity sensors detect the presence or absence of an object within a limited range, typically a few millimeters to a few centimeters. Unlike the other sensor types discussed here, proximity sensors do not provide distance measurements; they output a binary present/absent signal.
Inductive vs. Capacitive Proximity Sensors
Inductive proximity sensors generate an electromagnetic field and detect eddy current changes when a metal object enters the field. They detect only conductive materials, typically at ranges of 1-50 mm, and are extremely durable in harsh industrial conditions: high temperatures, dust, coolant spray, and mechanical vibration.
Capacitive proximity sensors detect changes in capacitance caused by any material with a dielectric constant different from air. They can sense plastics, liquids, wood, and granular materials in addition to metals, but at shorter ranges than inductive sensors (typically 1-15 mm) and with higher sensitivity to environmental humidity and contamination.
Where Proximity Sensors Fit
These sensors excel in manufacturing and automation: end-stop detection on linear actuators, part-presence verification on assembly lines, safety interlock monitoring, and object counting on conveyors. They are not a substitute for ranging sensors, but they are the most reliable choice when the only question is “is something there?”
How to Choose the Right Sensor: A Step-by-Step Framework
Selecting a range sensor starts with the application requirements, not the sensor specifications. Use this framework to narrow your options before comparing datasheets.
Step 1: Define Your Range and Accuracy Requirements
Write down the minimum and maximum distance you need to measure, and the accuracy required at each. If your application only needs to know whether an object is within 30 cm, you do not need a ±1 mm laser sensor. Conversely, if you are inspecting machined parts for dimensional compliance, a ±10% IR sensor will not suffice.
Step 2: Characterize Your Target Surface
What material are you measuring against? A matte white surface at 1 meter is the easiest target for any optical sensor. A glass panel, a polished metal reflector, or a black anodized part is far more challenging. If your targets include transparent or highly reflective materials, ultrasonic should be your baseline, with optical sensors added for complementary capability.
Step 3: Evaluate Environmental Conditions
List the lighting conditions the sensor will encounter: indoor office lighting, direct sunlight through a window, a dark warehouse, or rapid fluctuations between all three. Optical sensors (IR, laser, ToF) have varying degrees of ambient light immunity. Check the datasheet specification for lux tolerance: a sensor rated for 100k lux handles direct sun, while one rated for 5k lux will saturate near a bright window.
Temperature and humidity matter too. Ultrasonic sensors drift with temperature changes (the speed of sound varies ~0.6 m/s per degree Celsius). Most optical sensors include temperature compensation, but verify this in the datasheet.
Step 4: Set Your Budget
Sensor cost spans three orders of magnitude, from under $1 for basic IR or ultrasonic modules to $500+ for industrial laser systems. Factor in integration cost too: a sensor with an I2C interface and available SDK costs less to integrate than one requiring custom analog signal processing. See our ToF Knowledge Hub for integration guides and technical resources.
Quick Decision Matrix: Range Sensor Comparison by Use Case
| If You Need… | Start With… |
|---|---|
| Presence detection only, lowest cost | IR or proximity sensor |
| Reliable detection of glass, liquids, or dark surfaces | Ultrasonic sensor |
| Accurate ranging (1-5%) at 1-5 m, works in sunlight | dToF sensor (DM0301 class) |
| Sub-mm precision, industrial environment | Laser distance sensor |
| 3D depth mapping for robotics or AR/VR | dToF array module or depth camera |
| Harsh industrial, presence only | Inductive/capacitive proximity sensor |
Frequently Asked Questions
What is the most accurate sensor for short distance measurement?
Laser distance sensors using phase-shift measurement achieve the highest accuracy for short-range applications, typically ±1 mm or better. For most practical applications under 8 meters, dToF sensors provide sufficient accuracy (±1-5%) at a significantly lower cost.
How much do short distance measurement sensors cost?
Sensor costs range from under $1 for basic IR or ultrasonic modules to $500+ for industrial laser systems. Mid-range dToF sensors suitable for robotics and consumer electronics typically cost $3-15 in volume. Factor in integration effort when comparing total cost: a sensor with an available SDK and I2C interface costs less to deploy than one requiring custom analog front-end design.
Can infrared sensors work outdoors?
Standard IR sensors perform poorly in direct sunlight because ambient IR from the sun saturates the photodetector. Some IR sensors include modulated carrier schemes (typically 38 kHz) that improve outdoor performance, but for reliable outdoor short distance measurement, dToF sensors with 100k lux ambient light immunity are the more dependable choice.
What is the difference between ToF and laser distance sensors?
Both use laser light, but the measurement principle differs. ToF sensors emit a pulse and measure the round-trip time of the reflected photons directly. Laser distance sensors typically use phase-shift measurement: they modulate the laser at a known frequency and calculate distance from the phase difference between emitted and received signals. Phase-shift laser sensors achieve higher accuracy (±1 mm vs ±1-5% for ToF), but ToF sensors are faster, more compact, and more affordable.
Which sensor works best on glass or transparent surfaces?
Ultrasonic sensors are the most reliable option for glass and transparent surfaces. Sound waves reflect off the density boundary at the glass surface regardless of transparency, whereas optical sensors (IR, laser, ToF) transmit through clear materials and fail to measure distance accurately. If your application involves measuring through glass or detecting transparent objects, start with ultrasonic.
How do I choose between dToF and iToF sensors?
dToF (direct Time-of-Flight) sensors count individual photon arrival times using SPAD arrays, delivering better ambient light immunity and longer effective range. iToF (indirect Time-of-Flight) sensors measure phase shift of a modulated continuous-wave signal, offering lower cost but reduced performance in bright light. For outdoor applications, robotics, and drones, choose dToF. For indoor-only consumer electronics where cost is the primary driver, iToF may be sufficient.
Key Takeaways and Next Steps
Deciding which range sensor is best for short distance measurement comes down to four factors: required accuracy, target surface characteristics, environmental conditions, and budget. For most applications under 5 meters, a dToF sensor provides the best balance across all four dimensions. Ultrasonic sensors solve the transparent-target problem that frustrates optical sensors. Laser sensors deliver unmatched precision when the application justifies the cost. And for simple presence detection, IR or proximity sensors get the job done at the lowest price point.
Before committing to a sensor, test it against your actual target surface in your actual lighting conditions. Datasheet specifications are measured under controlled lab conditions; your operating environment will differ.
Explore DOMI’s full sensor portfolio for ranging modules, depth cameras, and custom solutions designed for robotics, drones, smart home, and industrial applications. For deeper technical comparisons, browse our sensor technology articles.
Reviewed by DOMI Technologies Engineering Team. Specifications current as of May 2026.