In one embodiment, a medical instrument tracking system includes a medical instrument including a handle and different interchangeable heads for insertion into the handle having a handle position-tracking transducer disposed thereon, different respective ones of the interchangeable heads having differently positioned respective head position-tracking transducers disposed thereon so as when the different respective ones of the heads are inserted into the handle, the different respective head position-tracking transducers define different respective positions relative to the handle position-tracking transducer, and processing circuitry to receive signals generated by the handle position-tracking transducer and the respective head position-tracking transducer of a respective one of the heads inserted into the handle, compute a relative position between the handle position-tracking transducer and the head position-tracking transducer of the inserted interchangeable head, and identify which interchangeable head is inserted into the handle responsively to the computed relative position.