Measurement of a leading edge of an instrument passing from a first medium having a first density to a second medium having a second density using a displacement sensor alone. In particular, a displacement signal, a velocity signal, and an acceleration signal measured from or derived from a displacement sensor are analyzed to determine when the leading edge of the instrument passes from the first material to the second material as the leading edge of the instrument is advanced relative to the material. For instance, the measurement may be used to output an occurrence signal that indicates to a user that the instrument has passed from the first medium to the second medium. Additionally, a length measurement of the path of the instrument when passing from the first medium to the second medium may be recorded, and/or the instrument may be controlled (e.g., the instrument may be stopped).