STEP COUNTING ALGORITHM USING THRESHOLD BASED TRI AXIAL ACCELEROMETER DATA

D. Rathnayake1*, P. Arawa2 and T. Ekanayake3

1University of Colombo, Colombo, Sri Lanka, 2,3Uva Wellassa University, Badulla, Sri Lanka

Session: Technical Session C

Abstract

Accurate step counting is a vital component of wearable fitness trackers, enabling effective physical activity monitoring and promoting healthy lifestyles. This paper presents the design and implementation of a threshold-based step detection algorithm using tri-axial accelerometer data, integrated into a wearable prototype device named MoveMate 1.0. The primary objective of this work is to develop a lightweight, energy-efficient algorithm capable of reliably distinguishing between walking and running steps in real-time, using minimal computational resources. The algorithm processes acceleration data from an MPU6050 sensor by calculating the Euclidean norm of the x, y, and z components to determine motion magnitude. Step detection is achieved by identifying significant magnitude changes that surpass predefined thresholds. Separate thresholds are assigned for walking and running modes, which can be toggled by the user through a mode-select button. A debounce interval of 300 milliseconds is incorporated to prevent multiple detections from a single step or motion noise. MoveMate 1.0, built around an ESP32 microcontroller, features an OLED display for live step count feedback, a DHT11 sensor for ambient temperature and humidity monitoring, and a rechargeable battery with an integrated voltage monitoring system. Data are transmitted via Wi-Fi using the MQTT protocol, while SPIFFS handles offline data storage during connectivity loss. All sensor readings, including step count and environmental data, are synchronized with Firebase upon reconnection. Testing under real-world walking and running conditions confirmed that the algorithm accurately identified step patterns and effectively rejected false positives due to hand movements or sudden acceleration spikes. The system demonstrated high reliability, responsiveness, and suitability for embedded wearable applications. The results support the viability of threshold-based step detection for resource-constrained devices and highlight MoveMate’s potential as a practical fitness tracking solution.

Keywords: ESP32, MQTT, step detection, tri-axial accelerometer, threshold-based algorithm

DOI: 10.64752/IBAA7166

📄 Download PDF

← Back to Abstracts