In a pedometer device for detecting and counting steps of a user on foot,
an accelerometer sensor detects a vertical acceleration generated during
the step. A processing unit, connected to the accelerometer sensor,
processes an acceleration signal relating to the acceleration in order to
detect the occurrence of a step, and in particular compares the
acceleration signal with a first reference threshold. The processing unit
automatically adapts the first reference threshold as a function of the
acceleration signal. In particular, the processing unit modifies the
first reference threshold as a function of an envelope of the amplitude
of the acceleration signal.