position detection

Not sure I quite understand what you want to do. The print head of a printer is controlled by a stepping motor, therefore to have it go where you want just let the Arduino give the appropriate number of pulses to the motor. There is no need to sense the position.
However, I am not sure what you want to do when it is at the right fret. I assume hold down the string while you play it? That is likely to be a bit difficult mechanically wise. Also I am not sure the whole thing is fast enough to actually play something.

I don't play the bass but my son does.
Check out one of his songs on:- Downtime - YouTube