0
\$\begingroup\$

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?

\$\endgroup\$
  • \$\begingroup\$ Three wires, called Load (out), Clock (out) and Data (in). (Plus power and ground). And a bunch of Parallel In Serial Out shift registers, in a daisy chain. I expect you can figure out where to go from there... \$\endgroup\$ – Brian Drummond Jan 1 '16 at 18:56
2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ That's a cool way to do it with only 2 wires! \$\endgroup\$ – Ryan Griggs Jan 1 '16 at 22:18
  • 1
    \$\begingroup\$ only 2 wires per for only 7 switches, each additional set of 7 switches needs another wire, \$\endgroup\$ – Jasen Jan 1 '16 at 22:56
  • \$\begingroup\$ Thanks a very cool idea, If I use 1K, 2K, 4K, 8K, 16K, 32K, 64K resistances I can read the input and with minor coding detect active sensors. \$\endgroup\$ – ahmadx87 Jan 7 '16 at 5:52
  • \$\begingroup\$ you'd need 0.05% (precision) resistors if you go with exact multiples of two, using the E12 sizes i suggested allows use of much cheaper 2% parts. \$\endgroup\$ – Jasen Jan 8 '16 at 4:09
1
\$\begingroup\$

You can arrange your sensors in a matrix orientation, then depending on your scan rate, you can very quickly check each sensor to see if it's active. You could handle 25 sensors with 10 digital pins in this way.

Energize each row in turn, and while energized, check the values of Columns 1-5.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • 1
    \$\begingroup\$ I suggest you add (30) diodes to that to avoid ghosting, also check connections \$\endgroup\$ – Jasen Jan 1 '16 at 22:38
  • \$\begingroup\$ Excellent suggestion @jasen. Here's a great explanation of ghosting/masking for anyone interested: dribin.org/dave/keyboard/one_html \$\endgroup\$ – Ryan Griggs Jan 2 '16 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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