Quoted from gweempose:I wonder if ferrite cores would do the trick as well.
That was my thought too. If it's RFI/EMI from the surrounding electronics then a ferrite core will definitely work. I need to get my digital probe on the optos and see what signals they are registering. IIRC, the opto receiver just registers a logical "high" when it 'sees' light and a logical 'low' when the beam is interrupted. I am not quite sure how the logic board could misinterpret that. In the logic-days-of-old, there is either +5v (or -5V) as a logical high and 0v when a logical low. Presumably when the opto receiver sees light, it conducts electricity and when there's no light, it doesn't.
The twisted pair works because noise such as EMI/RFI would travel down both conductors equally. When you twist them together the 'positive' magnetic field generated on lead number 1 by the emi/rfi will be cancelled out by the 'negative' magnetic field on lead number 2. The noise like that tends to ride 180 degrees out of phase on the leads and therefore will net out to zero when twisted like that.
As an additional step, I'd probably throw ferrite beads on the leads from the opto receiver board back to the cpu.