Unwanted shut down of outputs.

Grumpy_Mike:

Evening i will try to post my circuit as well.

While you are at it, modify that last post. Select the code and hit the # icon then save it.

Your sketch can not cause the arduino to reset.
Is it close to a interference source like a motor or switching thermostat?