Accelerometer, Noise Filtering, and Step Counter Algorithm!

Hey friends, Happy Wednesday!

Thank you all for subscribing even though I had no piece of content out until now. This is my first newsletter issue, and I’m happy to have you all here!

The 2 concepts we’ll cover this week to understand the step counting algorithm are accelerometers and noise filtering 101. While preparing my subsequent newsletter issues, I realized some of the blog posts actually need only one, and sometimes two concepts. So I’ll write likewise :) I didn't add images of the gadget this time as this is an algorithm, but will do so wherever possible and meaningful as I don't want this newsletter to be purely theoretical.

I'm trying to write the newsletter issues in a way one can follow them while travelling on a bus, having your coffee, waiting for your food, etc. Let's jump in!

What are accelerometers?

The fitness watch uses a 3-axis accelerometer, which is basically a small chip in your watch. It measures the acceleration it experiences relative to a free-fall observer. This means that the acceleration is 0 when your fitness watch is free falling and it’s 9.8 m/s^2 when it’s resting on a table. These values are computed along the X, Y, and Z axis defined with respect to the chip.

There are a dozen types of accelerometers but the one used in fitness watches is a Micro Electro-Mechanical System aka MEMS (breakdown: it has electrical and mechanical components that are miniaturized).

Here is how it works!

  1. The component in blue can move along an axis while the yellow plates are fixed. Both the yellow and blue plate protrusions are conductive and their separation makes them a capacitor.

  2. Springs are connected to both the ends (alternatively, the blue mass can be made compliant in nature thereby acting as a spring in the ends). And, as we go about our day, the mass undergoes acceleration accordingly. This causes the blue plates to slide, thereby changing the capacitance C1 and C2 (marked in the figure).

  3. This change in capacitance is then translated to acceleration

Noise filtering basics

Every gadget with a circuit uses filtering, almost always! Due to temperature, the electrons in the conductor of the circuit undergo random motion thereby adding and subtracting from the original signal - resulting in what is called thermal noise. This is inevitable.

The 101 of noise filtering is that we want to remove unwanted signals that crop into our desired signals. In the context of the fitness watch, we need to filter the acceleration data along each of the axes that we collect from the accelerometer. The method used to filter the noise in this step counter algorithm is FIR (Finite Impulse Response). It is basically a weighted moving average filter.

Source: FIR filters Wikipedia

Question of the week

How does the auto-rotate function on your smartphone work? Share your thoughts by replying to this email, and we can have a discussion. I’ll answer this in next week’s issue.

Blog post is out!

My blog post S1E1 on the step counter algorithm is out! Read it HERE, happy learning! And I'm open to receiving any kind of feedback.

I’m thinking of writing about how a beard trimmer works for the next episode S1E2. Also, let me know if you’d like to read about a specific gadget/device.

Have a nice rest of the week, and take care!
Until next Wednesday,
Chendur

Previous
Previous

Converting rotary to linear motions and Beard trimmer