A position detector for a mobile pin , the pin being carried by an edge belonging to a pivoting sash or to a frame of a framework such as a door, window or shutter, the detector comprising: - a housing , which is attached to the edge ; - a rod , which comprises a sensing end , extending outside the housing , and an inner end , extending inside the housing , the sensing end and the inner end being traversed by a longitudinal axis (X20) of the housing , the rod being configured to be moved in translation with respect to the housing along the longitudinal axis (X20), in a translational path (C22) by the action of the pin on the sensing end , the translational path (C22) comprising a plurality of distinct ranges (C221) of positions of the rod , at least one of those ranges (C221) constituting a critical range (C221); - sensors , contained in the housing , each sensor having a state whose value varies as a function of the translation of the rod , each range (C221) being associated with at least one of the sensors , in that the state of that sensor is affected when the rod is positioned in that range (C221), the critical range (C221) being associated with at least one critical sensor (99A, 99B; 99C), among the sensors ; and - an electronic analyser , which detects in which range the rod is positioned, according to values taken by the respective state of the sensors ; characterised in that , for each critical range (C221), the electronic analyser is configured to perform a detection of a change in the direction of translation of the rod with respect to the housing , along the longitudinal axis (X20), while the rod is positioned in said critical range (C221), the electronic analyser performing the detection on the basis of the values of the state of said at least one critical sensor (99A, 99B; 99C) associated with said critical range (C221). - a housing , which is attached to the edge ; - a rod , which comprises a sensing end , extending outside the housing , and an inner end , extending inside the housing , the sensing end and the inner end being traversed by a longitudinal axis (X20) of the housing , the rod being configured to be moved in translation with respect to the housing along the longitudinal axis (X20), in a translational path (C22) by the action of the pin on the sensing end , the translational path (C22) comprising a plurality of distinct ranges (C221) of positions of the rod , at least one of those ranges (C221) constituting a critical range (C221); - sensors , contained in the housing , each sensor having a state whose value varies as a function of the translation of the rod , each range (C221) being associated with at least one of the sensors , in that the state of that sensor is affected when the rod is positioned in that range (C221), the critical range (C221) being associated with at least one critical sensor (99A, 99B; 99C), among the sensors ; and - an electronic analyser , which detects in which range the rod is positioned, according to values taken by the respective state of the sensors ; characterised in that , for each critical range (C221), the electronic analyser is configured to perform a detection of a change in the direction of translation of the rod with respect to the housing , along the longitudinal axis (X20), while the rod is positioned in said critical range (C221), the electronic analyser performing the detection on the basis of the values of the state of said at least one critical sensor (99A, 99B; 99C) associated with said critical range (C221). <EOS>