Might be obvious but have you checked that you have the coil pins right on the relays? The relays should click when their coils are high, even without the AC hooked up-- easy to test safely with the relays switching a DC source. I've gotten confused a few times when a relay's pin configuration is symmetrical on its long axis-- I "tested" one in reverse and... it doesn't switch any more!
What relays are you using? Can you post a schematic?
I've tried every thing possible and these are my conclusions;
After checking the relays diode polarity, transistors and so on to infinity the problem still persisted to be a PROBLEM. The relay/s behaved like like mad!
Is then that I removed the sanguino and replaced it with a Freeduino. Same circuit on the same breadboard same wires and so on.
It worked!
So Sanguino is alargic to AC while Freeduino is NOT. To be fair Sanguino worked fine before applying AC to the relay switching part but freaked on power.
So definetly and I don't what is happening here but for sure Sanguino is allergic to AC.
My sanguino seems rock solid around ac. I wonder if you have a bad solder joint on the Sanguino PCB. If it was a kit, double check the soldering of all the connections. If that doesn't help or if yours was already assembled, contact your supplier and/or Zach at www.sanguino.cc
Is there ANY possible way that the RELAY COIL being energized can feed back into the Arduino's power supply as a SPIKE that is not filtered.
Is it possible to supply the power to the coils via common Ground and Separate Supply... like a battery... to test the theory that glitches are causing unreliable changes on the I/O pins.
You could try adding some additional BYPASS CAPACITORS on the Arduino MCU supply to help catch spikes. Maybe the Sanguino is more sensitive or has fewer caps.