Hello I am trying to create a grid bed of 120 Infrared KY-008 laser sensor modules (60 on each side) to track participant position in an installation. How many modules can I connect to one Arduino? And which Arduino will allow me to connect the most modules?
I just need 1/0 analog data about whether the individual sensor is being blocked or not.
For digital signals you could use 16 MCP23017 (I2C) or MCP23S17 (SPI) GPIO expanders to connect up to 128 sensors to an Arduino. The I2C versions need 2 pins, total, for any number (up to 8) of MCP23017. The SPI version needs 3 common pins (SCK, MOSI, MISO) plus 1 chip select pin for each chip.
Understood. Thank you. If i understand it correctly, then, will it be practical to run all 120 sensors onto 15 MCP23017s onto 2 MCP23017s onto 1 Arduino?
I'm not sure using that would be necessary. But if it is, then because @massakalli wants to use 120 sensors, one of the MCP23017 would have 8 unused inputs. Those could be used to connect the 7 interrupt pins of the other 7 MCP chips. The interrupt pin of that 8th MCP chip could be connected to an Arduino interrupt pin. When an interrupt occurs, the Arduino can read the 8th chip first. This will enable the code to know if one of 8 sensors has changed, or which of the other 7 MCP chips's interrupt pins has been triggered. The Arduino can then go read that/those MCPs only. This could mean having to read only 1 or 2 chips to figure out which sensor has changed, rather than reading all 8 chips.
Consider the 74hc165 idea also. It's much simpler and may be faster, because although it will need to read all 15 chips on a frequent basis, you can use the hardware SPI port of the arduino, which is much faster and more efficient than i2c. Also the 74hc165 chips will probably be much cheaper than the MCP chips.
FYI
Digikey lists 15 x 74HC165 at $15.90. 8 x MCP23S17 at $14.24. The MCP23S17 is SPI so can run at up to 10MHz (if the processor is capable). MCP23S17 also has pin change interrupts and internal pullups per pin if that is desirable. Downside is the 8 chip selects required.
Each laser module is powered by 5 volts 300 mA. So with 100 laser modules you have 100 * 0.3 amp = 30 amps. You need a 5 volt supply capable of 30 amps plus an overhead so figure close to 40 amps.
Uh Oh, a big my bad. Each is about a 30 mA load so 3.0 amps for 100 LASERS. You can get a 5 amp 5 volt supply inexpensive.