I am wondering where I should start in trying to get my Raspberry Pi to detect the distance of an IR signal and the direction of it. Has someone already done something similar? The end goal is to get a RPi robot to follow the signal; move towards it if the signal is too far away.

2 Answers 2


Another approach is based on stereoscopy - a technique used for recording and representing stereoscopic images. Which means that we need a pair of cameras that take pictures at slightly different positions. Using image processing corresponding features (e.g. edges of objects) are detected in both images - allowing to calculate the distance.

If using with an IR beacon image recognition could be simpler - thus reducing computational time, but make sure that the camera can pick up on IR. (Major drawback there's only one camera interface on the Pi.)

Some reading to get started:

  • Thanks for this solution! I've never considered going about it that way.
    – M2com
    Feb 9, 2016 at 3:45

Detecting the location and distance of an IR signal is tricky. To start, you'll need at least two IR receivers. Each IR receiver can detect the strength of the signal, and using the combined information, the CPU can calculate a rough location.

enter image description here

Cornel has a decent write up (source of the image above).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.