Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Distinguish walking and running using Machine Learning

Made by Jayraj Desai (/Blue_jack) - Published in Adafruit (/adafruit), Arduino (/arduino), Fitness (/fitness), Health (/health), Tessel
(/tessel), and Wearables (/wearables)

ABOUT THIS PROJECT

Gather data and develop algorithm to distinguish walking and running.


 fitness (/projects/tags/fitness)  machine learning (/projects/tags/machine+learning)  running (/projects/tags/running)

 walking (/projects/tags/walking)  wearables (/projects/tags/wearables)

PROJECT INFO

Type  Full instructions provided


Difficulty Intermediate (/projects?difficulty=intermediate)
Estimated time 10 hours
Published February 18, 2016
License GPL3+ (http://opensource.org/licenses/GPL-3.0)
Keep up to
date with the
 3,069  18
(/arduino/products/arduino-
latest Arduino
Get updates (/users/sign_up?redirect_to=%2Farduino%2Fproducts%2Farduino-uno-genuino-uno)
uno- UNO &
genuino- Genuino UNO
uno) projects
 Respect project

 I made one (/users/sign_up?id=17064&m=base_article&reason=replica&redirect_to=%2FBlue_jack%2Fdistinguish-walking-and-running

 Bookmark (/users/sign_in?redirect_to=%2FBlue_jack%2Fdistinguish-walking-and-running-using-machine-learning-ad7eea&source=proj

 Share  Give feedback

THINGS USED IN THIS PROJECT

Hardware components:

Arduino UNO &


Genuino UNO
(/arduino/products/ × 1  (/products/buy/41?s=BAhJIhYxNzA2NCxCYXNlQXJ0aWNsZQY6BkVG%0A) 
arduino-uno-
genuino-uno)

Adafruit Analog
Accelerometer:
ADXL335  (/products/buy/17345?s=BAhJIhYxNzA2NCxCYXNlQXJ0aWNsZQY6BkVG%0A)
(/adafruit/products/ × 1

analog-
accelerometer-
adxl335)

micro SD card × 1

MicroSD Module
for Tessel
(/tessel/products/m × 1  (/products/buy/29?s=BAhJIhYxNzA2NCxCYXNlQXJ0aWNsZQY6BkVG%0A)
icrosd-module-for-
tessel)

Male Header 40
× 1  (/products/buy/317?s=BAhJIhYxNzA2NCxCYXNlQXJ0aWNsZQY6BkVG%0A)
Position 1 Row (0.1")

AA Batteries × 1  (/products/buy/286?s=BAhJIhYxNzA2NCxCYXNlQXJ0aWNsZQY6BkVG%0A)

4xAA battery
× 1  (/products/buy/287?s=BAhJIhYxNzA2NCxCYXNlQXJ0aWNsZQY6BkVG%0A)
holder

USB-A to B Cable × 1  (/products/buy/421?s=BAhJIhYxNzA2NCxCYXNlQXJ0aWNsZQY6BkVG%0A)

styrofoam × 1

Tape × 1

Software apps and online services:

Arduino IDE
Keep up to
(/arduino/products/  (https://www.arduino.cc/en/main/software)
date with the
arduino-ide)
(/arduino/products/arduino-
latest Arduino
Get updates (/users/sign_up?redirect_to=%2Farduino%2Fproducts%2Farduino-uno-genuino-uno)
uno- UNO &
Octave
genuino- Genuino UNO
uno) projects
STORY

Intro: Distinguish walking and running using Machine Learning

Electronic market is full of devices called pedometer and fitness tracker. They counts the number of steps you have
taken, distance you have covered, whether you are walking or running and bunch of other stuff. Ever wondered, how
these devices perform such measurements.

I decided to make one on my own and share the knowledge of making it with guys. We will develop accelerometer data
accumulator and an algorithm, intelligent enough to identify whether you are walking or running.

I decided to go with machine learning. Machine learning is a sub-field of computer science which explores the study
and construction of algorithms that can learn from data, and the derived algorithm is then used to make predictions on
data. I am going to walk you through them step by step and believe me these things are easy to learn.
Read more
Lets get started.

SCHEMATICS

fritzing schematic Download (https://halckemy.s3.amazonaws.com/uploads/image_file/file/123097/sketch.png)

this is how connections are to be done.

CODE

Arduino code Keep upOctave


to visualize file MATLAB   (/code_files/53204/download)

sample data date with the


(/arduino/products/arduino-
latest Arduino
data_running_1 Get updates (/users/sign_up?redirect_to=%2Farduino%2Fproducts%2Farduino-uno-genuino-uno)
uno- UNO &
data_running_2
genuino- Genuino UNO
uno)
data_running_3
projects
data_running_4 1 clear; close all; clc
2
data_running_5 3 fprintf('Reading data ...\n');
4 %change the path to point to your file.
data_walking_1 5 data = load('~/AStudy/Hobby/Machine_learning_approch/DATA_and_octave_scripts/DATA/Running_13bit
6 Fs=(1/0.014);
data_walking_2
7 nfft =1024;
data_walking_3 8 X=data(:,1);
9 starting=1;
data_walking_4 10 ending=size(X,1);
11 X_fft = fft(X(starting:ending).-mean(X(starting:ending)),nfft);
Octave visuali… 12 Y=data(:,2);
13 Y_fft = fft(Y(starting:ending).-mean(Y(starting:ending)),nfft);
other octave c… 14 Z=data(:,3);
15 Z_fft = fft(Z(starting:ending).-mean(Z(starting:ending)),nfft);
other octave c… 16 figure (1);
17 subplot(3,1,1);
other octave c… 18 plot(X);
19 ylabel('X-data');
other octave c… 20 subplot(3,1,2);
21 plot(Y);

CREDITS

Jayraj Desai (/Blue_jack)


1 project • 35 followers
Just a Hobbyist, trying things
(/Blue_jack)
Follow

Contact (/users/sign_up?redirect_to=%2Fmessages%2Fnew%3Frecipient_id%3D46415&source=user_contact)

REPLICATIONS

Did you replicate this project? Share it!

 I made one

Love this project? Think it could be improved? Tell us what you think!
 Give feedback

COMMENTS

Please log in (/users/sign_in?id=17064&m=base_article&reason=comment&redirect_to=%2FBlue_jack%2Fdistinguish-


walking-and-running-using-machine-learning-ad7eea%23comments) or sign up (/users/sign_up?
id=17064&m=base_article&reason=comment&redirect_to=%2FBlue_jack%2Fdistinguish-walking-and-running-using-
machine-learning-ad7eea%23comments&source=popup) to comment.

Be the first to comment!

Keep up to
date with the
(/arduino/products/arduino-
SIMILAR PROJECTS YOU MIGHT LIKE
latest Arduino
Get updates (/users/sign_up?redirect_to=%2Farduino%2Fproducts%2Farduino-uno-genuino-uno)
uno- UNO &
genuino- Genuino UNO
uno) projects
(https://www.hackster.io/xxx1997/otto-robot-702677) (https://www.hackster.io/techduino/the-flappy-bird-on-
SHOWCASE arduino-6e4c4f)
Otto Robot (https://www.hackster.io/xxx1997/otto-robot- TUTORIAL
702677) The Flappy Bird on Arduino
(https://www.hackster.io/techduino/the-flappy-bird-on-
arduino-6e4c4f)
xxx1997 (https://www.hackster.io/xxx1997) Techduino (https://www.hackster.io/techduino)

10 331 8 294

(https://www.hackster.io/jrance/arduino-nrf24l01-wireless- (https://www.hackster.io/igorF2/iot-air-freshener-w-
weather-station-f6c63f) nodemcu-arduino-adafruit-io-ifttt-dcf959)
TUTORIAL TUTORIAL
Arduino nRF24L01 Wireless Weather Station IoT Air Freshener (w/ NodeMCU, Arduino, Adafruit.io, IFTTT)
(https://www.hackster.io/jrance/arduino-nrf24l01-wireless- (https://www.hackster.io/igorF2/iot-air-freshener-w-nodemcu-
weather-station-f6c63f) arduino-adafruit-io-ifttt-dcf959)
Jorge Rancé (https://www.hackster.io/jrance) Igor Fonseca Albuquerque (https://www.hackster.io/igorF2)

6 578 22 1.6K

Pac-Man LED Pixel Panel Costume Climate Cube for Greenhouse

Keep up to
date with the
(/arduino/products/arduino-
latest Arduino
Get updates (/users/sign_up?redirect_to=%2Farduino%2Fproducts%2Farduino-uno-genuino-uno)
uno- UNO &
genuino- Genuino UNO
uno) projects
(https://www.hackster.io/pix3lot/pac-man-led-pixel-panel- (https://www.hackster.io/Pistikukac/climate-cube-for-
costume-515666) greenhouse-384dd8)
TUTORIAL WIP
Pac-Man LED Pixel Panel Costume Climate Cube for Greenhouse
(https://www.hackster.io/pix3lot/pac-man-led-pixel-panel- (https://www.hackster.io/Pistikukac/climate-cube-for-
costume-515666) greenhouse-384dd8)
Ben Muller (https://www.hackster.io/pix3lot) Istvan Sipka (https://www.hackster.io/Pistikukac)

112 8.1K 24 3.9K

Really Smart Box Temperature Sensor - UNCC MEGR 3171 Fall


2017

(https://www.hackster.io/TinamousSteve/really-smart-box- (https://www.hackster.io/66705/temperature-sensor-uncc-
a3fba8) megr-3171-fall-2017-bfa00a)
TUTORIAL TUTORIAL
Really Smart Box Temperature Sensor - UNCC MEGR 3171 Fall 2017
(https://www.hackster.io/TinamousSteve/really-smart-box- (https://www.hackster.io/66705/temperature-sensor-uncc-
a3fba8) megr-3171-fall-2017-bfa00a)
Stephen Harrison (https://www.hackster.io/TinamousSteve) Multiple Authors

17 6.3K 4 238

More cool stuff Legal thingies About us We're fairly social people
Community members Terms of Service (/terms) Hackster's story (/about)  Facebook
(/community) Code of Conduct (/conduct) Our kickass blog (https://www.facebook.com/hacksterio)
Other community hubs Privacy Policy (/privacy) (https://blog.hackster.io)  Instagram
(/channels/communities) Our 2016 Maker Survey (https://www.instagram.com/hacksterio)
Free Store (/store) (/survey)  Twitter
Hardware Weekend Hackster for Business (https://www.twitter.com/hacksterio)
(/hardwareweekend) (/business)  YouTube
Hacker spaces (/hackerspaces) Support Center (https://www.youtube.com/hacksterio)
(http://help.hackster.io)
Developer API Hackster.io 2017
(https://hacksterio.api-
docs.io/2.0)
Sitemap (/sitemap.xml.html)

Keep up to
date with the
(/arduino/products/arduino-
latest Arduino
Get updates (/users/sign_up?redirect_to=%2Farduino%2Fproducts%2Farduino-uno-genuino-uno)
uno- UNO &
genuino- Genuino UNO
uno) projects

You might also like