Why are you using a GPIO to feed the nail sensor? Wouldn't a constant 3v3 be better?
You could perhaps use two GPIOs, one to each nail via its own resistor, and one output low with the other output high, and use the A-D in differential mode.
Then regularly swapping the low and high around could reduce electolysis problems.
And, as mahjongg says, DON'T use 5v Anywhere!