9. Wearables¶
Research¶
Assigment of the week was to create
-
1 input and one output, using hard-soft connection solutions and battery
-
Create 2 actuator swatches and test them with the Arduino or ATTiny so I diced to attempte with: leds / neopixels,heat pad / with thermochromic coating and a speaker. Key word being attemt.
References & Inspiration¶
image by Marie Julio link to ebrodiered speakers
Tools¶
- Embroidery / Sewing machine
- Fabric
- Neopixels
- Needles
- Multimeter
- Aligator Clips
- Flora
- Arduino IDE
Tools¶
Motion Sensor¶
* Side note I have no idea why they would put in another cable that NC means not connected and docent do anything from what I understand but hey I am not an engineer I am just trying to make lights and sensors work.
Amplifer¶
link to speifics port to links
- Embroiderer Machine
- Conductive Thread
Process and workflow¶
Sketches Are iterations of of what I wanted to play with the spade of the speaker to be like and the idea of tryinf to create a LED light recative to speed and sound for bikers to be able to implent to have it flash and be constant when its at a close point to proctect cyclist.
From the motion sensor GND is conected to GND, Power. eo 3.V in the folora, The tiger point intos to pin 10 and pin 6 on the folra board.
Software Step 1. Download the UltrasonicRanger Library from Github.
Step 2. Refer How to install library to install library for Arduino.
Step 3. Copy the code into Arduino IDE and upload. If you do not know how to upload the code, please check how to upload code.
include "Ultrasonic.h"¶
Ultrasonic ultrasonic(7); void setup() { Serial.begin(9600); } void loop() { long RangeInInches; long RangeInCentimeters;
Serial.println("The distance to obstacles in front is: "); RangeInInches = ultrasonic.MeasureInInches(); Serial.print(RangeInInches);//0~157 inches Serial.println(" inch"); delay(250);
RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval Serial.print(RangeInCentimeters);//0~400cm Serial.println(" cm"); delay(250); }
I am still attempting to create the speaker since the design I was attempting did not work but still had added it it to the embroider process and here are the steps for those but the channels did not work because they were to close together.
image from Adafruit
To be able to set up the amplifier board you need to sander the pin to the connections and have the connection to one of the end of the speaker to a positive and negative in the aux port cord.
For the color thermal changing ink we used some thermal paint that changes with heat. By first applying a mixture of the pigment and thin base paint layer that drys more transparently mixed in a 1 to 6 ratio with the paint being 1 and the other part the pigment.Then by using a cuirit board and electrical current to create the heat and activate the reaction.
Code Example¶
KEY POINTS Specifing the triger points from the Ultrasonic Ranger V2.0 works like an echo locator using sound and wind to be able to sense the motion.
// #include <Adafruit_NeoPixel.h>
#include <Ultrasonic.h>
#define ONBOARD_NEOPIXEL 8
#define STRIP_LENGTH 4
#define STRIP_PIN 9
#define TRIG_PIN 6
#define ECHO_PIN 10
const int MIN_DISTANCE = 10; // Minimum distance for the range
const int MAX_DISTANCE = 30; // Maximum distance for the range
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, 9, NEO_GRB);
Adafruit_NeoPixel onboard = Adafruit_NeoPixel(1, ONBOARD_NEOPIXEL, NEO_GRB);
#define STRIP_LENGTH 1
Ultrasonic ultrasonic(6);
void setup() {
Serial.begin(9600);
pinMode(TRIG_PIN, OUTPUT); // Set TRIG as output
pinMode(ECHO_PIN, INPUT); // Set ECHO as input
onboard.begin();
onboard.setBrightness(30);
onboard.show();
strip.begin();
strip.show();
}
void loop() {
long duration, distance;
// Trigger the ultrasonic sensor
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
long RangeInCentimeters;
RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval
Serial.print(RangeInCentimeters); //0~400cm
strip.clear();
strip.setPixelColor(1, strip.Color(255, 204, 0));
strip.setPixelColor(2, strip.Color(255, 61, 0));
strip.setPixelColor(3, strip.Color(255, 204, 0));
strip.setPixelColor(0, strip.Color(255, 61, 0));
strip.show();
delay(RangeInCentimeters);
strip.clear();
strip.show();
delay(RangeInCentimeters);
}