Circuit for autoregulating an oscillation frequency of an oscillating mechanical system (2, 3), wherein the mechanical system includes a piezoelectric or electroactive polymer element capable of generating an alternating voltage (V P) following the oscillation of the mechanical system, the autoregulating circuit being intended to be connected to the piezoelectric or electroactive polymer element to adapt the oscillation frequency of the oscillating mechanical system, and the autoregulating circuit comprising: - a rectifier for rectifying the alternating voltage (V P) generated by the piezoelectric or electroactive polymer element and for storing the rectified voltage in at least one capacitor (Cc) in order to supply the autoregulating circuit with electricity, - an oscillator stage, which includes an oscillating circuit connected to a MEMS resonator, to supply a reference signal (V R), - a means of comparison (12, 13, 14, 17) for comparing the frequency of the alternating voltage (V P) to the frequency of the reference signal (V R), - a frequency adaptation unit intended to be connected to the piezoelectric or electroactive polymer element to supply a frequency adaptation signal (V A) to the piezoelectric or electroactive polymer element on the basis of the result of the comparison in the comparison means (12, 13, 14, 17) in order to regulate the oscillation frequency of the oscillating mechanical system, the frequency adaptation unit being adapted to supply, as a frequency adaptation signal (V A), a continuous adaptive voltage (V A) to the piezoelectric or electroactive polymer element according to the result of the comparison in the processor unit, and wherein all the electronic components of the autoregulating circuit are grouped together to form a single electronic module, characterized in that the comparison means (12, 13, 14, 17) includes a first alternation counter for counting a first number of alternations of the alternating voltage (V P) of the piezoelectric or electroactive polymer element in a first determined time period and for supplying a first counting signal (N P), a second alternation counter for counting a second number of alternations of the reference signal (V R) supplied by the oscillator stage in a second determined time period and for supplying a second counting signal (N R), and a measuring window arranged between the first alternation counter and the second alternation counter so as to determine the counting time for the second alternation counter partly on the basis of the first time period proportionately adapted to the counting time of a determined number of alternations counted by the first alternation counter in the first counting signal (N P), and a processor unit for comparing the first counting signal to the second counting signal so as to control the frequency adaptation unit on the basis of the result of the comparison, said measuring window being configured by configuration parameters supplied by the processor unit so as to determine the second counting time period for the second alternation counter while taking account of the first time period. - a rectifier for rectifying the alternating voltage (V P) generated by the piezoelectric or electroactive polymer element and for storing the rectified voltage in at least one capacitor (Cc) in order to supply the autoregulating circuit with electricity, - an oscillator stage, which includes an oscillating circuit connected to a MEMS resonator, to supply a reference signal (V R), - a means of comparison (12, 13, 14, 17) for comparing the frequency of the alternating voltage (V P) to the frequency of the reference signal (V R), - a frequency adaptation unit intended to be connected to the piezoelectric or electroactive polymer element to supply a frequency adaptation signal (V A) to the piezoelectric or electroactive polymer element on the basis of the result of the comparison in the comparison means (12, 13, 14, 17) in order to regulate the oscillation frequency of the oscillating mechanical system, the frequency adaptation unit being adapted to supply, as a frequency adaptation signal (V A), a continuous adaptive voltage (V A) to the piezoelectric or electroactive polymer element according to the result of the comparison in the processor unit,