• Well, I'd have said the HMC5883 should work fine. It'd be worth some experimenting.

    The digital caliper is an interesting idea - it might also be possible to create your own 'digital linear encoder'... Basically a PCB with a pattern of conductive areas:

     # # # # # # # #
      ##  ##  ##  ##
        ####    ####
            ########
    

    You could hack something out of a bit of protoboard, or could even use black markings and those IR reflectance sensors.

    Then you just read the 4 'bits' and you have the distance in binary.

About

Avatar for Gordon @Gordon started