So I have this relay board, http://yourduino.com/sunshop2/index.php?l=product_detail&p=218, hooked up to my arduino mega. When I run the program without a load going through the relay everything works just as it should, but when I connect a load to the relay it runs fine for a few cycles and then things freeze when the relay actuates. I'm using the relay to actuate another coil that's on an air solenoid that operates on 120VAC and according to the multimeter it pulls about 1.12 amps.
This is probably due to an inadequate power supply and/or poor circuit shielding, allowing transients from the AC circuit to get into the Arduino. How are you powering and switching the relay coil connected directly to the Arduino? A circuit diagram would help.
The problem only occurs when the relay with a load on it is switched on, if I run the program without anything connected to the relays they switch on and off exactly as planned. I also discovered that if I run dc current through the relay it does just fine and that it's only 120vac that disrupts the process. I'm working up a diagram for you guys but in the mean time here's an explanation of what I have going on... The device is a simple stepper motor control for automating a rotary table for a small cnc mill (a true 4th axis is prohibitively expensive for what I'm using it on, I just need it to index a coupling for drilling holes) the program moves a stepper motor a specified number of turns when cued by a M code which also tells it to release a pneumatic brake via the first relay, it then sends a "finish" signal via the second relay which tells the machine to drill the next hole. Everything runs off a 24vdc switching power supply capable of 15 amps, I have a step down transformer which takes the 24 down to 9 for the arduino and the brake solenoid draws from the 120vac input going to the power supply. I have the power supply and the solenoid grounded to the enclosure which is also grounded through the outlet.