Setting up a grid of IR sensors

enter image description here

I would like to design an nxn IR long range break beam sensors and place them on a table with receiver at one side and transmitter over the other Length of the table is 155 cm and width is about 140 cm. The idea is, to place an array of IR break beam sensors. Any object that falls within the IR grid, needs to be detected and the signal needs to be sent to an Arduino / micro controller Below is a high level sketch:

  1. Objects that needs to detected within the IR grid are of ping pong ball sizes.
  2. I need to send the output (whether a beam got broken or not) in the digital form to a micro controller.
  3. Finally, from the micro controller, I am planning to transmit the data via Bluetooth to a smartphone.

I have just started to think about 2)

In my case, I will have to use multiple such sensors.

  1. Could anyone throw me some pointers on the direction I need to take?
  2. Do I need to design a PCB which would comprise of several sensors?
16k 6 6 gold badges 49 49 silver badges 68 68 bronze badges asked Jul 29, 2018 at 18:45 Abhay Hegde Abhay Hegde 103 4 4 bronze badges

\$\begingroup\$ I would start with a single tx/rx like the video, then angle one relative to the other, you said IR not laser not that laser doesnt have this problem. Notice that ir is not a tight beam. Then maybe build a handful receivers and use the one transmitter, run your ping pong ball through that and see what happens. If you think it will still work then yes build some boards, pretty easy to do with kicad or eagle, oshpark or one of the places in asia. \$\endgroup\$

Commented Jul 29, 2018 at 19:12

\$\begingroup\$ you might want to use microcontrollers on one end or the other in the first place rather than send individual signals from the receivers. depends on your design. \$\endgroup\$

Commented Jul 29, 2018 at 19:13

\$\begingroup\$ Your array idea has a problem to be overcome: IR-LED probably can't be confined to a ping-pong diameter at 1.5m distance. That means a single IR detector can see multiple LEDs. your detector array can be blocked by large objects, but not by smaller objects. \$\endgroup\$

Commented Jul 29, 2018 at 19:46 Commented Jul 29, 2018 at 19:48 \$\begingroup\$ No . I meant it is not possible to detect anywhere \$\endgroup\$ Commented Jul 30, 2018 at 4:09

4 Answers 4

\$\begingroup\$

Ignoring for now whether this is the best way to detect an object, I would recommend using lasers and photodiodes to make your grid.

It may be possible with just regular leds but carefully designed optics would be required. IR lasers are not super cheap, but also not crazy expensive.

Reading a photodiode with an arduino is very easy to do.

answered Apr 2, 2023 at 19:15 7,184 2 2 gold badges 22 22 silver badges 41 41 bronze badges \$\begingroup\$

Do you think the sensors will interfere with the game?

Even if above was ignored, the ball can be missed.

Since the round edge hitting the table has a very small edge touching the table and there is no optimal beam size to catch every contact with the surface.

answered Jul 30, 2018 at 4:50

\$\begingroup\$ No, the sensors will not interfere with the game. Sensors would be placed at the edge of the table and idea is to to cover only half the table. The image that i have shown , represents the top view of the table. Image - encrypted-tbn0.gstatic.com/… , if you may look at this image.. total length is 274cm . Sensors would be placed only on one half ,i.e., resultant dimensions would be 153 cm X 137 cm \$\endgroup\$

Commented Jul 30, 2018 at 5:00

\$\begingroup\$ You are not understanding. The sensors must stick above the table edge and interfere and 2) will not be able to block between gaps of two balls touching \$\endgroup\$

Commented Jul 30, 2018 at 13:51

\$\begingroup\$ It needs to detect only ball at a time hit by the opponent from the other side of the table. Anyway , as others have suggested, I need to try it out..make mistakes and learn in the process. \$\endgroup\$

Commented Jul 30, 2018 at 15:53

\$\begingroup\$ Try an experiment with a small flashlight and a ping pong it is impossible to not see the flashlight except during an eclipse \$\endgroup\$

Commented Jul 31, 2018 at 11:55 \$\begingroup\$ This is why it is a bad idea \$\endgroup\$ Commented Jul 31, 2018 at 12:08 \$\begingroup\$

You can put a microphone in each corner and triangulate the position based on the relative time delay from the bounce. In a silent room, where only the bounce is audible, simple comparator analog front end down stream is all that is needed to detect the bounce. The first microphone sets off a timer/counter in the microcontroller. The count/time that lapses when the other microphones report the bounce feed into the triangulation algorithm which is fundamentally calculating the speed of sound in the local environment. Your resolution will be limited to how fast the microcontroller can sample the inputs and how well the system is calibrated.

In a nosier environment, you can include some analog filtering in the preamplifier tuned to the "ping" of the ball hitting the table. This will help discriminate a bounce from ambient noise and mitigate false bounce detections.

In a really noisy environment (an arcade where children are running around in the background going crayyy-z), your going to need a more exotic solution such as dedicated DSP and possibly noise-canceling technologies.

If you're married to the "grid of IR beams" idea, this could be realized too. Less elegant and more clunky (more sensors, hardware, they only work "line-of-sight" so you're constrained on placement). Nevertheless, you're going to need lenses on your emitters - the beams diverge rapidly influencing ALL the sensors on the far side. So you're going to want to shape the beams so that they are laser-like, that is, they only interact with their respective receiver. Then, with proper spacing of the sensors, you run the signals into GPIO's of the microcontroller. You will likely need a few GPIO expander chips to accommodate many sensors. Your positional resolution is directly related to your grid density. The intersection (or average intersection if multiple beams were broken for a tight grid) indicate the hit. The upside of this approach is it is acoustically immune to the screaming kids in the background going crayyy-z.