KeithRB:
Unlikely. We need your schematic.
Do you:
Have lots of bypassing?
Seperated the power for the arduino and the relays?
Put diodes on the relays?
Tried opto-isolating the relays?
You were right, completely disconnecting cable from pin 2 stops these interrupts caused from lights etc.
Sorry, im a noob, what do you mean by "bypassing"?
I have separate adaptor for each of them, but they share the same mains outlet.
On the relays directly no, no diodes, since I cant do much within the machine http://shrani.si/f/10/142/FnimS4J/2014-03-31-205949.jpg http://shrani.si/f/3Y/vn/2BwZzEJ1/2014-03-31-210002.jpg (please ignore that GND on one of the pins), these relays were made to turn on 220V big solenoids (with diode bridge in between). I was hoping that the diode I have put before optocoupler would help. I also have 2 additional ordinary brushed motors connected to the relay and the 3V power supply, but putting diodes across them didnt help.
Im afraid that for now I cant opto-isolate the relays without disassembling the machine, but in later stage I might replace the relays with optocouplers (modify the machine).
I must also say that between relay and optocoupler there is 2m of wire.