# how to wire together multiple photoresistors to make one big sensor?

I'm using an esp32 dev board, and a bunch of 5v laser diode emitters pointed an equal number of photocell resistors across a plane. The goal is only to detect when any two or more beams break at the same time.

I could try to wire up one resistor per pin (the 32 has 18 analog pins), which I know enough to do on my own, but that feels stupid. I feel like there is a smarter way to just wire up the photocells so that any simultaneous break of two or more beams will result in a net change that is big enough for me to read on one pin.

To be clear, I don't care when 0 or 1 beam breaks, only 2 or more.

Is there a way for me to wire together the photocells (series? parallel?) so that I can then test what 0 breaks reads at, what 1 reads at, and then act on 'whatever 2 or more breaks' reads at? What would that circuit look like?

• photo resistors are relatively slow to respond to a change in light intensity .... what response speed do you need? – jsotola Nov 1 '18 at 17:49
• why don't you arrive at the solution experimentally? .... wire together the photocells (series? parallel?)  .... do each of those and use an ohmmeter – jsotola Nov 1 '18 at 17:52
• Search for light fence circuits, you can see how this has been done many times before. I think many systems sequentially switch one LED on and read the corresponding sensor at speeds high enough to appear simultaneous to a moving hand reaching into a hydraulic press or whatever. – KalleMP Nov 1 '18 at 19:48

I would take the following approach:

• Measure the resistance of one device with laser absent and laser present. You will have two readings.
• Mathematically model the circuit with all photo-resistors lit and then with two dark.
• See if you think you can create a potential divider that will allow you to reliably detect the difference in voltage between those two states.

Post your readings and calculations in your question if you get stuck.

You will improve the rejection of ambient light if you add filters to the sensors. The filters should pass the laser wavelength - typically red - and block others.

• I don't think the on/off resistances will be stable enough (for instance under ambient light variations) for this approach. – Wouter van Ooijen Nov 1 '18 at 18:13
• Agreed, but there is no mention of whether the environment is controlled or not. – Transistor Nov 1 '18 at 18:25
• @Transistor does this method get more accurate and less susceptible to ambient light diffs, if I use fewer photo-resistors? If so, I can probably do it in 'banks' of resistors once I find the sweet spot through experimentation. Does that approach make sense? – 3z33etm Nov 1 '18 at 18:53
• @Transistor my lasers are 650nm, and I found several sources for 650nm filters for just a few dollars, so I will do that as well. – 3z33etm Nov 1 '18 at 18:54