Skip to content

8. Wearables

This week we digged deeper in the electronics world focusing on the coding part as well as how we can use actuators and transistors to create more powerful applications for wearable tech.

actuators

An actuator is a component of a machine that is responsible for moving and controlling a mechanism or system.
An actuator requires a control device (controlled by control signal) and a source of energy. The control signal is relatively low energy and may be electricvoltage or current. Its main energy source may be an electric current, hydraulic pressure, or pneumatic pressure.


For the week we used 3 types of actuators:

visual
-LEDs
-Neopixels
-Fiber optics
-Thermochromic ink
Sound
Textile speaker
Motion
-Shape Memory Alloys
-flip dots
-Vive motors+ haptics


transistor

A transistor is a miniature semiconductor that regulates or controls the current or voltage flow.

When working as an amplifier, a transistor transforms a small input current into a bigger output current.
As a switch, it can be in one of two distinct states -- on or off -- to control the flow of electronic signals through an electrical circuit or electronic device.



In large numbers, transistors are used to create microprocessors where millions of transistors are embedded into a single IC which are part of most electronic devices.


simple circuit using a Mosfet transistor

boom bag

Portable music have become a private affair (airpods) maybe it is time for revamping the good old boom box.

A takeaway micro soundsystem with build in visuals

bags and boombox

shape

Perfect for hangouts on the beach, park or walking the dog.

experimentation: sound (speaker)



How does speakers work? Sound is vibration in the air. You can create this vibrations with a temporary magnet (a coiled wire) connected to an audivisual signal attached to a membrane (fabric) and a static magnet. The temporary magnet will move based on the electronic signal causing the air to vibrate.

speaker

The tighter the coil and the bigger the magnet the stronger sound you can create.

For making the speaker we need more power than what our microcontroller gives so we need to use our MOSFET transistor to add a secondary power source.

We use the transistor as an electrical switch by applying small amount of voltage to the gate using the Feather microcontroller current can flow between the drain and the source.

Design av Alve Lagercrantz

first test of my speaker using a simple test melody. You can adjust the melody using the pitches library or download scripts online.

notes in the melody: int melody
note durations: 4 = quarter note, 8 = eighth note, etc. int noteDurations

  NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
};


  4, 8, 8, 4, 4, 4, 4, 4
};
void setup() {

  // iterate over the notes of the melody:
  for (int thisNote = 0; thisNote < 8; thisNote++) {


  }
}

experimentation: visual (thermochromic)

Wile working on the speaker I discovered that it also generates heat, this we could utilize by adding extra visual effects to the bag using thermochromic ink.

How does it work? Thermochromic materials change reversibly their color by a temperature change. Color transition is due to a change in crystalline phase and structure

screenprinted thermochromic ink (white dot is the speaker coil)

experimentation: visual (LEDs)

Neopixels are RGB LEDs with embedded drivers that allows you to control individual LEDs through a microcontroller using only 3 pins

GRN > ground (-)
5 V > +
Din > data


There is a lot of different types of neopixels on the market (matrix, sewable etc) for this project we used a strip that we cut up into individual pieces.

Neopixel requires 5V and 60 mA (per neopixel) for full brightness.

Design av Alve Lagercrantz first tryout using rainbow object and defining the first 10 pixels on the strip

Firstly you need to install the Neopixel library in Arduino

#include <Adafruit_NeoPixel.h>
#define LED_PIN    27
#define LED_COUNT 10

// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

uint32_t off = strip.Color(0, 0, 0);
int num_rainbow = 5;

void setup() {

  strip.begin();           // INITIALIZE NeoPixel strip object (REQUIRED)
  strip.show();            // Turn OFF all pixels ASAP
  strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255)
}

void loop() {

  rainbow(10);             // Flowing rainbow cycle along the whole strip
  strip.fill(off, 0, 10);  // turn the strip off
  strip.show();  //display the color
  delay(1000);

}

      strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
    }
    strip.show(); // Update strip with new contents
    delay(wait);  // Pause for a moment
  }

fabrication

To combine the different components I wrote an code that defined the colors based on the notes from the simple (and slighly annoying melody) using 4 different loops > int COLOR1-4

Design av Alve Lagercrantz


#include <ESP32Servo.h>
#include <Adafruit_NeoPixel.h>
#include "pitches.h"
#define LED_PIN    27
#define LED_COUNT 4

Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

uint32_t RED = strip.Color(255, 0, 0);
uint32_t GREEN = strip.Color(0, 255, 0);
uint32_t BLUE = strip.Color(0, 0, 255);
uint32_t PURPLE = strip.Color(115, 0, 115);

int melody[] = {
  NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
};
int COLOR0[] = {
  BLUE, RED, GREEN, BLUE, RED, GREEN, BLUE, RED
};
int COLOR1[] = {
  RED, GREEN, BLUE, RED, GREEN, BLUE, RED, BLUE
};
int COLOR2[] = {
  GREEN, BLUE, RED, GREEN, BLUE, RED, BLUE, RED
};
int COLOR3[] = {
  BLUE, RED, PURPLE, BLUE, PURPLE, GREEN, BLUE, PURPLE
};

void setup() {
  strip.begin();           // INITIALIZE NeoPixel strip object (REQUIRED)
  strip.show();            // Turn OFF all pixels ASAP
  strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255)
}

void loop() {

    //Change pixels colors
    //strip.fill(COLOR[thisNote], 0, 4);
    strip.setPixelColor(0, COLOR0[thisNote]);
    strip.setPixelColor(1, COLOR1[thisNote]);
    strip.setPixelColor(2, COLOR2[thisNote]);
    strip.setPixelColor(3, COLOR3[thisNote]);
    strip.show();

  }

}


design

circuit

construction
For the simple coil speaker and the neo pixels, I used a 9V battery sewn into the back of the bag as a power supply. The data comes from an ESP32 microcontroller located on the inside of the bag.
The sound comes purely from the vibration of the coil.


bag

Design av Alve Lagercrantz

Conclusion

Next step would be to create an amp so that you would be able to play sound from a audio device as well as potentiometer sensor so that you would be able to adjust the volume.


Last update: 2023-05-15