A lightweight, battery-efficient step counter built with ESP32 and ADXL345 accelerometer. Created for 2024 MakeNTU hackathon.
- Accurate Step Counting: Uses acceleration magnitude algorithm for reliable step detection
- Persistent Memory: Retains step count even when power is lost
- Low Power Consumption: Optimized for portable use
- Touch Reset: Easy step counter reset with ESP32's touch sensor
- Real-time Display: Instant step count feedback on OLED screen
- ESP32 Microcontroller
- ADXL345 3-Axis Accelerometer
- SSD1306 OLED Display (128x64)
- Connecting wires
- Power source (battery or USB)
- Arduino IDE
- Libraries:
- Adafruit_SSD1306
- Adafruit_ADXL345
- Adafruit_GFX
- Wire
- EEPROM
pedometer/
│
├── pedometer.ino # Main program file
├── src/
│ ├── constant.h # Constants and configuration
│ ├── oled/ # OLED display module
│ │ ├── oled.h
│ │ └── oled.cpp
│ ├── adxl/ # Accelerometer module
│ │ ├── adxl.h
│ │ └── adxl.cpp
│ └── stepDetector/ # Step detection algorithm
│ ├── StepDetector.h
│ └── StepDetector.cpp
- The ADXL345 accelerometer captures motion in three dimensions (X, Y, Z)
- The StepDetector algorithm:
- Calculates the magnitude of acceleration across all axes
- Maintains a rolling buffer of recent values
- Detects a step when movement exceeds average + threshold
- Uses debounce logic to prevent false counts
- Step count is displayed on the OLED screen and saved to EEPROM
- Touch the T0 pin to reset the counter
- Connect the hardware components according to the pins defined in the code
- Upload the code to your ESP32
- Power on the device
- Start walking to see the step count increase
- Touch the T0 pin to reset the counter when needed
- I made this Step Counter using ESP32! by THE ELECTRONIC GUY
- ESP32 Step Tracker: Web-Integrated Counter Project February 8, 2024 by electronicblog296
- Adafruit_SSD1306
- Adafruit_ADXL345
- EEPROM
This project is for educational purposes only. Not intended for commercial use.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0). You are free to use, share, and adapt the material for non-commercial purposes, provided you give appropriate credit to the original authors.
⭐ If you find this project helpful, please give it a star! Your support motivates us to create better projects! (❁´◡`❁)
