9. Wearables¶
This week is expirmentation of Wearables and will present the steps with referances i started with to understand the process . end up with a 3d print integrated with electronic circit .
Research and Inspiration¶
There are many interesting and inspiring projects in this field, and the most project has inspired me for wearables was
second skin research project.
working on layers between fabric and electronics .
Electronic Components¶
Here are some important elements will be used :
What is ransistor?¶
Transistor is like an electronic switch or amplifier. It can turn current on and off, or Control a big current .
What are soft speakers?¶
In this experiment I explored soft speakers as speakers can be built from fabric instead of the usual hard plastic box.
The idea is to make sound soft, flexible and wearable, so it can live inside textiles, accessories or even on the body.
A soft speaker still follows the same basic principle as a normal loudspeaker:
- stitch a spiral coil using conductive thread or copper tape onto a piece of fabric.
- A strong magnet is placed close to this stitched spiral.
- When Ionnect the coil to a small audio amplifier, the changing current in the spiral creates a magnetic field that pushes and pulls against the magnet.
- The fabric vibrates like a membrane, and these vibrations become sound.
Soft speakers are not about perfect audio quality, but a way to experiment with e-textiles, interaction and materiality turning cloth into something that can both be touched and listened to. To read more check this web site about soft speaker
Expirmentation Process¶
Starting the week with circit design using materials : And solder them with testing the connection between the copper tabe in circit and resistor + transistor to ensure the conductivity .
Conductivity Test¶
soldier¶
Use Skotch Tape to tape the wires on the circit before Soldier them
Tools¶
- Xiao
- soldering iron
- tin
- cables.
- copper tape
Speaker Code¶
#include "pitches.h"
int melody[] = {
NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
4, 8, 8, 4, 4, 4, 4, 4
};
void setup() {
// 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 = 4000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
// stop the tone playing:
noTone(8);
}
}
void loop() {
// no need to repeat the melody.
}
Power Supply¶
Here Uploading the code to microcontroller and use use the electro- power suppply 9voltage . Then Use the Magnit to play the imported melody.
Sound¶
What is Ultrasonic sensor?¶
Ultrasonic" refers to sound waves above the range of human hearing — typically above 20 kHz. It operates in a similar way to how bats and dolphins navigate
code¶
Using this code on arduino to test the sensor
int trigPin = 11; // Trigger
int echoPin = 12; // Echo
long duration, cm, inches;
void setup() {
//Serial Port begin
Serial.begin (9600);
//Define inputs and outputs
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// The sensor is triggered by a HIGH pulse of 10 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
digitalWrite(trigPin, LOW);
digitalWrite(LED_BUILTIN, HIGH);
// Read the signal from the sensor: a HIGH pulse whose
// duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
// Convert the time into a distance
cm = (duration/2) / 29.1; // Divide by 29.1 or multiply by 0.0343
Serial.print(cm);
Serial.print("cm");
Serial.println();
if ( cm < 15 )
{
digitalWrite(LED_BUILTIN, HIGH);
}
else
{
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
}
In the code if ( cm < 15 ) means that if any object come closer than 15 cm the LED will light up but if anything was distanced more than 15 cm means it will be off.
Sensor - Ultrasonic sensor HC-SR04¶
Motion¶
Servo + Motion Sensor¶
What is a servo motor?
A servo is a small motor that spin based on code written with specific choosen angle (0°, 90°, 180°…), It iss perfect to use for tilting, opening, pointing or moving small parts.
Connection to the Arduino
- Red wire → 5V on the Arduino
- Brown/black wire → GND
- Orange/yellow wire → signal pin (here I use digital pin 8)
The motion sensor sends a signal to the Arduino when it detects movement.
The Arduino then sends a command to the servo signal pin, so the servo rotates from its rest position to another angle and then comes back.
In short:
motion detected → Arduino reads it → servo moves → object reacts.
This is the core behavior I use to make the piece feel alive and responsive to people passing by.
Arduino Code¶
#include <Servo.h>
Servo servo;
int angle = 10;
void setup() {
servo.attach(8);
servo.write(angle);
}
void loop()
{
// scan from 0 to 180 degrees
for(angle = 10; angle < 180; angle++)
{
servo.write(angle);
delay(15);
}
// now scan back from 180 to 0 degrees
for(angle = 180; angle > 10; angle--)
{
servo.write(angle);
delay(15);
}
}
Vimeo¶
Process and workflow¶
The project of second skin has inspired me alot ,this is their work diagram and i wanted to test something following layers method with 3d print.
Since I am deeply interested in natural patterns, following a morphogenetic approach studying the geometry and patterns found in animals and other living creatures. For this piece, my design is inspired by butterfly wing patterns and translated into a 3D print.
Inkskape - Map Tracing , from toolbar >> path>> trace bitmap. to extract convert the image lines to vectors instead of skech each line manually .
upload the vector file to rhino and in rhino i had the flexibility to deal with lines and change it is layer on rhino , here you can see that i deleted outer lines frame and kept the patterns .
Select all >> ectrude (close) and from 2D to 3D
exported the file of rhino to stl format to open on cura , as you can see in cura 3D printing settings on Ultimaker Cura with slicing shows more than 8 hours and i decided to reduce it by taking smaller part of the pattern to minimze the time of 3d printing and have more time test it with electronics .
After delete some parts of geometry on rhino , i re-exported the file as stl to open on cura and the time has been reduced and i proceed with !
These are the customized 3d printing settings on cura i used for this pattern.
3D-Pattern output¶
Successfully printed on mesh fabric .
Vimeo 3d pattern¶
Electronic Section¶
Using Xiao Microcontroller and soleder the compoents of wires on them to display the light .
Code Example¶
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define N_LEDS 10 // Update this to match the number of LEDs in your strip
Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
}
void loop() {
for (int i = 0; i < strip.numPixels(); i++) {
// Turn LED to red
strip.setPixelColor(i, strip.Color(255, 0, 0));
strip.show();
delay(50);
// Turn LED off
strip.setPixelColor(i, strip.Color(0, 0, 0));
strip.show();
}
}
Final Product¶
neopixel strips¶
Vimeo¶
## Fabrication files [^1]: File: [3d-print](../files/haneen.ufp)
























