Project

# Title Team Members TA Documents Sponsor
40 Variable Speed Running Music Device
Alan Wan
Nithin Boopalan
Weston Heard
Jianchong Chen
# 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.

BarPro Weightlifting Aid Device

Patrick Fejkiel, Grzegorz Gruba, Kevin Mienta

Featured Project

Patrick Fejkiel (pfejki2), Kevin Mienta (kmient2), Grzegorz Gruba (ggruba2)

Title: BarPro

Problem: Many beginner weightlifters struggle with keeping the barbell level during lifts. Even seasoned weightlifters find their barbells swaying to one side sometimes. During heavy lifts, many people also struggle with full movements after a few repetitions.

Solution Overview: BarPro is a device that straps on to a barbell and aids the lifter with keeping the barbell level, maintaining full repetitions and keeping track of reps/sets. It keeps track of the level of the barbell and notifies the lifter with a sound to correct the barbell positioning when not level. The lifter can use the device to calibrate their full movement of the repetition before adding weight so that when heavy weight is applied, the device will use data from the initial repetition to notify the lifter with a sound if they are not lifting or lowering the barbell all the way during their lift. There will be an LCD screen or LEDs showing the lifter the amount of repetitions/sets that they have completed.

Solution Components:

Subsystem #1 - Level Sensor: An accelerometer will be used to measure the level of the barbell. If an unlevel position is measured, a speaker will beep and notify the lifter.

Subsystem #2 - Full Repetition Sensor: An ultrasonic or infrared distance sensor will be used to measure the height of the barbell from the ground/body during repetitions. The sensor will first be calibrated by the lifter during a repetition with no weight, and then that calibration will be used to check if the lifter is having their barbell reach the calibrated maximum and minimum heights.

Subsystem #3 - LED/LCD Rep/Sets Indicator: LEDs or a LCD screen will be used to display the reps/sets from the data measured by the accelerometer.

Criterion for Success: Our device needs to be user friendly and easily attachable to the barbell. It needs to notify the lifter with sounds and LEDs/LCD display when their barbell is not level, when their movements are not fully complete, and the amount of reps/sets they have completed. The device needs to work smoothly, and testing/calibrating will need to be performed to determine the minimum/maximum values for level and movement positioning.