Project

# Title Team Members TA Documents Sponsor
40 Variable Speed Running Music Device
Alan Wan
Nithin Boopalan
Weston Heard
Jianchong Chen design_document1.pdf
proposal1.pdf
# Variable Speed Running Music Device

Team Members:

Alan Wan (alanwan2),
Weston Heard (wheard2),
Nithin Boopalan (nithinb2)
# Problem

Most people bring their phone on a run to listen to music. It is big and bulky, and unless you have a perfect playlist, there isn’t going to be music that syncs with your running. If you do happen to have music that is the same as your pace, there is nothing to enforce that you are running at that speed.

# Solution

We intend to fix this by replacing your phone on runs with a device that can react to how fast or slow you are going compared to your intended pace, and a mode where the music will automatically adjust to the speed you are going, in case you don't want to have to worry about keeping on pace.

The device clips to your waistband and stores your music on an SD card so it doesn't move around in pockets. A motion sensor in the device picks up each step, and the device can calculate the steps per minute. It can then play a song that lines up with one’s steps, speeding it up or slowing it down slightly to keep it locked on. If the pace changes too much, it then switches to a different track instead. Everything will run on the device, so no phone or internet is needed.

## Subsystem 1, Motion Sensing

This subsystem determines the runner’s running cadence.

Running cadence usually falls between 140 and 190 steps per minute, which puts foot strikes at 2.3 to 3.2 Hz. An IMU is clipped at the hip in the device and samples acceleration at 200 Hz. The firmware in the STM32 then filters the signal to that range, removing the constant gravitational pull, and projects that reading as the direction of gravity.

Cadence is then found by autocorrelation, where the firmware compares four seconds of a signal against shifted copies of itself. Then the computed shift that best matches is used as the time it takes one stride to repeat, ie stm. This is more reliable than individual foot strikes as it uses the whole window together, so one missed step or short peak barely moves the result. The search first covers the Hz for the running range, then widens to cover walking if nothing is found. This prevents a reading of 180 spm from being labeled as walking. However, since this shift is a whole number of samples, the raw result can only land on certain values, around 2.7 spm apart at 180 spm. The STM32 then interpolates between neighboring values to get the accuracy to be within 0.3 spm.

Components:
6-axis IMU, SPI interface: TDK InvenSense ICM-42688-P
Microcontroller Unit: STM32F4 family


## Subsystem 2, Music Storage and Playback

This subsystem stores the songs and adjusts the speed to match the runner.

Songs are stored on a microSD card as uncompressed WAV files, preventing the processor from decoding MP3. Audio is read off the card using DMA, a block within the microcontroller that can move data without the processor copying, so that reading doesn’t interrupt playback. Each song’s tempo is worked out ahead of time on a computer before being saved in an index file on the SD card. The device then only has to do a lookup while running instead of processing audio for the BPM.

Tempo Matching: Tempo can be changed with WSOLA (waveform similarity overlap-add) by up to 10%. It cuts the audio into overlapping chunks and places them back closer or farther apart to change the speed. This allows for a speed change while preserving pitch. However, the further out the pace is, the worse it will start to sound, and the device will then be forced to change songs.

Target Tempo: plays songs at a targeted pace, and when the runner falls behind the set pace, a low-pass filter is placed to muffle the audio to signal falling behind and clears out as they return to pace. This provides the runner feedback without having to stop running

Components:
microSD card socket: Hirose DM3AT-SF-PEJM5
microSD card: 32 GB SanDisk High Endurance or Samsung PRO Endurance

## Subsystem 3, Audio Output

This subsystem turns the digital audio into a signal that can drive headphones. The main analog circuit design in the project.

Audio samples will travel from the microcontroller over I2S, a three-wire bus for audio, to a DAC, which converts each sample into voltage. This voltage is held until the next sample arrives, so the output appears as a staircase. They then pass through a reconstruction filter to remove the distortion before it reaches a headphone amplifier, which supplies the current that 16 to 32 ohm headphones need. This amplifier gain is capped so the output never exceeds 150 mV RMS into 32 ohm headphones.

