Home > Projects > Tack your Gait!

Tack your Gait!

Summary of Tack your Gait!


This project tracks individual gait patterns using pressure sensors connected to an Arduino MKR1000. It counts steps, calculates steps per minute, and displays GPS coordinates on a Windows Phone via Bluetooth. The system uses Velostat-based foot sensors and requires sideloading the Microsoft Virtual Shields app due to store availability issues.

Parts used in Tack your Gait:

  • Velostat
  • Linqstat
  • SparkFun Bluetooth Modem - BlueSMiRF Silver
  • Coppertape (narrow)
  • Cork 2mm
  • Foam rubber 2mm
  • Felt plate
  • Soldering iron
  • Arduino MKR1000

Everyone has a certain Gait-Rythtm! ..influenced by architecture and our surrounding. This Project should Tack your Gait and find yours.

Things used in this project

Hardware components

Velostat, Linqstat
× 1
SparkFun Bluetooth Modem - BlueSMiRF Silver
SparkFun Bluetooth Modem – BlueSMiRF Silver
× 1
Coppertape (narrow)
× 1
cork 2mm
× 2
Foam rubber 2mm
× 1
Felt plate
× 1

Software apps and online services

Microsoft Virtual Shields for Arduino
You have to use the “Side-Load”-Funktion because the app in the app-store is not working!

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

the basic layout on cork 2mm

the velostat-foil and copper-stripper

cutting out for cabeling

copper stripes with cabels

detail of soldering

build up sensors for left and right! cabeling sealed with silicon!

gluing on 2nd cork 2mm

finished up side with fizmatte

finished down side with moosgummi

The second Thing was cabeling to arduino:

Making a Little circuit-board for connecting sensors and Bluetooth-Module to sensor:

Schematics

circuit diagram

Connection of sensors and Bluetooth-module to arduino

Code

Program for arduino MKR1000 with Connection over Bluetooth to Windows 10 Phone Lumia 550!
/*
    Copyright(c) Microsoft Open Technologies, Inc. All rights reserved.

    The MIT License(MIT)

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files(the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions :

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
*/

// Include the ArduinoJson library, a dependency
#include <ArduinoJson.h>

// VirtualShield is the core of all shields
#include <VirtualShield.h>
// Text is to display text onscreen.
#include <Text.h>

// Geolocator is for GPS use
#include <Geolocator.h>

// Instantiate the shields
VirtualShield shield;
Text screen = Text(shield);
Geolocator gps = Geolocator(shield);

int sensor[4];
int sensorstate[4];
int trigger[4];
int count[4];

// Callback event for GPS events
void gpsEvent(ShieldEvent* shieldEvent)
{
  // If there is a sensor error (errors are negative)... display message
  if (shieldEvent->resultId < 0) {
    screen.printAt(3, "Sensor doesn't exist");
    screen.printAt(4, "or isn't turned on.");
    
    screen.printAt(6, "error: " + String(shieldEvent->resultId));
    return;
  }
  
  String lat = String("Lat: ") + String(gps.Latitude);
  String lon = String("Lon: ") + String(gps.Longitude);
  
  // Print the latitude and longitude to the screen.
  screen.printAt(11, lat);
  screen.printAt(12, lon);
}

void refresh(ShieldEvent* shieldEvent)
{
   // put your refresh code here
   // this runs whenever Bluetooth connects, whenever the shield.begin() executes, or the 'refresh' button is pressed in the app:
   screen.clear();
   screen.printAt(1, "Tack your Gait!");
   screen.printAt(4, "Gait Count:");
   screen.printAt(10, "GeoLocation:");
}

void setup() 
{
   // set up virtual shield events: 
   shield.setOnRefresh(refresh);
   
   // begin the shield communication (also calls refresh()).
   shield.begin(); //assumes 115200 Bluetooth baudrate

   // Connect the events to the shields.
   screen.clear();
   screen.printAt(2, "Basic GPS Lookup");

   // When the GPS retrieves values, call this function: gpsEvent()
   gps.setOnEvent(gpsEvent);
  
   // put your setup code here, to run once:
   trigger[0]=360;
   trigger[1]=200;
   trigger[2]=320;
   trigger[3]=200;
}

long nextMinute = 60000;
int beatBPM[4];

void loop() 
{
   shield.checkSensors();

    // put your main code here, to run repeatedly:
    if (millis() > nextMinute) {
      nextMinute = millis() + 60000;
      for (int x=0; x <=3; x++){
        beatBPM[x]=count[x]/(nextMinute/60000);
        String beatscreen = String("BPM Sensor ") + String(x) + String(": ") + String(beatBPM[x]);
        screen.printAt(x+14, beatscreen);
      }
       
    }
    for (int x=0; x <= 3; x++){  
      sensor[x]=analogRead(x);
      if (sensor[x] > trigger[x] && sensorstate[x]==0)
      {
        count[x]=count[x]+1;
        sensorstate[x]=1;
        // Get the GPS coordinates (send the event to request GPS).
        gps.get();
        String sensorscreen = String("Sensor ") + String(x) + String(": ") + String(count[x]);
        screen.printAt(x+5, sensorscreen);
      }
       if (sensor[x] < trigger[x] && sensorstate[x]==1)
      {
        sensorstate[x]=0;
      } 
    }
}

Source : Tack your Gait!

Quick Solutions to Questions related to Tack your Gait:

  • How do I install the application for this project?
    You must use the Side-Load function on a Windows 10 computer with Visual Studio 2015 because the app in the store is not working.
  • What hardware components are required to build the sensors?
    The sensors are built using cork 2mm, Velostat foil, copper strippers, felt plates, foam rubber, and silicon for sealing cables.
  • Can this project visualize data in real time?
    No, you should not overstress the Bluetooth connection as the module hangs up when attempting realtime data visualization.
  • What specific Arduino board does the code target?
    The code is programmed specifically for the Arduino MKR1000 board.
  • What libraries are included in the source code?
    The code includes the ArduinoJson library, VirtualShield, Text, and Geolocator libraries.
  • What functions can the completed project perform?
    The project can count steps, calculate steps per minute, and show the user's GPS position.
  • Why was a custom circuit board created?
    A small circuit board was made to connect the sensors and the Bluetooth module to the sensor setup.
  • What voltage divider values were used in the design?
    The designer used 2K and 10K resistors as a voltage divider and warned not to exceed the maximum Ampere.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top