One, Two Step

Wrist pedometers are used by many to count their steps, and notify users when they “reach their 10,000”. These wearable devices quantify step activity and give indiviudals an idea of exactly how much they are moving throughout the day.

Accelerometers are often used within these wearable devices to detect the force acting on the device. The force acting on the accelerometer is correlated to an analog voltage output, which must be processed through a series of op amps to turn a users movement into an electrical output that can be analyzed through signal processing, but what signal processing circuitry is needed following the accelerometer within a wrist pedometer to correlate force acting on the pedometer to steps taken by the user?

In this post we will solve at the following engineering problem associated with pedometers: what signal processing circuitry is needed to convert the analog voltage input from an accelerometer to a binary digital signal that can be correlated to steps taken by a user?

Background 

Figure 1. Force acting on wrist pedometer during gait cycle[1].

The average person takes between 0 and 120 steps per a minute. Throughout each gait cycle, a wrist pedometer experiences forces relative to its position, as shown in Figure 1. While standing the force detected by the pedometer is 1G (one times the force of gravity). When a user is pushing against the ground to step forward the force detected by the pedometer can rise above 1G, and while the user is between steps the force detected by the pedometer can go below 1G. The pedometer can detect when a user takes a step by monitoring forces and determining when the 1G threshold is crossed. Many wrist pedometers use a threshold of at least +/- 0.2G to prevent noise and standing movements from being accounted for in step count. So a step count will be equal to crossing the 1.2G and -1.2G thresholds[1].

 

Figure 2. Voltage Output as a function of force for Analog Devices+/- 2g accelerometer [2]

Accelerometers are often used to relate the force acting on an object to an electrical signal. Analog Devices, a circuitry component manufacturer, produces an +/- 2g accelerometer that relates forces between -2g and +2g to a voltage output, as shown in Figure 2. A linear region exists between +/- 2g, which can be defined by the following simplified function V(g)=(.875*g)+2.5 [2].

Approach 

In designing the signal processing circuitry necessary to convert an analog signal from an accelerometer to a binary digital signal, we will do the following:

1.Define the input signal in terms of force acting on a wrist pedometer, and the voltage output of an accelerometer

2.Determine the signal processing necessary to convert the analog signal into binary digital output

3.Select circuit components to complete desired signal processing, and appropriate values for integrated components

4.Use LTSpice to model desired circuitry, and confirm that designed circuit solves the defined engineering problem

Signal Input

It is known that the force acting on a wrist pedometer can be defined by a sine wave function fluctuating +/ 0.5g around 1g, with a frequency of 0-2Hz. Therefore we will define the force acting on the pedometer as F(t)= 0.5sin(t) + 1g. Given the voltage output of analog devices accelerometer is V(g)=(.875*g)+2.5, the voltage output of the accelerometer can be defined as V(t)=0.4105sin(t)+3.375.

Figure 3. Force acting on pedometer throughout gait cycle

Figure 4. Voltage signal generated by accelerometer from force input signal

 

 

 

 

 

 

 

 

Signal Processing

To generate a digital binary signal from an analog voltage input signal processing through circuitry is required.

Figure 5. Flow chart of signal processing of input analog signal from accelerometer to binary output signal

First, the input signal should be passed through a low pass filter, with a cutoff frequency of 2Hz to remove high frequency noise from the signal. The force acting on the pedometer, and voltage output of an accelerometer can be defined by sine wave functions. The baseline of accelerometer voltage output exists above zero volts, therefore a subtractor should be used to bring the baseline of this signal to 0V. A full wave rectifier will be used as an AC to DC converter, converting both polarities of the signal to a pulsating DC signal. A compactor will be used to produce a binary DC output that indicates whether the signal is above a given threshold, voltage relative to passing +/- 0.2g force threshold. This binary signal is the system output and can be used to count total steps taken by a user.

Circuit Components 

Circuit components were selected to complete necessary signal processing, and assumed to be ideal for simplification of solving this problem.

Low pass filter 

Figure 6. Low pass filter

 

With a cutoff frequency of 2Hz, a low pass filter with a Capacitor of 4.7 nF and resistor of 0.0169 Ohms can be used to filter out high frequency noise

 

 

 

 

Follower

Figure 7. Op amp acting as follower

 

Follower used to preserve signal and prevent current flow back to the user

 

 

Subtractor 

Figure 8. Op amp acting as a subtractor

 

A subtractor can be used to reduce the baseline signal to zero. Given our voltage input is V(t)=0.4105sin(t)+3.375 V, and the Voltage output of this component is Vout = (R3/R1)*(Vin-Vs), we will set Vs=3.375V DC and R1=R2=R3=100 Ohm to bring the baseline signal down to 0V.

 

 

 

 

Full Wave Rectifier

Figure 9. Op amps acting as a full wave rectifier

 

A full wave rectifier will be used to convert all polarities of the input signal to the same polarities. If R1=R2=R3=R4=R5, then if Vin>0 Vout=Vin and Vin<0 Vout=-Vin. Therefore, we will set all the resistors equal to each other to achieve a rectified DC signal.

 

 

 

Comparator 

Figure 10. Op Amp acting as a comparator

A comparator will be used to convert the pulsating DC signal to a binary digital output. Op amps functioning as comparators follow the rule that if V+>V- Vout = Vc+ and V->V+ Vout=Vc-. In our ideal circuit, we aim our binary signal to be either 0 or 1.

