High voltage drop on Nano outputs caused by sketch

There's something wrong with your circuit. it does not match your description.