Explosion-proof linear position sensor