user33787: For a project I need 400-1000 pins controlled by one arduino. Each pin should work similar as arduino pin, so something like 5V, 90mA. Is using dozens of shift registers a good idea? And what power source should I connect?
My idea is following:
So one shift register requires 3 input pins to control it, and if one shift register has 12 output pins, I can connect 4 more shift registers to one shift register. Is it a good idea and will it work?

user7508: You don't connect shift registers as a tree. That would be awfully slow.
Instead, you connect them as chains. Shift registers are meant to be
chained by connecting the serial out of one register to the serial in of
the next one, while both registers share the latch and clock lines. You
can chain as many as you want this way: a chain of four 8-bit shift
registers behaves like a single 32-bit shift register. See for example
this Arduino tutorial on the
595 to see how the
chaining works.
There is an issue, however, in making long chains: whenever you want to
change the state of one single output you have to shift the whole chain
again. And the longer the chain the longer it takes. Thus it is more
efficient to put in a single chain outputs that you will likely want to
change together, and use independent chains for outputs that are most
likely going to change at different times.
As for the wiring, you need three Arduino pins to drive one chain of
registers: data, clock and latch. But you can share the data and latch
pins between many chains, as long as you have a dedicated clock pin for
each chain. You should then be able to drive n independent chains
using n + 2 Arduino outputs.
As for the power, you have to estimate your power consumption (not just
the shift registers, but also whatever they are sourcing current into)
and find a 5 V power supply big enough to power your whole circuit.

33787: <p>For a project I need 400-1000 pins controlled by one arduino. Each pin should work similar as arduino pin, so something like 5V, 90mA. Is using dozens of shift registers a good idea? And what power source should I connect?
My idea is following:<a href="https://i.stack.imgur.com/RCvqA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RCvqA.png" alt="enter image description here"></a></p>

<p>So one shift register requires 3 input pins to control it, and if one shift register has 12 output pins, I can connect 4 more shift registers to one shift register. Is it a good idea and will it work?</p>
 7508: <p>You don't connect shift registers as a tree. That would be awfully slow.
Instead, you connect them as chains. Shift registers are meant to be
chained by connecting the serial out of one register to the serial in of
the next one, while both registers share the latch and clock lines. You
can chain as many as you want this way: a chain of four 8-bit shift
registers behaves like a single 32-bit shift register. See for example
this <a href="https://www.arduino.cc/en/tutorial/ShiftOut" rel="noreferrer">Arduino tutorial on the
595</a> to see how the
chaining works.</p>

<p>There is an issue, however, in making long chains: whenever you want to
change the state of one single output you have to shift the whole chain
again. And the longer the chain the longer it takes. Thus it is more
efficient to put in a single chain outputs that you will likely want to
change together, and use independent chains for outputs that are most
likely going to change at different times.</p>

<p>As for the wiring, you need three Arduino pins to drive one chain of
registers: data, clock and latch. But you can share the data and latch
pins between many chains, as long as you have a dedicated clock pin for
each chain. You should then be able to drive <em>n</em> independent chains
using <em>n</em>&nbsp;+&nbsp;2 Arduino outputs.</p>

<p>As for the power, you have to estimate your power consumption (not just
the shift registers, but also whatever <em>they</em> are sourcing current into)
and find a 5&nbsp;V power supply big enough to power your whole circuit.</p>
