So I want to make an Arduino project with 200 outputs, each output would have to be capable of a simple 5v output (same as digitalWrite HIGH on the arduino) but there would only be a max of 2 on at the same time.
My current plan is to use 25 SN74HC595N 8 Bit Serial in/Parallel out shift registers all daisy chained.
I just wanted to check there wasn't a blatantly better way to go about this?
All that we know is that you want 200 outputs, nothing about what the outputs do or what they will drive so it is hard to give intelligent advice. This is kind of a XY problem.
25 74HC595 would work. HC595 will not output 20mA on all outputs like a '328P can, will that be an issue?
Make sure you have a 0.1uF cap (100nF) on each chip's VCC pin to Gnd.
You may want to use a buffer chip to drive SPI and slave select (MOSI will go to the first chip, then chip to chip after that, such as 74AC125, so a single Arduino pin is not driving all the capacitance of the wiring and the 25 inputs.
Maybe split up into 8,8,9, or 12, 13.
I did 45 TPIC6B595 (open collector outputs) with a buffer for each 9 chips, worked well to keep clean signals.
Depending on the actual, not described final action, using a 16 ROWs times 16 COLs only 4 of SN74HC595N 8 Bit Serial in/Parallel out shift registers could work working in a multiplexed way.
Multiplexer will only work if you load can stand having a PWM drive it. But as you haven’t said what your load is then we can’t answer.
Chaining 25 shift registers together is not a simple matter. Scaling up requires a different skill set that just making the same thing over and over. Layout is important as is buffering signals and supply decoupling. It is not something you can make on acres of Solderless bread board, it needs to be soldered up.
You may want to look into the higher current shift register TPIC6C595. They may be able to directly drive "bare" relays (they can sink up to 250mA). If you are using relay modules with built it drivers the previously mentioned parts would work.
Can the SN74HC595N not work in conjunction with a 1k current limiting resistor and a MMBT4401WT1G transistor just like you would use with the normal Arduino outputs. (Yes with a diode across the coil).
I guess what I was really asking is, are there any shift registers commonly used that are more than 8-bit which still only require the small amount of I/O from the Arduino.
I thought the 25 shift registers was a good idea and I would just have to learn how to make it work, but I didn't want to do that and then find out I could have used two 100-bit shift registers (don't exist but you get my point).
Yes, 5V / 500 Ohms = 10mA but that seems low for a relay. Can you post a data sheet for the relays?
The rule of thumb for a bipolar junction transistor switch is to have the base current to be 1/10 of the collector current. The absolute max output current for a 74HC595 pin is 35mA. Probably wise to limit the current to 20 to 25mA. The base resistor would be more like 180 to 220 Ohms. So if the relay coil current is less than 250mA those transistors should be OK. And yes, the diodes across the coils are required.