Home Analog Devices Feedback Subscribe Archives 简体中文 日本語 | |

Download this article in PDF format. (220KB) Full-Featured Pedometer Design Realized with 3-Axis Digital Accelerometer
Today, advanced
pedometers rely on This article, based
on a study of the characteristics of each step a person takes, describes
a reference design using the 3-axis ADXL345 accelerometer in a full-featured
pedometer that can recognize and count The ADXL345's proprietary
(patent pending), on-chip, 32-level first-in, first-out (FIFO) buffer
can store data and operate on it for pedometer applications to minimize
host processor intervention, thus saving system power—a big concern
for portable devices. Its 13-bit resolution (4 m
acceleration as the relevant parameter. The three components of
motion for an individual (and their related axes) are forward (roll),
vertical (yaw), and side (pitch), as shown in Figure 1.
The ADXL345 senses acceleration along its three axes: x, y,
and z. The pedometer will be in an unknown orientation, so the
measurement accuracy should not depend critically on the relationship
between the motion axes and the accelerometer's measurement axes.
Let's think about the nature of walking. Figure 2 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 3 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.
Digital
Filter: First, a digital filter is needed to smooth the signals shown
in Figure 3. Four registers and a summing unit can be used, as shown in
Figure 4. Of course, more registers could be used to make the acceleration
data smoother, but the response time would be slower.
Figure 5 demonstrates the filtered data from the most active axis of a pedometer worn by a walking person. The peak-to-peak value would be higher for a runner.
A linear-shift-register
and the dynamic threshold are used to decide whether an effective step
has been taken. The linear-shift-register contains two registers, a sample_new
register and a sample_old register. The data in these are called
The step counter
can work well by using this algorithm, but sometimes it seems too sensitive.
When the pedometer vibrates very rapidly or very slowly from a cause other
than walking or running, the step counter will also take it as a step.
Such invalid vibrations must be discarded in order to find the true rhythmic
steps.
The ADXL345's feature
of user-selectable output data rate is helpful in implementing the time
window. Table 1 shows the configurable data rate (and current consumption)
at T
This
algorithm uses a 50-Hz data rate (20 ms). A register named
Figure 7 shows the algorithm flowchart for the steps parameter.
Distance per step depends on the speed and the height of user. The step length would be longer if the user is taller or running at higher speed. The reference design updates the distance, speed, and calories parameter every two seconds. So, we use the steps counted in every two seconds to judge the current stride length. Table 2 shows the experimental data used to judge the current stride.
An
interval of 2 s can be calculated accurately from the number of samples.
Referring to the 50-Hz data rate, the processor can send the corresponding
command to the PC every 100 samples. The processor uses a variable named
Although the data
rate is 50 Hz, the ADXL345's on-chip FIFO makes it unnecessary for the
processor to read the data every 20 ms, minimizing the burden on the host
processor. The buffer has four modes:
Speed
= distance/time, so Equation 2 can be used to get the speed parameter,
as steps per 2 s and stride have all been calculated according to the
algorithm above.
From Table 3, we get (3).
The unit of the speed parameter used above is m/s; converting km/h to m/s gives Equation 4.
The calories parameter would be updated every 2 s with the distance and speed parameters. So, to account for a given athlete's weight, we can convert Equation 4 to Equation 5 as indicated. Weight (kg) is a user input, and one hour is equal to 1800 2-second intervals.
If the user takes a break in place after walking or running, there would be no change in steps and distance, speed should be zero, then the calories expended can use Equation 6 since the caloric expenditure is around 1 C/kg/hour while resting.
Finally, we can add calories for all 2-second intervals together to get the total calories expended.
^{2}C or SPI digital communications
protocols. Figure 8 shows a simplified schematic of the demonstration
equipment, which is powered by 3-V batteries. The /CS pin of the ADXL345
is tied to V_{S} on the board to choose I^{2}C mode. A
low-cost, precision analog microcontroller, the ADuC7024,
is used to read data from the ADXL345, implement the algorithm, and send
the result to the PC via a UART. SDA and SCL, the data and clock for I^{2}C
bus, are connected from the ADXL345 to the corresponding pins of ADuC7024.
Two interrupt pins of the ADXL345 are connected to IRQ inputs of ADuC7024
to generate various interrupt signals and wake up the processor.
A couple of further ideas: If the application is extremely cost-sensitive, or if an analog-output accelerometer is preferred, the ADXL335—a small, thin, low power, complete 3-axis accelerometer with signal-conditioned voltage output—is recommended. If PCB size is of critical importance, the ADXL346 is recommended. This low-power device, with even more built-in features than the ADXL345, is supplied in a small, thin, 3-mm × 3-mm × 0.95-mm plastic package. Its supply voltage range is 1.7 V to 2.75 V.
- Data sheets and additional product information on all Analog Devices products can be found at www.analog.com.
- www.analog.com/en/mems/low-g-accelerometers/products/index.html.
Copyright 1995- Analog Devices, Inc. All rights reserved. |