V+ terminal will be our signal, and we look to determine if this signal represents crossing the 1.2g threshold. To find what the V- terminal should be we need to determine the voltage at this point in the circuit if it has crossed the threshold. Given, V(g)=(.875*g)+2.5, V(g=1.2)=3.52. The signal is brought through a subtractor where it is reduced by 3.375 and afterword is no longer amplified or modified, so the threshold voltage at this point is 0.1534 V. The negative input terminal will be set to be a DC voltage of 0.1534V.

To generate a binary output where 0V= not crossing the threshold and 1V= crossing threshold, the op amp terminals will be set to be Vc+ = 1V and Vc-=0V.

LTSpice Modeling and Verification 

Figure 11. LTSpice signal processing circuit following accelerometer to convert analog accelerometer signal input to binary output


LTSpice was used to model the designed circuit, as shown in figure 11. This circuit was simulated using LTSpice software and it’s ability to produce a binary digital output from an analog signal was verified as depicted in figure 12.

Figure 12. Voltage input, green, and output, blue, of signal processing circuit in figure 11

Solution

Our goal was to design signal processing circuitry is needed to convert the analog voltage input from an accelerometer to a binary digital signal that can be correlated to steps taken by a user.

Figure 13. Accelerometer analog output signaling processing circuit to produce binary digital output

A series of signal processing components were integrated within a circuit, depicted in figure 13, to convert an analog voltage signal from an accelerometer into a binary digital signal. This circuit removes high frequency signal noise, reduces the signal baseline, generates a pulsating DC signal, and generates a binary signal output, as shown in figure 14.

Figure 14. Binary digital output of accelerometer signal processing circuit

This binary digital output can be correlated to steps taken, as two square waves is equal to one step taken. These square waves can be counted by an integrated software and used to count user steps. Thus, turning the analog accelerometer voltage output into a binary digital signal.

This binary signal can be used to count steps and step frequency, and when integrated with GPS and other technologies can be used to determine step distance and user speed.

With one two sqaure waves equaling a step, the designed integrated circuit turns user movement into step count, enabling the signal processing necessary to count those 10,000 steps everyone is so desperately trying to reach!

References

[1] Modi, Yash Rohit. (2014). United States Patent No. US20140074431A1. Retrieved from https://patents.google.com/patent/US20140074431A1/en

[2] “Accelerometer Specifications – Quick Definitions.” Accelerometer Specifications – Quick Definitions | Analog Devices, www.analog.com/en/products/landing-pages/001/accelerometer-specifications-definitions.html.

Engineer Your Way to 10,000 Steps a Day

Many people are trying to get 10,000 steps or more in each day to become somewhat active. Whether getting in those steps will help to be healthy or active, the use of a pedometer will help to count those daily steps. Today it is hard for me to find a person who doesn’t have a Fitbit or other step counter on their wrist. So, what is their device really doing?

Fitbit Alta, a pedometer used to count steps, calories burned, and miles walked daily.

Pedometers use accelerometers to measure changes in velocity of the forces your body produces. The use of accelerometers is becoming increasingly popular in technologies for more than just pedometers. For instance, detecting car crashes to release the airbag, or turning off the hard drive when your laptop falls to prevent damage. There are many different features to consider when choosing the correct accelerometer for your specific application.

Accelerometer board designed to measure movement in the x, y, and z axis, another factor to consider when designing a pedometer. 

In the case of a pedometer, we want to know: how do we design an accelerometer to accurately count the movement of someone taking a step? We want the pedometer we use not to over count or undercount our steps. It needs to be sensitive enough to detect when we move enough, but not overly sensitive to count a sneeze as a step. There are many variables in an accelerometer to design it to your needs. In this case, adding a low pass band filter will help us to accurately count the steps we want.

In designing our accelerometer, we want to choose our maximum swing. This will be in the form of g, or acceleration due to gravity, 9.81m/s2. When measuring sudden stops and starts, you want a higher g, such as 5g. When measuring the earth’s tilt, only  1 is needed. Since we want to measure the movement of somebody walking, typically 2g is used.

The resolution of the accelerometer will determine how it will detect the smallest increment in acceleration. If you would like to improve the resolution, then you can do this by using a filter to lower the noise and bandwidth. The resolution can be given by the equation:

R=N x √(BWlpf x1.6)

Where R is the resolution, N is the noise density and BWlpf is the bandwidth of the output low-pass filter.

A few things to note: N is in the units µg/√Hz and the bandwidth is what we want to solve for to improve the resolution of the device. If I want to design an accelerometer with a 13-bit resolution, so that even low walking speeds are accurately measured, that would be the equivalent of an R value of 4mg. Based on high performance of pedometers with maximum swing of 2g, we will choose N to be approximately 120µg/√Hz.

Solving for BWlpf using basic algebra, we find that BWlpf=(R/N)2/1.6

Plugging in the values of R and N, we find that we want a bandwidth to allow for the frequency of about 695Hz.

Depending on the design of the accelerometer, there would be different values of N and R. For instance, certain companies may want higher resolution and may be able to get a different noise density based on their maximum swing and other factors. They would be able to choose the type of bandwidth filter based on their needs and adjusting the equation accordingly. The bandwidth of the filter used in designing the resolution of the accelerometer for a pedometer is just one of the many variables and problems an engineer would consider when designing a device to track steps.

 

Further Reading:

https://www.dimensionengineering.com/info/accelerometers

http://www.nxp.com/assets/documents/data/en/quick-start-guide/SENSORTERMSPG.pdf

https://help.fitbit.com/articles/en_US/Help_article/1143

Photo Sources:

https://www.fitbit.com/store

https://www.dimensionengineering.com/info/accelerometers