Encoder with hall effect and reed relays, and decoder gives absolute position