Skip to main content
1 of 2
gbulmer
  • 10.1k
  • 21
  • 29

Some answers have explained how to 'multiplex' the emitters and sensors. The scheme suggested here can use that, or not. For emitters there is no need if the sensors are well isolated from the emitters.

You seem to be very cost conscious, as am I. The cheapest way to make a simple reflective sensor is with an InfraRed (IR) emitter and IR phototransistor. That pair will be well under 0.20GBP, which is much lower cost than the TCRT5000.

For example 940nm 5mm IR emitter 940nm 5mm IR phototransistor. Most distributers should have parts in this price range. To give some context, these would cost about £4.60 for 100 IR emitters, and £7.50 for 100 phototransistors.

You could drive the IR emitters with a chain of shift registers. Use 'Serial In Parallel Out' (SIPO) shift registers. They will take a serial data pattern to choose which emitters to drive. That would consume three or four pins (clock, data, enable, latch) for all 100 emitters. For example TLC5916

If the internal structure of the board shields IR phototransistors from IR emitters you could even drive many emitters simultaneously using each pin of a chip like the TLC5916 which would drive much more current than an Arduino pin. So you might be able to drive all of the emitters with a couple of TLC5916.

With a bit of experiment, you should be able to read all of the sensors using simple logic-level shift-registers too. Parallel In, Serial Out (PISO) shift-registers. The issue is not power, so cheaper parts are sufficient, for example a 74HC165 (which should be available for under $1). These can be 'chained' end to end, and even used with a multiplexing scheme.

gbulmer
  • 10.1k
  • 21
  • 29