Hi,
Lots of confusion here....
Maybe start with this page:
http://arduino-info.wikispaces.com/ArduinoPower
Here is the actual schematic of these type of opto-isolated relays:
Here's a look at your type relay board connections:
IMPORTANT NOTE: There is a issue with start-up of Arduino programs that control these relays. All of these 2,4, or 8 relay boards input controls are Active LOW, meaning that setting a pin LOW turns them ON. To assure that no relays activate at Reset or Power-On until you want them to, the initialization sequence in SETUP should be:
digitalWrite(Relay, HIGH);
pinMode(Relay, OUTPUT
);
This design is intentional, so that it is possible to guarantee that at power-on of a system, or system reset, that no relays activate except when expected under program control. There may be pumps, lights etc attached and chaos could ensue if this was not controlled definitively for each output port being used.
NEXT: Resetting of the Arduino is often because of Electromagnetic Interference caused by the external devices connected. Here is a page with suggestions on approaching that:
http://arduino-info.wikispaces.com/RelayIsolation
When starting a new project it's a good idea to thing things through before making a lot of wires all over the workbench. Some suggestions here:
http://arduino-info.wikispaces.com/Arduino-Project-Planning-Electrical
Let us know how this all works out....