The Ferarri book yalks about some ways to add input or output ports. The option that looks most promising to me is detailed at (URL) that site: "I'm very Pleased to announce that my latest project the '(MS)2 Expander' will expand your RCX's ports (...) (22 years ago, 3-Jul-02, to lugnet.robotics)
I have chased this topic around quite a bit in the last couple of years and built a few prototype devices to perform "I/O expansion". My final conclusion, having gone to the trouble of building a device which permits two of the RCX motor ports and (...) (22 years ago, 5-Jul-02, to lugnet.robotics)