Array of optoisolators?

(bump update)

I've managed to get this working, and it seems to be fairly useful, so I thought I'd share.

For each "module" I used a single 74HC595 and a pair of PS-2501-4; I can control 8 switches with 5 lines (ground, power, gate, latch, data) from the Arduino.

I'm using code from http://www.arduino.cc/en/Tutorial/ShiftOut to drive the 74HC595.

The output pins drive the PS-2501-4 optoiosolators; common ground on the input side, 16 pins out to another card with device-specific wiring on the output side. With the output side of that I should be able to drive an bunch of pretty much any sort of switch. My test case is a musical keyboard with a matrix switch - 5x8.

If I then pass ground, power, gate, latch from the arduino and data out from the 74HC595 to another duplicate circuit, I can get 16 outputs from the same 5 inputs; I believe this can be extended with more "modules".

Right now this is soldered onto breadboards with lots of cross-wiring; eventually I'd like to learn how to etch circuit boards but I haven't gotten there yet (I still don't understand how to optimize the wiring to design a board with a minimum of cross-overs). Actually if this worked and were correct I'd sort of like to have a bunch of them made up SMD in China or something. I know it's something that's useful to me (I like to be able to pull the buttons/keyboards off devices and drive them from the Arduino without having to reverse engineer the entire device).

I'm not certain that I should be driving the 2501 directly from the 595 - I know there's an LED inside there, so it seems as if I should be resisting, but I'm not; maybe it's fine or maybe I'm burning the optos; I know I should be able to determine from the datasheet, but I'm not grokking it.

I'd also like to add indicator LEDs to each of the 595 output pins (with a switch that turns them on and off). Should be easy enough if the 595 is providing enough volt/amp out.

If anyone has any suggestions I'd appreciate the feedback. Wiring diagrams and pictures if I can remember to post them tonight.