E-textiles
📅Started on October 18th.
Liza Stark opened this conductive week with her recitation about energy, circuits and many other necessary concepts, and she showed us a lot of interesting examples of digital and analog sensors.
▪ What I made?
🗹 Build at least one digital and one analogue soft sensors
🗹 Document the sensor project as well as the readings got using the AnalogRead of Arduino
🗹 Document the circuit and it’s schematic
🗹 Upload a small video of the swatches functioning
Also the classes from Emma Pareschi were really useful and easy to follow, she introduced us step by step to the world of the electronics. In general, for me, this week is full of great outcomes and learnings. So, let's start!
▪ Let's talk about: Basics Electronics
▪️ Energy
There are four types of energy that we use in our daily life, but we're gonna focus in electrical energy = electricity that comes from the movement of many charged particles that can produces motion, sound or light. This particles are positive (protons) or negative (electrons) charged. This is important because when a power source exists, the electrons start moving and this is the reason of the current. So current = flow of electrons.
Which are the power sources? we commonly talk about batteries or other power supplies that have two terminals: positive (VCC) and negative (GND). This source has the capability to move the charge and this is called voltage.
▪️ Circuites
▪️ LEDs
This small lights are a type of diodes. Every LED has an orientation so, it's important to place it correctly, the long led is the anode (+) and the short leg is the cathode (-).
The current only flows in one direction - from Anode to Cathode. Also, each LED has a range of brightness depending of the current that flows through it, usually it goes from 5mA to 20mA (maximun light) (mA = miliampers).
▪️ Resistors
This piece is the key to control the ammount of electrons that are moving in the circuit, the resistor impede a flow of current. This element doesn't have an orientation so you can place it anyway. There are many resistors that you can use and you can identify them by it's colors bands that represents the value of the resistor (ohms).
▪️ Summary
🔋 Three important concepts:
- Voltage (V): The electric pressure or force between two points. It is mesuared in volts (V)
- Current (I): It's measured in Ampers (A)
- Resistance (R): The amount of material that resists the flow of current. Measured in Ohms (Ω)
How to measure this parameters? With the multimeter! This tool is useful when you're trying to figure out mistakes in the circuit or you just want to know the value of one of the elements
📚 Three important rules:
- Electrons are lazy - They always follow the pads with less resistance to GND
- Electricity hates waste - So don't use extra power that could damage your component
- Circuits are a system - It's important to know how and where you're gonna place the elements
Practice and understand the concepts
I searched the values for the resistors I had at the lab. I used a color band calculator and then I compared those values with the multimeter exercise.
In this part I got confused because I was trying to measure the current with the wrong element, so here's a reminder for the use of each item.
LEDs ON
I used this big power source to make this first try with the white LED. I used two different voltages to see the difference. It's important to connect the long led to the red wire (positive) and then the short leg with the black wire (negative). Those cables you need to plug-in in the appropiated terminal.
Useful links for Theory Part
▪ Switches - Introduction to sensors
The interaction with a sensor generates a change of voltage. According to that, there are two types o sensors: analog and digital. Sensors are consider switches because they're usually made of two conductive parts that mechanically touch each other in order to close the circuit and get energy.
Ways to change the resistance of the sensor
- Distance: Resistance increases over distance no matter the material you're using
- Contact: Some materials that are pressure sensitive will decrease in resistance when you apply pressure
- Surface area: The resistance decrease when you increase the area of touching
▪Materials for E-textiles
▪️ Conductive
I made a sample book with the materials needed for this assignment, and it may be useful for other students here in the lab. It is made with all the materials we have at our lab, including some that are used for sensors and others for circuits or wearables. I took the template from Kobakant's documentation as a reference.
▪️ Non Conductive
🟣 You can identify a conductive or non conductive material, by yourself, with the multimeter (using the continuity mode). If you get a sound from that material it means it's conductive.
Useful links for materials
▪ Kobakant
▪ Quick and Dirty exercises
▪ Multimeter
Observations: With the bigger hole it has higher values than with the small hole. Is that because of the
surface area
?
▪ Arduino
/*
Button example
*/
// constants won't change. They're used here to set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
With velostat it was a lot more difficult, I was struggling with it because I had to make a lot of pressure so that the multimeter shows the values. With the eeonyx it was a lot more easier, with just a few pressure it was working perfectly.
▪ Multimeter
▪ Arduino
int analogPin = A3;
int analogValue = 0;
void setup() {
// put your setup code here, to run once:
pinMode(analogPin,INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
analogValue=analogRead(analogPin);
analogValue=map(analogValue,230,130,0,255);
analogValue=constrain(analogValue,0,255);
Serial.print(analogValue);
delay(100);
}
Useful link for sensors
▪ Kokabant
▪ Youtube video to understand the difference
First: download the Arduino IDE software which is an open-source that makes it easy to write code and upload it to the board. This software can be used with any Arduino board but we're gonna use the Arduino UNO
▪ Example Sketch
This are the initial steps
that you need to follow when its your first time using arduino.
List of example codes 💻
▪ Blink
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
▪ Fade
int led = 9; // the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
// the setup routine runs once when you press reset:
void setup() {
// declare pin 9 to be an output:
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 9:
analogWrite(led, brightness);
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
▪ Inspiration for the assignment
I was more interested in making an accesory for the body so I thought in a jewerly for the neck/shoulder that can be made with chains (that are conductive material) and I wanted to combine it with a textile. But, in this case, in most of the piece I'll use the textile as an insulating material insted of making it conductive.
Final Result with digital sensor
I organized my tools and materials for this assignment. I used a thin strip of textile to connect the necklace. I also used rings and pins as part of the accessory and to connect the circuit. I decided to use white LEDs and the 5V from the arduino board. Everything is connected to the protoboard as shown below.
Necklace Code - Turn on 3 LEDs
// Encendido y apagado de 3 LEDs
int ledPin1 = 3;
int ledPin2 = 5;
int ledPin3 =6;
int digitalPin=8;
int digitalValue=0;
void setup() { // Configura las SALIDAS y ENTRADAS
pinMode(digitalPin,INPUT);
Serial.begin(9600);
pinMode (ledPin1, OUTPUT);
pinMode (ledPin2, OUTPUT);
pinMode (ledPin3, OUTPUT);
}
void loop(){ //Bucle de Funcionamiento
digitalValue=digitalRead(digitalPin);
if(digitalValue==HIGH){
digitalWrite (ledPin1,LOW);
digitalWrite (ledPin2,LOW);
digitalWrite (ledPin3,LOW);
}else{
digitalWrite (ledPin1,HIGH);
delay (200);
digitalWrite (ledPin1,LOW);
digitalWrite (ledPin2,HIGH);
delay (200);
digitalWrite (ledPin2,LOW);
digitalWrite(ledPin3, HIGH);
delay (200);
digitalWrite (ledPin3,LOW);
}
}
Then the hardest part began because it was difficult to connect everythin in the way I wanted. I was thinking about getting the necklace first and then start placing the resistors and the LEDs but it din't work because for some reason the current was not circulating properly and everything was starting to get tangled up so it was impossible to determine which connection was missing or wrong.
Then I started from zero and made the sensor first. I made a hard-hard connection for this part and when it worked I made some variations in order to attach this system to the main chain that is supposed to be connected to the other chains.
After several failed trials, I built a circuit using the swatch with the yellow strips, the white leds, the digital sensor, the breadboard and the arduino. Finally, using the code above, I tried to connect everything somehow to the main chain, without damaging the operation of the sensor.
My idea was to have more LEDs to light up more the accessory, but with the complications I had at the beginning I prefered to keep it as simple as possible because I started to get a little frustrated with so much strings and also I wasted some yellow strips.
So I decided to leave it that way for this time, and continue doing more research in the future. Even if the result was not exactly as I expected I feel that this motivates me more to keep trying more sensors, materials and create various accessories.
▪ Soft Circuit
A soft circuit was missing to complete this week. I made the first try just with one blue LED and with a 3V battery as the power supply. I used a conductive thread for sewing the positive and negative paths of the circuit. Also I used a piece of copper fabric to make a pocket for the battery. I sewed everything in a non-conductive fabric (felt). Here you can see the materials, steps and the final result
▪ Improvements
This was a hard assingment because I was trying to make some "difficult" connections and I was not really focusing on understanding the operation of both sensors. Also this happened because, at first instance, the digital sensor seemed to me the most appropriate to use and I didn't realized which was the real utility of the analog until I asked my local instructor. I did my best with the necklace but I want to explore more another conductive materials in order to make a necklace with more fabric than chains. Also I'll try to make another type on example with the analog sensor because it took me more time than I expected to understand how it works.
For the week 08 I made a more robust sensor with the same materiales that I used for this week. I'm still using the wire to connect the sensor directly to the breadboard.
I wasn't happy with my analog sensors so I made new ones and tested them. I followed the steps from Kobakant and made two: one with eeonyx and the other with velostat. After all, I really prefer using eeonyx, but this time both worked really well and I tested them many times to be sure. If you measure the ohms with the multimeter, it should show this approx range of values: from 0.2 k ohms to 100 ohms
and that means your sensor is well done!
Useful resources from Kobakant: