Project showcase
KeyMat

KeyMat © GPL3+

KeyMat is an intelligent workmat for a standing desk that tracks the user's calorie burn over the course of a day.

  • 1,055 views
  • 0 comments
  • 0 respects

Components and supplies

Necessary tools and machines

About this project

The Video:

The Poster:

View it here.

The Website:

Keymatcic.com

Code

standingJava
The processing sketch to ive graphic visualization and take i data on the serial bus.

Needs the processing IDE found at processing.org to run
No preview (download only).
standingArduino
Code to upload to arduino nano to light LED strip and send locatio data through serial.

Need to have downloaded the Adafruit pixel libraries
#include <Adafruit_NeoPixel.h>
#include <avr/power.h> // Comment out this line for non-AVR boards (Arduino Due, etc.)

#define PIN 13

int col1[] = {A3, A2, A1};
int col2[] = {A0, 12, 11};
int col3[] = {9, 10, 8};
int col4[] = {5, 6, 7};
int col5[] = {2, 3, 4};

int col1Color = 0;
int col2Color = 0;
int col3Color = 0;
int col4Color = 0;
int col5Color = 0;

//fade speed
int fade = 5;

//which LED in the strip is starting
int start = 13;
//how many LEDs are in each column
int piece = (60-15)/5;
//max intensity of color
int colorMax = 100;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

//array of values to end up through Serial for metric gathering
int count[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

void setup() {

Serial.begin(9600);

for(int i = 0; i < 3; i++)
{
  pinMode(col1[i], INPUT);
  pinMode(col2[i], INPUT);
  pinMode(col3[i], INPUT);
  pinMode(col4[i], INPUT);
  pinMode(col5[i], INPUT);
}


strip.begin();
strip.show();

}

void loop() {
  //conditionals to determine inputs and color responses per columns
  for(int i = 0; i < 3; i++)
  {
      if(digitalRead(col1[i]))
      {
        count[i*5+0]++;
        col1Color+=fade;
      }
      else
      {
        count[i*5+0] = 0;
        if(count[0] == 0 && count[5] == 0 && count[10] == 0)
          if(col1Color > 0)
            col1Color-=fade;
      }

      if(digitalRead(col2[i]))
      {
        count[i*5+1]++;
        col2Color+=fade;
      }
      else
      {
        count[i*5+1] = 0;
        if(count[1] == 0 && count[6] == 0 && count[11] == 0)
          if(col2Color > 0)
            col2Color-=fade;
      }
     
      if(digitalRead(col3[i]))
      {
        count[i*5+2]++;
        col3Color+= fade;
      }
      else
      {
        count[i*5+2] = 0;
        if(count[2] == 0 && count[7] == 0 && count[12] == 0)
          if(col3Color > 0)
            col3Color-=fade;
      }
        
      if(digitalRead(col4[i]))
      {
        count[i*5+3]++;
        col4Color+=fade;
      }
      else
      {
        count[i*5+3] = 0;
        if(count[3] == 0 && count[8] == 0 && count[13] == 0)
          if(col4Color > 0)
            col4Color-=fade;
      }
        
      if(digitalRead(col5[i]))
      {
        count[i*5+4]++;
        col5Color+=fade;
      }
      else
      {
        count[i*5+4] = 0;
        if(count[4] == 0 && count[9] == 0 && count[14] == 0)
          if(col5Color > 0)
            col5Color-=fade;
      }
  }
  //edge checking
  if(col1Color>colorMax*2)
    col1Color = colorMax*2;
  if(col2Color>colorMax*2)
    col2Color = colorMax*2;
  if(col3Color>colorMax*2)
    col3Color = colorMax*2;
  if(col4Color>colorMax*2)
    col4Color = colorMax*2;
  if(col5Color>colorMax*2)
    col5Color = colorMax*2;

   //changing the colors based on how long the colors have beeen on
   for(int j = 0; j < piece; j++)
   {
    if(col1Color < colorMax)
     strip.setPixelColor(0*piece+j+start, strip.Color(col1Color, colorMax, 0));
    else
     strip.setPixelColor(0*piece+j+start, strip.Color(colorMax, colorMax, col1Color-colorMax));
    if(col2Color < colorMax)
     strip.setPixelColor(1*piece+j+start, strip.Color(col2Color, colorMax,0));
    else
     strip.setPixelColor(1*piece+j+start, strip.Color(colorMax, colorMax, col2Color-colorMax));
    if(col3Color < colorMax)
     strip.setPixelColor(2*piece+j+start, strip.Color(col3Color, colorMax,0));
    else
     strip.setPixelColor(2*piece+j+start, strip.Color(colorMax, colorMax, col3Color-colorMax));
    if(col4Color < colorMax)
     strip.setPixelColor(3*piece+j+start, strip.Color(col4Color, colorMax,0));
    else
     strip.setPixelColor(3*piece+j+start, strip.Color(colorMax, colorMax, col4Color-colorMax));
    if(col5Color < colorMax)
     strip.setPixelColor(4*piece+j+start, strip.Color(col5Color, colorMax,0));
    else
     strip.setPixelColor(4*piece+j+start, strip.Color(colorMax, colorMax, col5Color-colorMax));
    
    strip.show();

   }
   if(col5Color < colorMax)
     strip.setPixelColor(58, strip.Color(col5Color, colorMax,0));
   else
     strip.setPixelColor(58, strip.Color(colorMax, colorMax, col5Color-colorMax));
    
   strip.show();
  
  for(int i = 0; i < 3; i++)
  {
    Serial.print(count[i*5+0]);
    Serial.print(" ");
    Serial.print(count[i*5+1]);
    Serial.print(" ");
    Serial.print(count[i*5+2]);
    Serial.print(" ");
    Serial.print(count[i*5+3]);
    Serial.print(" ");
    Serial.print(count[i*5+4]);
    Serial.print(" ");

  }

  Serial.println();
  delay(100);
  

}

Custom parts and enclosures

KeyMat CAD File
This is the complete assembly of the mat. The format is .igs, so it should import to most CAD software programs.
KeyMat.igs
KeyMat Inventor CAD Files
The 3D model was originally done in AutoDesk Inventor. This is a zip file which contains all the separate files as well as the assembly file.
KeyMat%20Inventor%20Files.zip
KeyMat Rendering-1
A Rendering of the CAD model using KeyShot
1
KeyMat Rendering-2
Another rendering of the CAD model using KeyShot
2
KeyMat Rendering - Exploded View
An exploded view rendering of the mat. The CAD model was rendered using KeyShot
3

Schematics

KeyMat System
This general system lays out the important components of the KeyMat. It shows how power and data move along the components of the system in a quick and easy diagram. It includes the 3 by 5 copper tape grid that act as touch sensors; this allows the mat to knows where the person is. This diagram also includes how the system connect the arduino, the computer, the LED lights, and the app.
Final%20system
KeyMat Wiring Diagram
This diagram shows the inputs and outputs for the KeyMat in order to allow for easy recreation.
Fina%20wire%20diagram

Comments

Similar projects you might like

Home Plant Watering System

Project tutorial by Alexander

  • 15,204 views
  • 2 comments
  • 42 respects

Arduino Control AC Water Heater temperature

Project tutorial by Mohannad Rawashdeh

  • 9,041 views
  • 0 comments
  • 6 respects

IoT-433mhz

Project tutorial by Rocco Musolino

  • 10,668 views
  • 2 comments
  • 25 respects

Cardiac Monitoring System - EKG

Project showcase by Zorzonel Vlad

  • 10,444 views
  • 7 comments
  • 34 respects

Complete PID Electric Smoker Control with Bluetooth

Project showcase by Retguy

  • 1,906 views
  • 2 comments
  • 7 respects

Arduino Kitchen Timer

Project tutorial by Team I and myself

  • 54,489 views
  • 37 comments
  • 77 respects
Add projectSign up / Login