• projects.
    • neon space moon.
    • the shape of refractive memory.
  • places.
    • new york.
    • bali.
    • paris.
    • los angeles.
    • australia.
    • japan.
    • sedona.
    • england.
  • people.
    • sports.
    • portraits.
    • events.
  • things.
    • wildlife.
  • itp blog.
    • itp_general.
    • itp_icm_f18.
    • itp_physical computing_f18.
    • itp_video&sound_f18.
    • itp_visual language_f18.
    • itp_animation_f18.
    • itp_wearables_s19
    • itp_fandom_s19
    • itp_turning_s19
    • itp_uxdesign_s19
    • itp_fungus_s19
    • itp_softrobotics_s19
    • itp_augmentedreality_f19
    • itp_fabrication_f19
    • itp_light&interactivity_s20
  • connect with me.
  • Menu

Madshutter Photo

  • projects.
    • neon space moon.
    • the shape of refractive memory.
  • places.
    • new york.
    • bali.
    • paris.
    • los angeles.
    • australia.
    • japan.
    • sedona.
    • england.
  • people.
    • sports.
    • portraits.
    • events.
  • things.
    • wildlife.
  • itp blog.
    • itp_general.
    • itp_icm_f18.
    • itp_physical computing_f18.
    • itp_video&sound_f18.
    • itp_visual language_f18.
    • itp_animation_f18.
    • itp_wearables_s19
    • itp_fandom_s19
    • itp_turning_s19
    • itp_uxdesign_s19
    • itp_fungus_s19
    • itp_softrobotics_s19
    • itp_augmentedreality_f19
    • itp_fabrication_f19
    • itp_light&interactivity_s20
  • connect with me.
3ix4YHb4Ri%2BvRm1c%254dqYA.jpg

Creating a new sense

through wearables

Week Three | Creating a new sense through wearables

March 29, 2019

For this project I wanted to emulate a sense of color awareness from the environment. I found that Flora makes a sensor that can determine the spectrum of color. I used felt and velcro to create this mockup device of a color changing bracelet (via sewable neopixle) where when the sensor detects a color, it changes the four programed lights to change that color.

I started out with planning out the circuitry and programming. I wanted to use felt and velcro to create the construction of this bracelet, and give it a super-hero vibe as it’s more of a cuff for the wrist. I setup the Arduino tool with this library to work with the sensor and borrowed code from the Aidafruit project library to give my lights some life.

r%pC3hnaRI6ZQ9aaq+AcWQ.jpg tOKX5Iy7RqCkwIlbEkjJfQ.jpg IzLPg7H8R2m18hpgmrGzZQ.jpg iXytLYFdTC2tWfvUbcInAQ.jpg pxrVEEsHQ96cd2OM37gPwQ.jpg CAM8K1A6QTajIuWuNglkwg.jpg 4B1LuasuT72HAx2hBkAe4Q.jpg 2TiuT17gTOezxi6en+vsiA.jpg 7CvhoNh3RRG1P3eKijWfPw.jpg 3ix4YHb4Ri+vRm1c%4dqYA.jpg

Code below:

#include <Wire.h>
#include "Adafruit_TCS34725.h"
#include <Adafruit_NeoPixel.h>

// Parameter 1 = number of pixels in pixels
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_RGB     Pixels are wired for RGB bitstream
//   NEO_GRB     Pixels are wired for GRB bitstream
//   NEO_KHZ400  400 KHz bitstream (e.g. FLORA pixels)
//   NEO_KHZ800  800 KHz bitstream (e.g. High Density LED pixels)
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(4, 6, NEO_GRB + NEO_KHZ800);

// our RGB -> eye-recognized gamma color
byte gammatable[256];

Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);

void setup() {
  Serial.begin(9600);
  Serial.println("Color View Test!");
  
  pixels.begin();
  pixels.show(); // Initialize all pixels to 'off'
  
  if (tcs.begin()) {
    Serial.println("Found sensor");
  } else {
    Serial.println("No TCS34725 found ... check your connections");
    while (1); // halt!
  }
  
  // thanks PhilB for this gamma table!
  // it helps convert RGB colors to what humans see
  for (int i=0; i<256; i++) {
    float x = i;
    x /= 255;
    x = pow(x, 2.5);
    x *= 255;
      
    gammatable[i] = x;      
    //Serial.println(gammatable[i]);
  }
  
  for (int i=0; i<3; i++){ //this sequence flashes the first pixel three times as a countdown to the color reading.
    pixels.setPixelColor (0, pixels.Color(188, 188, 188)); //white, but dimmer-- 255 for all three values makes it blinding!
    pixels.show();
    delay(1000);
    pixels.setPixelColor (0, pixels.Color(0, 0, 0));
    pixels.show();
    delay(500);
  }
  
  uint16_t clear, red, green, blue;

  tcs.setInterrupt(false);      // turn on LED

  delay(60);  // takes 50ms to read 
  
  tcs.getRawData(&red, &green, &blue, &clear);

  tcs.setInterrupt(true);  // turn off LED
  
  Serial.print("C:\t"); Serial.print(clear);
  Serial.print("\tR:\t"); Serial.print(red);
  Serial.print("\tG:\t"); Serial.print(green);
  Serial.print("\tB:\t"); Serial.print(blue);

  // Figure out some basic hex code for visualization
  uint32_t sum = red;
  sum += green;
  sum += blue;
  //sum += clear; // clear contains RGB already so no need to re-add it
  
  float r, g, b;
  r = red; r /= sum;
  g = green; g /= sum;
  b = blue; b /= sum;
  r *= 256; g *= 256; b *= 256;
  Serial.print("\t");
  Serial.print((int)r, HEX); Serial.print((int)g, HEX); Serial.print((int)b, HEX);
  Serial.println();

  Serial.print((int)r ); Serial.print(" "); Serial.print((int)g);Serial.print(" ");  Serial.println((int)b );
  colorWipe(pixels.Color(gammatable[(int)r], gammatable[(int)g], gammatable[(int)b]), 0);
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<pixels.numPixels(); i++) {
      pixels.setPixelColor(i, c);
      pixels.show();
      delay(wait);
  }
}

void loop() {
  
  //loop is empty because it only takes the color reading once on power up! Turn the scarf off and on again to change the color.
    
}


Prev / Next

Donec sed odio dui.

Vestibulum id ligula porta felis euismod semper. Maecenas faucibus mollis interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Curabitur blandit tempus porttitor. Curabitur blandit tempus porttitor. Donec id elit non mi porta gravida at eget metus.

Sed posuere consectetur est at lobortis.

Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean lacinia bibendum nulla sed consectetur. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras mattis consectetur purus sit amet fermentum. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.​