Components:
Stereo audio DAC: Texas Instruments PCM5102A
Low-noise audio op-amp for reconstruction filter: Texas Instruments OPA1662
Headphone amplifier, no capacitor output: Texas Instruments TPA6132A2
3.5mm TRS headphone jack: CUI SJ-3524-SMT-TR

## Subsystem 4, Power

This subsystem powers the device from a single lithium cell and handles charging.

The lithium cell will fall from 4.2 V to 3.0 B as it drains, and in the process will cross a 3.3 V logic rail; a buck-boost converter can then be used so the rail remains stable as the discharge finishes. The DAC and headphone amp are fed through dropout regulators that keep the noise from the converter out of the audio. An MCP73831 charges the cell over USB-C, and a MAX17048 fuel gauge will report the charge to the microcontroller.

Components:
Single-cell lithium-polymer battery, 1000 mAh
Low-dropout regulator
Buck-boost regulator: Texas Instruments TPS63020
Battery Charger: MCP73831
Battery fuel gauge: Maxim MAX17048

# Criterion For Success

Cadence is measured within 1 spm of the true value for the range 140-190 spm. The true value can be obtained with a fixed motor setup and verified through video.

Once the device is locked onto a speed, play music to within 1 BPM of the runner’s steps per minute. Verify by checking the audio output and comparing the speed to video of the runner.

After the pace changes by 15 spm or more, change music to match th
e new pace within 10 seconds. Test both speeding up and slowing down by 15 spm or more.

Recognizes stops and starts within 10 seconds of them happening.

The device lasts at least 2 hours of continuous usage.

The device remains lightweight, under 300g, and stays clipped to the waistband over a 15-minute run.

Automatic Piano Tuner

Joseph Babbo, Colin Wallace, Riley Woodson

Automatic Piano Tuner

Featured Project

# Automatic Piano Tuner

Team Members:

- Colin Wallace (colinpw2)

- Riley Woodson (rileycw2)

- Joseph Babbo (jbabbo2)

# Problem

Piano tuning is a time-consuming and expensive process. An average piano tuning will cost in the $100 - $200 range and a piano will have to be retuned multiple times to maintain the correct pitch. Due to the strength required to alter the piano pegs it is also something that is difficult for the less physically able to accomplish.

# Solution

We hope to bring piano tuning to the masses by creating an easy to use product which will be able to automatically tune a piano by giving the key as input alongside playing the key to get the pitch differential and automatically turning the piano pegs until they reach the correct note.

# Solution Components

## Subsystem 1 - Motor Assembly

A standard tuning pin requires 8-14 nm of torque to successfully tune. We will thus need to create a motor assembly that is able to produce enough torque to rotate standard tuning pins.

## Subsystem 2 - Frequency Detector/Tuner

The device will use a microphone to gather audio measurements. Then a microprocessor processes the audio data to detect the pitch and determine the difference from the desired frequency. This can then generate instructions for the motor; direction to turn pegs and amount to turn it by.

## Subsystem 3 - User Interface/Display Panel

A small but intuitive display and button configuration can be used for this device. It will be required for the user to set the key being played using buttons on the device and reading the output of the display. As the device will tune by itself after hearing the tone, all that is required to display is the current key and octave. A couple of buttons will suffice to be able to cycle up and down keys and octaves.

## Subsystem 4 - Replaceable Battery/Power Supply

Every commercial product should use standard replaceable batteries, or provide a way for easy charging. As we want to develop a handheld device, so that the device doesn’t have to drag power wires into the piano, we will need a rechargeable battery pack.

# Criterion For Success

The aim of the Automatic Piano Tuner is to allow the user to automatically tune piano strings based on a key input alongside playing a note. We have several goals to help us meet this aim:

- Measure pitch accurately, test against known good pitches

- Motor generates enough torque to turn the pegs on a piano

- Tuner turns correctly depending on pitch

- Easy tuning of a piano by a single untrained person

Project Videos