- Community Home
- :
- Code and Documents
- :
- Academic Curriculum and Student Projects
- :
- myRIO Student Projects
- :
- myRIO Pedometer

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Document History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Email to a Friend
- Printer Friendly Page
- Report to a Moderator

myRIO Pedometer

Labels:

**Pedometer**

**1. Introduction**

This demo is for pedometer based on accelerometer in NI myRIO. The demo contains two parts, one is to count how many steps you walk and the other is to measure the distance you walk. Based on the distance and the number of steps, how long you walk per step can be calculated.

**2. Method**

**2.1 Overview**

**Fig. 1. **Overview of the method

The basic idea of our method is to use tri-axis gravity acceleration to measure distance and to count the number of steps. Fig. 1 is overview of our method. We can get tri-axis acceleration from the accelerometer in NI myRIO.

**Firstly, correct posture.** The reason why we must do this is that we must calculate tri-axis acceleration to get tri-axis speed based on calculus to measure distance. However, once we rotate NI myRIO, tri-axis speed will be wrongly calculated. So we must correct acceleration into geodetic coordinate system for calculus.

**Secondly, measure distance based on calculus.** After correcting posture, we must use a filter to get the proper frequency for calculus. We use a band-pass filter, because low frequency is the gravity acceleration and high frequency will affect the calculus.

**Thirdly, count steps.** Because we have already corrected posture, we can detect ups and downs in z-coordinate to count steps. We also use a band-pass filter to get the proper frequency.

**Finally**, based on the distance and the number of steps, we can calculate distance per step.

**2.2 Algorithm**

**Posture Correction:**To correct posture, key issue is to get rotation matrix. In our first demo, we have already got the rotation angle and rotation vector. So we use “Angle Vector to Rotation Matrix.vi” in LabView to get rotation matrix. And use (1) to correct posture. Finally, is the corrected acceleration in geodetic coordinate system.

**Distance Measurement:**After posture correction, we must use a filter to get the acceleration in proper frequency. We use a band-pass filter, and the band-pass frequency is in [0.1, 50] Hz. Then based on the proper frequency, we can calculate the distance. First, we must update in continuously based on (2).

After we get , we can update *S* in based on (3). is based on our sampling frequency, and here we set

.

**Step Counting:**For step counting, we also use a band-pass filter to get proper frequency. In this demo, we set the band-pass frequency to [0.2, 1.8] Hz. We judge whether a period of wave is a step is to see whether it has an up and down.Here we define*Baseline*of a period of wave as (4).

Through judging whether the wave has passed baseline three times to count step. However, in order to avoid some noise, we set some constraints here.

**Constraint 1**: .

**Constraint 2**: .

**Constraint 3**: , where . is the start time of the period of wave and is the end time of the period.

** 2.3 Experiment**

** 2.3.1 Filter**

**(a) **Left: origin wave in z-coordinate.

Middle: wave after Step Counting filter

Right: wave after Distance Measurement filter

**(b) **Left: origin wave in x-coordinate.

Right: wave after Distance Measurement filter

**(c) **Left: origin wave in y-coordinate.

Right: wave after Distance Measurement filter

**Fig. 2.** Filter in 3-axis acceleration.

** 2.3.2 Distance Measurement**

Times | Real Distance | Measured Distance | Error |

1 | 12 m | 7.83 m | 34.85% |

2 | 12 m | 8.15 m | 32.08% |

3 | 12 m | 8.23 m | 31.42% |

** Tab. 1. **Experiment of Distance Measurement

** 2.3.3 Step Counting**

Times | Real Step | Measured Step | Error |

1 | 30 | 29 | 3.33% |

2 | 30 | 31 | 3.33% |

3 | 30 | 33 | 10.00% |

** Tab. 2. **Experiment of Step Counting

** 2.4 Discussion**

**1) Error in Distance Measurement: **From Tab. 1 we can see that there are about 33% errors. Because we use a band-pass filter. Some low frequency and high frequency signal will be filtered. It will affect the calculus when calculate speed and then affect distance calculation.

**2) Error in Step Counting:** From Tab. 2 we can see that, there is a little mistake in it. We use three constraints to avoid noise but we cannot avoid all noise. Because of noise, we cannot get the accurate result.

**3. Conclusion**

This demo is for step measurement based on accelerometer in NI myRIO. It contains two parts, one is distance measurement and the other is step counting. We use gravity acceleration to correct the posture. However, we cannot get Yaw component. So there must be some errors in distance measurement. Because low frequency is filtered, uniformly accelerated motion cannot be measured based on our method. For step counting, we use some constraints to avoid some noise. However, for different people, constraints are slightly different. If we have a gyroscope for posture correction, we can do a better job. We can get not only the walking distance but also the walking track.