Measuring distance/proximity

If you need to quantify distance:

SHARP 2Y0A02, IR sensor (λ = 850 ± 70nm)
At-a-glance useful details:
  • Sensing range: 20 - 150 cm
  • Power requirements: 4.5 - 5.5 V (typ current consumption = 33mA)
  • Output voltage is not linear with distance; see plot below (from datasheet, linked above)
  • {8D5D58AC-AA88-469C-8E14-8B48FF36A4EF}.png

{54C81708-A400-4B9E-AF00-ADA567605335}.png

{71064E72-9B44-41D5-8E68-45F4EB5E22A0}.png

Ultrasonic Sensor (HC-SR04)

image.png

These sensors can detect objects within a range of 2 cm - 4 m with a ranging accuracy of up to 3mm. One thing to note is that they have a measure angle of 15 degrees, so they do well at measuring objects directly in front of the sensor. For most applications, this is favorable.

 

Helpful resource from Sparkfun with example code, and wiring diagram: https://www.sparkfun.com/ultrasonic-distance-sensor-hc-sr04.html

 

If you just need to know if an object is present or not:

 (e.g., detecting fan speed, motion detector, etc.)
Hall Sensor (AH1815, from Treston)

 



Revision #8
Created 2025-12-03 15:45:56 MST by Claire
Updated 2026-07-27 14:18:05 MDT by Claire