Detect position of walkers along a path using IR transceivers

detectioninputkeyboardkeypad

I am working on a project that the position of people walking along a path needs to be known. I'm a hobbyist so I don't know what options I may have.

I want to use IR sender and receivers to detect the position of people. I need to use around 20-25 sensors (one every 50cm). The easiest solution that may come to mind is to connect each IR receiver to one pin of my Arduino, but it requires too many pins and also huge amount of wires. To use less pins and wire I thought I could use an arrangement like analog keyboard, similar to the following image, keys representing IR sensors.

enter image description here

But this way only one input can be detected. Is there any way to detect multiple inputs using only a few wires?

Best Answer

Use resistors spaced apart by a factor of at-least 2

eg: 1K, 2.2k, 4.7K, 10K, 22K, 47K, 100K, then combinations will non-ambiguous.

7 resistors per 10-bit ADC input is about all that seems likely to work well. use 680 ohms for the fixed resistor.