(3/4) BPM (Pulse Sensor) and Pedometer (ADXL345 Accelerometer) Wearable Device with OLED Display



The final key to the puzzle lies within the ADXL345 accelerometer. The easiest way to obtain a pedometer is buying one. But where’s the challenge in that?

For a more detailed ADXL345 Accelerometer visit my good friend, Eddyson’s, post here :

Application Description

There are different types of pedometer available in the market. Some are dedicated wearables, and some are phone applications that uses the phone’s sensors. Pedometer apps for Android for example are abundant as listed here:

Nonetheless, either wearables or phone apps, they serve the same purpose : To measure a person’s step.

The magic to make the accelerometer work as a pedometer lies within the code. It uses an adaptive peak detection so that each back-and-forth movement can be recognized as a step.

Before you upload the code here, be sure to calibrate your Accelerometer ! Otherwise it will be highly inaccurate in recognizing your steps !

For more information, go here :


  1. The Pedometer Calibration is very simple. Upload the code to your Arduino, and Note the threshold value.
  2. Walk around a few steps, or move the accelerometer a few times. Increase or decrease the threshold value, where a movement should be recognized as a step.
  3. You are done !

Set-up the Hardware

Similiar to Eddyson’s set-up the hardware !


The code is very similar to the linked post, except that function ArduinoPedometer() is added.


Code Breakdown

We are interested in this variable, since this determines when to register a movement as a step.

Since we are receiving a chunk of data, we will separate/parse the data into different variables.

This formula is the length of a line segment. We will be using this to detect a movement/step.

Here’s a discussion on different pedometer algorithms :

We’ll use the (1) as our algorithm.


The ADXL345 accelerometer is a versatile device that can be used in many applications. If a time element is used, it can be used to determine the distance traveled.



Tags : accelerometeradxl345arduinoPedometerwearable

Leave a Response