Using arduino inputs more reliably

A schematic or even a block diagram would add a lot to this conversation.