Multiple PIR sensors not working properly

I am trying to automate my lighting throughout the house. I am running parallax pir sensors with an arduino MEGA, and a 8 relay BOB. If I run 1 sensor and relay all is well, but if I run more that I get strange issues. One relay turning off would turn on some relays at random. I tried a whole list of things and nothing has worked. I believe its interference when the magnetic field around the relay collapses.

The things I tried to fix this issue include:

  1. Separate power supplys for arduino and relays (this worked with a short cable run but the moment I run a longer cable to actually mount the pir on my ceiling is when that idea doesnt help.
  2. Torroids/chokes on a pir output
  3. using relay 1 and relay 8 to give a physical separation. ( no effect)
  4. putting relay outputs in the NC position and make the pin for the relay go LOW instead of HIGH when motion is detected.

The things connected to my arduino are as follows: 1. DHT temp/humidity sensor 2. Sainsmart lcd shield with keyboard 3. a photoelectric sensor to detect night 4. The pir sensors 5. 8 channel relay board

The cabling is messy with the AC lamp ( compact florescent lights) light switch wires being parallel with the PIR sensor output/power cable that is a simple unshielded telephone cable, so maybe this is my issue?

Please HELP!!!

Yggdrasil: The cabling is messy with the AC lamp ( compact florescent lights) light switch wires being parallel with the PIR sensor output/power cable that is a simple unshielded telephone cable, so maybe this is my issue?

That will put large voltage spikes on the sensors wiring, yes. You must not run sensor wiring parallel to high power wiring (or if you do you'll need industrial grade shielding on the sensor cables (shielded twisted pair at least) to reduce the effect.

I presume the relays switch some mains appliances and thus put spikes on the mains wiring (the transients will thus be hundreds of volts, some of which leaks to the sensors).

Another precaution is to call delay (20) after switching any relay so that your code doesn't try reading any sensor during the relay switching (assuming the relay switches in less than 20ms, adjust appropriately).