Controller game design with e-textiles materials
I took the E-Textiles deep dive and was a complete challenge. I never worked with fabrics before and trying to understand how to use conductive fabrics was a little hard to understand. When I started to experiment with the different fabrics and threads I let my imagination run to design a game controller.
The purpose of this project was to make a controller gift for someone we care about. In my case, I decide to make it for my brother Ezdraz. For the proposal projects brainstorming I choose different simple games like PAC-MAN, THROW THE BOTTLE, and GUACA-MOLE. This last game I played with my brother when we were younger and we had a lot of fun. So I started to figure out how to redesign the game using fabrics and textiles.
Design sketches
First sketch of the boardThis was the first design of the game board. The idea was to use the hammer and the buttons as an electric switch. And when the conductive coper fabric make contact between the surfacen in the hitting process, the point alarm is activated. | PCB game board sketchThe sketch shows the PCB traces of each sensor/button and LED'S components. Instead of using the hammer as a conductive component, the hammer activates the pressure button by hitting the sensor. |
---|---|
Console connections and indicatorsIn this sketch is pictured the microcontroller connections and the indicators (buzzer, pancake motor)outputs. The idea of having the microcontroller separated from the game board has the purpose was to protect all game connections. |
Materials
1.
Copper taffeta fabric
2.
Karl Grimm silver conductive thread
3.
Heat'n'bond fusible interfacing
4.
Muslin fabric
5.
Felt fabric
6.
Dubetina fabric
7.
Foam
8.
Old color sweater
9.
Non-conductive thread
10.
Velostat
11.
Velcro dots
11.
Embroidery needle
12.
Teensy LC
13.
LEDs
14.
Paper clips
15.
Jumper wires
16.
Cardboard
17.
Soldering iron and welding
18.
Scissors and cutter
19.
Insulating tape
20.
Rice (Hammer filler)
21.
Protoboard
Making the pressure sensors
Making the lights indicators
LED terminalsUsing an old sweater with color dots. I cut circles depending of the LED/shape color. I added two tabs for both LED terminals. | Game color indicatorsTo give more volume to the indicator circles I placed foam and I sewed each LED terminal and the circle sides to close the shape. |
---|
Game board and console
Game code
Following the sketch diagram I drawn the buttons and indicators position on the muslin. | The first connections I sewed were each component with ground. | I sewed all the input/output terminals of each component. | After filling the muslin with foam and sewed the board I isolated the PCB with red felt fabric. |
---|---|---|---|
I added at the end of each thread terminal paper clips, to connect it with aligator clips to the game console. | I wanted to sew the Teensy pins with the conductive fabric and soak it with the fabric, but that failed because the thread was not well attached with the microcontroller pins. | After having issues sewing the Teensy, I decided to use a protoboard to connect the sensors with the microcontroller. | I ended up using a protoboard and jumper wires to connect the Teensy with the game inputs and outputs. The sewed terminal is ground. |
I used a pancake motor and a buzzer to notify when the gamer earns one point. I connected each component using welding to the Teensy terminals. | After coating the console board, I connected each terminal of the game. | Integration of the board and the console | I used rice to fill the felt fabric hammer. Using some of the sweater color circles I decorated the hammer. |
#define INTERVALO_MENSAJE1 300//The time that is going to take to read each random number
unsigned long tiempo_1 = 0;//Initial time
long randomm;// variable for the random number generation.
int square=A0;//Square shape input. We are going to read the pressure sensor.
int banana=A1;//Banana shape input.
int rectangle=A2;//Rectangle shape input.
int circle=A3;//Circle shape input.
int sensorSquare;//Variable in which we are going to assign the sensor values.
int sensorBanana;
int sensorRectangle;
int sensorCircle;
int buzzer=8;//Buzzer pin
int buzzer1=7;//Pancake pin
int ledG=9;//Green led
int ledP=10;//Pink led
int ledY=11;//Yellow led
int ledO=12;//Orange led
void setup(){
Serial.begin(9600);//Calling serial port
pinMode(square, INPUT_PULLUP);//Assigning sensor as an input. We are going to read data form that pin.
pinMode(banana, INPUT_PULLUP);
pinMode(rectangle, INPUT_PULLUP);
pinMode(circle, INPUT_PULLUP);
pinMode(buzzer,OUTPUT);//Assigning our points alarms as outputs.
pinMode(buzzer1,OUTPUT);
pinMode(ledG,OUTPUT);//Assigning the LEDs as outputs. The logic of this is that we are going to generate
pinMode(ledP,OUTPUT);//random numbers and assign each LED to one of them to turn on the LEDs randomly.
pinMode(ledY,OUTPUT);//that's why are outputs of the programm but inputs in the game mechanics.
pinMode(ledO,OUTPUT);
digitalWrite(ledG,LOW);//Each time that we load the code all items are going to be turn off
digitalWrite(ledP,LOW);
digitalWrite(ledY,LOW);
digitalWrite(ledO,LOW);
digitalWrite(buzzer,LOW);
digitalWrite(buzzer1,LOW);
}
void loop(){
sensorSquare = analogRead(square); // reading each sensor values.
Serial.println(sensorSquare); //printing the values in the serial port.
sensorRectangle = analogRead(rectangle);
Serial.println(sensorRectangle);
sensorCircle = analogRead(circle);
Serial.println(sensorCircle);
sensorBanana = analogRead(banana);
Serial.println(sensorBanana);
if(millis() > tiempo_1 + INTERVALO_MENSAJE1){//Instead of using delay that makes time issues in our code
tiempo_1 = millis();// we are going to use millis function.
//We are going to count each time interval settled to perform an action.
randomm=random(1,5);//In this case we are generating random numbers each 300 miliseconds.
if(randomm==1){//Conditional that activates Greenled when a 1 is displayed.
digitalWrite(ledG,HIGH);
digitalWrite(ledY,LOW);
digitalWrite(ledP,LOW);
digitalWrite(ledO,LOW);
}
if(randomm==2){
digitalWrite(ledG,LOW);
digitalWrite(ledY,HIGH);
digitalWrite(ledP,LOW);
digitalWrite(ledO,LOW);
}
if(randomm==3){
digitalWrite(ledG,LOW);
digitalWrite(ledY,LOW);
digitalWrite(ledP,HIGH);
digitalWrite(ledO,LOW);
}
if(randomm==4){
digitalWrite(ledG,LOW);
digitalWrite(ledY,LOW);
digitalWrite(ledP,LOW);
digitalWrite(ledO,HIGH);
}
//less than 400 are the values readed when the buttons are pressed
//This signal behavior is for the four buttons.
}//Conditional that depending on the range of values is going to activate the buzzer and the vibration
//motor
if(sensorBanana<400||sensorSquare<400||sensorRectangle<400||sensorCircle<400){
tone (buzzer1, 789);//Activation of the buzzer
digitalWrite(buzzer,HIGH);//Activation of the vibration indicator
delay(200);
digitalWrite(buzzer,LOW);
noTone(buzzer1);
Serial.println("mole");//Mole means that you earned 1 point.
}//If the buttons are not pressed the buzzer and the motor are going to be turned off
}
Game testing
Guacamole bro test
Game extra considerations
Extra features I want to add
ON/OFF switch.
Score counter.
Difficulty/speed control.
Hit out of the time indicator.
Other hammers configurations.
(More inclusive controller)