Arduino resets when relays deactivate if analog inputs are connected

I have attached another wire diagram with added labels. I also moved a few things around to hopefully make it easier to follow.

Here are the components:
4 Channel Relay Board

2 Channel Relay Board

Current Sensor