Software apps and online services
Hand tools and fabrication machines
A pedometer is a device, usually portable and electronic or electromechanical, that counts each step a person takes by detecting the motion of the person's hands or hips. Because the distance of each person's step varies, an informal calibration, performed by the user, is required if presentation of the distance covered in a unit of length is desired, though there are now pedometers that use electronics and software to automatically determine how a person's step varies. https://en.wikipedia.org/wiki/Pedometer
Used originally by sports and physical fitness enthusiasts, pedometers are now becoming popular as an everyday exercise counter and motivator. Often worn on the belt and kept on all day, it can record how many steps the wearer has walked that day, and thus the kilometers or miles.
In this project, we will use the BHI160 accelerometer, which is integrated into the RSL10-SENSE-DB-GEVK device. An Accelerometer is a device which can convert acceleration in any direction to its respective variable voltage. This is accomplished by using capacitors , as the Accel moves, the capacitor present inside it, will also undergo changes based on the movement, since the capacitance is varied, a variable voltage can also be obtained.
Alternative designs of accelerometers measure force not by making a pen trace on paper but by generating electrical or magnetic signals. In piezoresistive accelerometers, the mass is attached to a potentiometer, a bit like a volume control, which turns an electric current up or down according to the size of the force acting on it. Capacitors can also be used in accelerometers to measure force in a similar way: if a moving mass alters the distance between two metal plates, measuring the change in their capacitance gives a measurement of the force that's acting.
Figure below depicts a single step, defined as a unit cycle of walking behavior, showing the relationship between each stage of the walking cycle and the change in vertical and forward acceleration.
Figure below shows a typical pattern of x, y, and z measurements corresponding to vertical, forward, and side acceleration of a running person. At least one axis will have relatively large periodic acceleration changes, no matter how the pedometer is worn, so peak detection and a dynamic threshold-decision algorithm for acceleration on all three axes are essential for detecting a unit cycle of walking or running.
(Timing: 3 hrs.)
I could use different hardware to do this project, however my goal is design a pedometer and only using the hardware, software and Smartphone App of "ON Semiconductor". My schematic diagram would be as simple as the following:
The BHI160 sensor is used in absolute orientation relative to earths magnetic poles. Additional sensor outputs are also available for raw data from accelerometer, gyroscope and magnetometer alongside Fuser Core processed outputs that combine data from multiple sensors.
Please follow the links below to find all the technical information of this device: RSL10-SENSE-DB-GEVK.SOFTWARE
(Timing: 5 hrs.)
In this case, the example that will serve as a model will be the following: "sense_ics_firmware_sleep". You can download all the complete codes in the download section. The modified code is as follows: CSN_LP_AO.c
In the code below, I show you the lines that I modified to calculate the steps:
static int CSN_AO_A_PropHandler(char* response)
const uint16_t dyn_range = BHI160_NDOF_GetAccelDynamicRange();
// PEDOMETER CALCULATIONS
if (((fabsf(lin_accel.x / 32768.0f * dyn_range * 9.80665f * 100.0f)) + (fabsf(lin_accel.y / 32768.0f * dyn_range * 9.80665f * 100.0f)) + (fabsf(lin_accel.z / 32768.0f * dyn_range * 9.80665f * 100.0f))) >= 25.00f ) // pedometer
steps = steps + 1;
steps = steps + 0;
snprintf(response, 19, "%d,%d,%d",
(int) (lin_accel.x / 32768.0f * dyn_range * 9.80665f * 100.0f),
(int) (lin_accel.y / 32768.0f * dyn_range * 9.80665f * 100.0f),
//(int) (lin_accel.z / 32768.0f * dyn_range * 9.80665f * 100.0f));
How does it works?
- We make the sum of the absolute values of the accelerations on the x, y and z axes.
- If we exceed the threshold, then we count it as a step, in my case the threshold has a value of 25, and I obtained it through tests.
- We replace the acceleration value on the z axis in our Android application, with the steps accumulated in our pedometer.
- In this way, we have made a small and economical pedometer and we don't need to spend money on additional hardware.
In the tests carried out, I got approximate errors of 10%, and I think it is due to the sensitivity of the accelerometer since it's integrated on a board where there are several sensors and very undesirable currents and temperatures are induced between themselves. I also think that we must consider the effects of the gravity force, and if we're walking or if we're running. Even if a person takes shorter or longer steps, then surely the pedometer would give values with an small error.TEST
(Timing: 4 hrs.)
In the video below I show you the tests performed with this pedometer.
In the figures below I show you some tests done with the pdometer (Android application).
We meet our goal of designing a small and economical pedometer using only ON Semiconductor hardware and software. The most important applications are: measure the number of steps, calculate the distance traveled by a pedestrian or runner, and calculate the calories consumed. To get these values, we will have to do tests with a population and debug the project so that it has a medical validation, and this isn't within the reach of my possibilities at the moment. However, this can serve as a reference to understand the use of an accelerometer to measure the steps of a person and that is not as complicated as one might think. All my reflections and methods are published in this project and I hope they are useful for someone who wants to learn from this topic.