8. Wearables¶
Research & Inspiration¶
Wearables are one fo my favourite topics. I really loved the tutorials of this week. Emma has amazing way to explain electronics. I really enjoyed this week.
I have so many inspirations, that use wearable electronics. Ones I have already mentioned before a lot like.
Pauline van Dongen¶
Her research on Smart Textiles, Solar fashion and Circular fashion, was one of the reasons I have wanted to join a course like Fabricacademy.
Body Wonders from Pauline van Dongen on Vimeo.
Through years, clothing has changed its role and purpose in the society. I believe we are at right time, to start looking a clothing not only as a means to keep our body warm or showcase our status to society.
Clothing can be used to charge our phones, to help us track information of your body and even communicate the feelings we sometimes are not able to articulate.
Phototrope from Pauline van Dongen on Vimeo.
Rachel Freire¶
Rachel Freire is a London based artist and designer working in fashion, costume and garment technology. She has created a lot of great work that has influenced me a lot. She has created this amazing gloves that generate music based on the movement of the hand and fingers - Mimu Gloves
Sophy Wong¶
One of my first big wearable projects I have made was the LED sleeve. I ahve used Sophy's wong tutorial to create it. Sophy Wong is as increadible engineer and maker.
She has created a great Wearable tech projects book, that you can download for free here.
Golden world of Instructables and Adafruit Learn¶
Whenever I need to research something and look for inspiration and how to projects, I always search on Instructables of Adafruit Learn website. Both of these are great resources and can help you understand a lot. There are few wearable projects I would like to mention:
LED Bra LED Scarf NeoPixel LED Cortana Costume Animated LED Boot Laces
Wearables Projects on Intructables
Illuminate Social Garment Caress the Gaze Arduino Color Sensing Glove Which Microcontrollers to choose for your project
Idea & Process¶
I have decided I would like to educational piano gloves, that you could wear anywhere and also use the light as a mean of traslating which tone you should play, so you could actually learn faster.
Tools¶
- 5 x NeoPixel Strip 4
- 1 x Adafruit Flora
- 1 x Speaker STEMMA (can be Piezo or other speaker)
- 5 x resistors 10 kΩ
- 1 x conductive fabrics
- 1 x CD74HC4051E multiplexer
- wires
- solder
- soldering iron
- gloves
Sketches¶
Piano Gloves Circuit by Linette Manuel
Circuit¶
I have designed this circuit,
I used TinkerCAD to try to build the circuit and test the code before I went to actually produce some real gloves. Here is a video of the test.
Code Example¶
#include <Adafruit_NeoPixel.h>
#define PIN 7 // input pin Neopixel is attached to
#define NUMPIXELS 20 // number of neopixels in strip
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
//pack the color in one variable
uint32_t yellow = pixels.Color(255, 255, 0);
uint32_t limeGreen = pixels.Color(133, 255, 0);
uint32_t green = pixels.Color(0, 255, 0);
uint32_t blue = pixels.Color(0, 0, 255);
uint32_t cyan = pixels.Color(0, 255, 255);
uint32_t magenta = pixels.Color(255, 0, 255);
uint32_t off = pixels.Color(0, 0, 0);
// define notes using Arduino Tone library
#define NOTE_C4 262
#define NOTE_D4 294
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_G4 392
// this will check if the button was touched or not
int buttonState = 0;
int startLED;
int endLED;
int strip;
int note;
int noteToPlay;
int noteDuration = 1000 / 4;
int lastTone;
uint32_t color;
// notes in the melody:
int notes[] = {NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4};
int melody[] = {
NOTE_C4, NOTE_E4, NOTE_G4,
NOTE_C4, NOTE_E4, NOTE_G4,
NOTE_E4, NOTE_E4,NOTE_D4, NOTE_E4,NOTE_F4, NOTE_D4,
NOTE_E4, NOTE_E4,NOTE_D4, NOTE_E4,NOTE_F4, NOTE_D4,
NOTE_E4, NOTE_D4, NOTE_C4
};
int colour[] = {yellow, limeGreen, green, blue, cyan, magenta};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
/*
int noteDurations[] = {
4, 8, 8, 4, 4, 4, 4, 4
};
*/
void setup() {
pixels.begin(); // This initializes the NeoPixel library.
pixels.show(); // Turn OFF all pixels ASAP
pixels.setBrightness(64); //from 0 to 255, use it only in setup
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(6, INPUT);
int strip = 0;
int noteToPlay = 0;
Serial.begin(9600);
/*
// iterate over the notes of the melody:
for (int thisNote = 0; thisNote < 8; thisNote++) {
// to calculate the note duration, take one second
// divided by the note type.
//e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
int noteDuration = 1000 / 4;
tone(8, melody[thisNote], noteDuration);
// to distinguish the notes, set a minimum time between them.
// the note's duration + 30% seems to work well:
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
// stop the tone playing:
noTone(8);
}
*/
}
void loop(){
// read the input pin
// if we did not finish the song
if(noteToPlay < 21){
// read the note from melody
note = melody[noteToPlay];
// find where in array of notes the desired note is
for (int i=0; i< 5; i++) {
if (note == notes[i]) {
// assign strip to number to the index
strip = i;
startLED = strip * 4;
endLED = startLED + 3;
Serial.println(note);
break;
}
}
// shine LED
for(int j = startLED; j <= endLED ;j++) {
// if button of the stripe is pressed play note and move in the array
buttonState = digitalRead(strip + 2);
if(buttonState == HIGH) {
playTone();
break;
}
if(note == lastTone) {
color = colour[5];
} else {
color = colour[strip];
}
pixels.setPixelColor(j, color); //set the color green on the first pixel
pixels.show(); //display the color
delay(70);
if(buttonState == HIGH) {
playTone();
break;
}
pixels.setPixelColor(j, off); //set the color green
pixels.show(); //display the color
delay(20);
}
} else {
noteToPlay = 0;
}
delay(100); // Delay a little bit to improve simulation performance
}
void playTone() {
Serial.println(noteToPlay);
tone(8, note, noteDuration);
lastTone = note;
noteToPlay++;
Serial.println(noteToPlay);
}
Results¶
I have finished my piano-glove as a part of my final project. I was testing a multiplexer CD74HC4051E, that I have used to distribute the output of signal from the pads on the fingers. Since my flora did not have enough PINS to connect it with the speaker and the the capacitive touch sensors. I have designed a breakout board for the sensor to be connected with iron clip ons. I took my inspiration from Rachel Freire.
Design of the soft circuit¶
I have created few sketches of the soft circit and on the break out board.
Piano Glove Design by Linette Manuel
Breakoutboard¶
Breakout board prototype¶
Before assembling the breakout I have made a paper prototype just to test the code, the pads and the breakout itself. The paper breakout had a lot of stability issues since the paper was not a good insulator between the top layer and the bottom layer. But it worked for the test.
Multiplexing Prototype by Linette Manuel
Breakout board assembly¶
- I designed and laser cutted 3mm thick wood
- Cutted the conductive copper tape on Cricut
- Transfered my circuit on the wood
- Soldered the clips on the wood
- Soldered in the multiplexer
- Soldered in the 1M Ohm resistors
Multiplexing by Linette Manuel
Code¶
Here you find a code for the piano gloves with the multiplexer. In the future I recommend using the capacitor to have better control of the the flowing current in the circuit, this way it is very unstable.
#include <CapacitiveSensor.h>
#include <Tone.h>
#include "Volume3.h" // Import the magic juju
#define speakerPin 13
bool useVol = true; // Are we using volume envelopes?
byte noteCount = 0; // Keeps track of notes played so far
#define muxS0Pin 10
#define muxS1Pin 9
#define muxS2Pin 8
#define muxSignalPin A0 // explicitly set to analog
#define capSenseSendPin A2 // the PIN on your microcontroller that recieves the signal back
#define sampleRate 6
#define n_inputs 8
int touch[n_inputs] = {};
Tone speaker;
CapacitiveSensor capSense = CapacitiveSensor(capSenseSendPin, muxSignalPin);
int noteVol = 131;
#define NOTE_C4 262
#define NOTE_D4 294
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_G4 392
int note;
int noteToPlay;
int noteDuration = 1000 / 4;
// notes in the melody:
int notes[] = {NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4};
int melody[] = {
NOTE_C4, NOTE_E4, NOTE_G4,
NOTE_C4, NOTE_E4, NOTE_G4,
NOTE_E4, NOTE_E4,NOTE_D4, NOTE_E4,NOTE_F4, NOTE_D4,
NOTE_E4, NOTE_E4,NOTE_D4, NOTE_E4,NOTE_F4, NOTE_D4,
NOTE_E4, NOTE_D4, NOTE_C4
};
int readMux(int channel) {
int controlPin[] = {muxS0Pin, muxS1Pin, muxS2Pin};
int muxChannel[8][3] = {
{0, 0, 0}, //channel 0
{1, 0, 0}, //channel 1
{0, 1, 0}, //channel 2
{1, 1, 0}, //channel 3
{0, 0, 1}, //channel 4
{1, 0, 1}, //channel 5
{0, 1, 1}, //channel 6
{1, 1, 1}, //channel 7
};
//loop through the 4 contol pins
for (int k = 0; k < 3; k ++) {
digitalWrite(controlPin[k], muxChannel[channel][k]);
}
//read the value at the SIG pin
return capSense.capacitiveSensor( sampleRate );
}
void setup() {
// Very important to set control pins to output mode
pinMode(muxS0Pin, OUTPUT);
pinMode(muxS1Pin, OUTPUT);
pinMode(muxS2Pin, OUTPUT);
speaker.begin(13);
digitalWrite(muxS0Pin, LOW);
digitalWrite(muxS1Pin, LOW);
digitalWrite(muxS2Pin, LOW);
Serial.begin( 9600 );
Serial.println("");
Serial.println("Y0\tY1\tY2\tY3\tY4\tY5\tY6\tY7");
Serial.println("---\t---\t---\t---\t---\t---\t---\t---\t---");
}
void loop() {
byte touchIndex = 0;
for ( byte channel = 0; channel < n_inputs; ++channel ) {
int value = readMux(channel);
Serial.print(value);
Serial.print("\t");
/*
// testing just for debbuging
if ( value > 23 && channel == 0){
speaker.play(NOTE_C4, 250);
Serial.print("Black touched: ");
Serial.print(value);
Serial.println();
}
if ( value > 9 && channel == 1){
speaker.play(NOTE_D4, 250);
Serial.print("White touched: ");
Serial.print(value);
Serial.println();
}
if ( value > 13 && channel == 6){
speaker.play(NOTE_E4, 250);
Serial.print("Green touched: ");
Serial.print(value);
Serial.println();
}
if ( value > 17 && channel == 7){
speaker.play(NOTE_F4, 250);
Serial.print("Red touched: ");
Serial.print(value);
Serial.println();
}
*/
}
Serial.println("");
delay(100);
}