Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardware

Step Counter

Pedometer running on an STM32 Nucleo with an LSM6DS IMU and SSD1306 OLED display.

How Step Detection Works

Detection graph

Raw accelerometer data is noisy, so it goes through a moving average filter first. Then I compute the magnitude of the 3-axis acceleration vector and look for peaks above a threshold.

Added hysteresis to prevent double-counting - a step only registers on the rising edge, and there's a minimum time between valid steps. Without this, running triggered 2-3x the actual step count.

What It Shows

  • Step count
  • Distance (km or yards, user toggle)
  • Daily goal progress
  • Buzzer alert when you hit your goal

The joystick navigates menus and a potentiometer sets the step goal.

Modules

Performance

Everything runs in a main loop polling at fixed intervals. Measured each task's execution time to make sure nothing misses deadlines:

Task Rate Time
Button scan 300 Hz 27 µs
Display update 4 Hz 637 µs
Serial output 500 Hz 768 µs

Total CPU load sits around 40%, plenty of headroom.

Serial output is the heaviest - would use DMA in a v2 to free up cycles.

About

Step counter w/ IMU implemented on STM32 Nucleo Board

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages