I'm currently working on a project for which I require a sensor. I've made a quick and simplified drawing of what the result is supposed to do:

Diagram of object movement sensor

Basically, I want one LED of a LED-Strip to light up dependent on the location of a moving object. If the object in above image (say a slow rolling ball) were to move from bottom to top, then the LED strip should also light up from bottom to top. I have no problem getting the LED strip to light up adequately, however I'm not sure which sensor actually can pick up objects as required in this case.

As I've understood regular IR sensors can only detect if there is an object and how far it is away, however they can't pick up said object's relative position on the y-axis. Is there any way to do this rather easily, perhaps with triangulation? I've looked into Bluetooth and RFID but haven't found anything particularly useful.

  • Why not just infra-red beams going to detectors. As the object travels it breaks different beams and triggers different LEDs. You don't even need an Arduino to do it.
    – Majenko
    Dec 11, 2016 at 21:33
  • How small can the IR beams become? I was under the impression that they would always scatter and thus interfere with each other.
    – fasoh
    Dec 11, 2016 at 22:02
  • Depends on how good your lenses are. If you want ultra-narrow then use lasers.
    – Majenko
    Dec 11, 2016 at 22:03

2 Answers 2


I feel that an array of IR transmitters and receivers could work for you.

If you put the transmitters/receivers in an recessed tube with (black, non-ir reflectant) separations, you can avoid crosstalk. You should be wary that it may require some tweaking to find the right sensitivity.

enter image description here

Here is a video (and here) that shows this in practice. I like the fact that you don't need sensors on either side of the object.

You may also consider video-processing, but that's out of scope for Arduino. Or use a Lidar.


There are many solutions to the problem. For a free moving ball confined to a square flat surface with sides:

  1. Choose IR LEDs mounted at such a height and distribution to be blocked by the rolling ball. Make sure at least 1 IR LED is blocked by the ball no matter where it is located.
  2. Line two adjacent sides with strips of these IR LEDs.
  3. Use the Arduino to light each LED one at a time at a frequency of about 40KHz. Scan all LEDs within a second. This should be adequate to locate a slow moving ball in 2D space.
  4. On the two opposite sides mount a ASK Remote Control receiver. A common device easily harvested from old entertainment equipment or bought from electronics part supply houses.
  5. Use the Arduino to sense when the ASK Remote Control receiver detected or did not detect the flashing IR LED.
  6. When the Arduino finds an IR LED that is not detected, the ball can be assumed to be between the IR LED and the ASK Remote Control receiver.

Note, the patter of intersecting lines will look more like two sets of bicycle tire wheal spokes. Not like a checker board. It may be better to confine the ball to a smaller square then that of the square where the transmitting IR LEDs and ASK Remote Control receiver are mounted on.

Your Answer

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

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