Ir sensors

Hello All, I am new to this forum. I am patiently waiting on my first Arduino board and I was wondering if I could get some advice on how to go about using IR sensors to turn on an led. But my problem that I have right off of the bat is that I need to have 128 nodes as I will call them ( the node consists of 1 IR LED, 1 IR photodiode, and 1 LED ). I need the IR sensor to turn on the led in that node and have 128 nodes. Any advice would be greatly appreciated.

Thanks
Kal

Are you also new to electronics?
That is a lot of input and output you need. Sure you can do it with shift registers, with each shift register chip being able to do 8 inputs or outputs depending on the shift register type. These are chained together, you need three chains, one for each of your different types of nodes.
However with so many chips you can't use solderless bread board it has to be soldered up and you have to supply proper decoupling on each chip.

Yes I am new to electronics. Hobbiest. So what do you mean by 3 chains?

Thank you for the response

If you want to drive 128 IR LEDs, 128 indicator LEDs, and read 128 photodiodes...
Then you need to control 3*128 I/O pins.
That could be done with three shift register daisy chains.

It would be wise for a beginner in electronics to start with one node,
after you have done several examples from the IDE.
Leo..

One shift register will give you 8 extra inputs or outputs depending on the shift register type. If you want 16 then you have to wire two shift registers together to form a chain. For each extra shift register in the chain you get another 8. You need three such chain.
See Shift Registers - SparkFun Learn for how to use one type of shift register.

You will not be the first beginner who wants to do way more than their ability level as a first project.

Is this for some kind of interactive wall or table? The ir led & sensor detect an object and the visible leds light up in response?

You may be able to reduce the complexity of the circuit by arranging your nodes into a matrix and using a method called multiplexing. This makes the software/sketch/code more complex, but it is usually worth it.

To multiplex, you would divide your 128 nodes into 8 columns and 16 rows, or vice versa. The circuit would scan the rows or columns one at a time, in 8 or 16 steps. Let's suppose you scan 16 columns in turn. In each column you have 8 ir leds, 8 ir sensors and 8 visible leds.

Using a Mega, you would need 16 digital outputs to drive the columns, probably via transistors because of the current required. Also 8 digital outputs for the visible leds and 8 analog inputs for the ir sensors. Maybe 8 outputs for the ir leds, although you could maybe have those on full-time.

Yes this is a table PaulRB. Thank you again for the responses!! I planned on have the IR Leds on full time and just have the IR photodiodes and LEDS controlled by a Arduino.

Thank you for the link Grumpy_Mike!!

I planned on have the IR Leds on full time and just have the IR photodiodes and LEDS controlled by a Arduino.

That can be problematic. What happens is that the IR light from the LEDs leak onto adjacent detectors. The way round this is to only turn on the IR LEDs one at a time and look at the sensor you expect to pick it up from. That way their is no problem with light leakage.

Grumpy_Mike:
That can be problematic. What happens is that the IR light from the LEDs leak onto adjacent detectors. The way round this is to only turn on the IR LEDs one at a time and look at the sensor you expect to pick it up from. That way their is no problem with light leakage.

Good point, Mike, but one ir emitter at a time would mean a very slow 128-step scan, wouldn't it?

What about, using my matrix suggestion, 8 ir emitters are on at once, but the "rows", or groups, are staggered, so that no two adjacent (or even close) emitters are on at once?

Group 1:

*---------------
----*-----------
--------*-------
------------*---
*---------------
----*-----------
--------*-------
------------*---

Group 11:

----------*-----
-------------*--
-*--------------
-----*----------
---------*------
-------------*--
-*--------------
-----*----------

This would be just a matter of wiring, no more complex in terms of the circuit. Possibly no more complex for the code, either, depending on the illumination patterns desired.

but one ir emitter at a time would mean a very slow 128-step scan, wouldn't it?

Not really if you look at the response time of your specific IR sensor.

However your idea of a matrix is a lot better than a bunch of shift registers. All though with a matrix for the display LEDs you would have to keep up the multiplex rate.

I recon the best bet is a multiplexed IR LED and IR sensor and use a WS2812b strip of LEDs for the visual display.

I would like the nodes to look something like this.

○ ●

IR LED----> ○
IR Photodiode----> ●
LED----> □

So... In a triangle? I must be missing your point.

Yes.....that is what I am calling one node I guess. That will be in one square of the table

PaulRB....the * in your post would be one triangle as we will call it.

The way the parts are physically arranged has no bearing on the way they are electrically connected.

Question: you want the led to light when the ir sensor in that node senses an object? Is that the only mode of operating?

If so, perhaps no Arduino is needed. If you use suitable photo-transistors in place of photodiodes, or an ordinary transistor connected to the photodiode, perhaps they could drive the led directly. Each node would operate independently. The ir illuminators would be constantly on, so you would have to take physical measures to prevent nearby nodes from being triggered accidentally.

My suggestion would be to start small, since this is your first project. Get one node working on a breadboard. Then ask for advice on a multiplexing circuit (if that is even needed).

No Arduino necessary if it's a simple table that lights up under objects. But if you're going to build such a thing, might as well throw in an MCU so you can play patterns and animations. Ripples out from the object and other such fanciness.

But yeah, I'm assuming you saw this done on some Youtube vid or something, care to share which project you're imitating?

I have made a circuit on a breadboard without using a microcontroller. I am confused as how to make multiplexing work though. Any suggestions on code and literature to learn about multiplexing would be much appreciated. I like the idea of multiplexing as there would be less chips involved.

INTP..
I am unsure which youtube video I watched sorry.