Is it possible to attach 100 photocells to a arduino

For a school project i have interface 100 photocell (photoresistor) I have a bunch of cd4051s lying around but since its only 8 channel and the arduino has only 6 analog pins do i have to use another arduino as well or is there another option.
And comes the problem if there is a way by multiplexing the multiplexers (which seems possible but i figured out i dont have enough digital pins to do it).

any reply would be very helpful.

Use analog multiplexers.

iam using cd4051s

You'll need to cascade the muxes, too.

I am using cd4051s as muxes

I read that. But they are 3 bit aka 8 inputs, so you need to cascade them, 3 levels deep.

oh ok

The article linked in reply #2 suggests a much better option.

In the place where i live i have to wait for months until a 16 channel multiplexer could be delivered

Definitly. But sometimes you have to take what you have.

What about:

Each first level MUX selects 1 of 8 second level MUXes. That's 64 analog inputs on one Arduino pin. Doubling gives 128 analog inputs. You just have to keep track in software which channel you're looking at.

Use an additional 4051 to distribute a 0 to the INH signal (otherwise pulled up, to turn the muxes off) of (up to) 8 additional 4051s based on three digital outputs of the AVR, and then feed their tied-together outputs into an analog input. That gives you up to 64 sensors per analog input...

I think that might work

(You could use a logic decoder like the 74HC138 instead of a 4051 for the INH signals, and you wouldn't need the pullups. My suggestion assumed that you ONLY had 4051s...)

Seems a poor solution for old CD4051 chips. Specs (speed, 'on' resistance) are worse than the more commonly used 74HC4067. Several banks (as many analogue pins as you have spare), and using the INH pin seems a lot better.

Can't you use a 96 LDR grid instead of 100.
Leo..

no it should be over 100, so the best option is 106.

Why 106.
96 (4 * 3) or 120 (5 * 3) seems easier and more logical to code.
5 analogue inputs, with 3 chips per input. Or 3 analogue inputs with 5 chips each.
Unless you have access to a Mega. then you can put one chip on each analogue input.
In that case it won't matter if you have 13 chips (104 inputs).
Leo..

yea i get your point but i dont want my code to be very complicated and the responsiveness also matters so i would have to use a nano and a uno.

Aehm, 128 is not much different than 106 ...

yea but that consumes more power so the batteries would die quickly.