This is an old revision of the document!


Sensor de inclinación

Para la asignación de esta semana, decidí hacer un sensor de inclinación.

Esquema:

captura.jpg

Comienzo eligiendo la tela, necesito una que sea muy conductora. Luego, hago una prueba con el multímetro.

img_0160.jpg

Una vez que la conductividad está marcada, elijo los materiales que usaré en mi proyecto:

• Cable conductor

• Tejido conductor

•Lana

• LEDs

• Tejido no conductivo

• Cuentas no conductoras

Comienzo haciendo un pompón con lana e hilo conductor.

Luego pongo las cuentas para aislar y así no tengo problemas si el cable toca otro hilo.

Comienzo a coser siguiendo el esquema.

Para no confundirme con los pines de los leds, los doblé de forma diferente, doblé el pin negativo con una forma más redondeada y el positivo con una forma más cuadrada.

De esta manera puedo coserlos perfectamente y sé que no cometeré ningún error.

img_0161.jpg

Titulares de batería

Siguiendo el diagrama, la parte del hilo que sale del pompón es positiva, así que termino cosiendo un poco más de puntadas para que cuando inserte la batería toque bien el hilo.

img_0146 _-_ copia_2_.jpg

Termino cosiendo los siguientes leds y el soporte de la batería.

img_0168.jpg


Programación ATtiny

Configure la placa ATTINY:
1. Preferencias de Arduino: administradores adicionales de la tarjeta url
2. Agregue: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

captura_1.jpg

  1. Cerramos el gerente
  2. En herramientas
  3. Plato
  4. Vamos a Card Manager
  5. Buscar Attiny

Usando su Arduino ISP para programar un microcontrolador ATtiny

Gracias a Kobakant por su fantástico tutorial: http://www.kobakant.at/DIY/?p=3742

Burn Bootloader

Para establecer la velocidad del reloj de su ATtiny sea más rápida (8Mhz) que la predeterminada de 1 MHz.

  1. Seleccione “ATtiny45 (8 MHz)” en el menú “Herramientas> Tarjeta”
  2. Seleccione “Arduino como ISP” en el menú “Herramientas> Programador”
  3. Seleccione “Burn Bootloader” en el menú “Herramientas”

Arduino como ISP

Cargando boceto

  1. Abra el boceto que desea cargar en ATtinyATtiny
  2. Seleccione “ATtiny45 (8 MHz)” en el menú “Herramientas> Junta”
  3. Seleccione “Arduino como ISP” en el menú “Herramientas> Programador”
  4. Cargar boceto

Si recibe este mensaje de error, está bien
avrdude: defina las señales PAGEL y BS2 en el archivo de configuración para la parte
AVrdude ATtiny85: defina las señales PAGEL y BS2 en el archivo de configuración para la parte ATtiny8

Retire el condensador cuando cargue el boceto de Arduino ISP en el Arduino Uno y reemplace el condensador para registrar el administrador de arranque y cargar cualquier boceto en su ATtiny.ATtiny.


ATtinyProgramación ATtiny

Configure la placa ATTINY: 1. Preferencias de Arduino: administradores adicionales de la tarjeta url 2. Agregue: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.jsonATTINY board:

captura_1.jpg

  1. Cerramos el gerente
  2. En herramientas
  3. Plato
  4. Vamos a Card Manager
  5. Buscar Attiny

Convirtiendo su Arduino en un programador de ISPArduino en un programador de ISP

Sin condensador!

Descargue el software Arduino e instale el softwareArduino e instálelo Descargue la carpeta ATtiny y guárdela en la carpeta “hardware” de la carpeta arduino sketchesATtiny y guárdela en la carpeta “hardware” de la carpeta de bocetos Arduino Reinicie ArduinoArduino Abra “ArduinoISP” “boceto en la carpeta” Ejemplos “ Seleccione” Arduino “Uno” desde el menú “Herramientas> Tablero” Arduino “Uno” desde el menú “Herramientas> Tablero” Seleccione en el menú Herramientas> Puerto serie Cargue el bocetoArduino software and install itArduino software and install it
ATtiny folder and save it in the “hardware” folder of the Arduino folder sketchesATtiny folder and save it in the “hardware” folder of the Arduino sketches folder


Arduino“ One “from the menu” Tools> Board “Arduino” One “from the menu” Tools> Board ”

Usando su Arduino ISP para programar un microcontrolador ATtiny ¡Agregue condensadores y conexiones de programación! Arduino ISP para programar un microcontrolador ATtinyArduino ISP to program an ATtiny microcontroller Add capacitors and programming connections! Arduino ISP to program an ATtiny microcontroller

Con condensador!

Seleccione “ATtiny45 (8 MHz)” en el menú “Herramientas> Junta”
Seleccione “Arduino como ISP” en el menú “Herramientas> Programador” Arduino como ISP “en el menú” Herramientas> Programador “ Seleccione” Grabar administrador de arranque “en Menú “Herramientas” (sí condensador) Abra el boceto que desea cargar en el boceto ATtinyATtiny Load (sí condensador) Ahora conecto mi sensor a Attiny agregando un zumbador.Arduino as ISP” in the menu “Tools> Programmer” Arduino as ISP “in the” Tools> Programmer “menu

Esquema:

vimeo>240630034?medium}}

Código:

/ *
CÓDIGO para la muestra de sensores de textiles electrónicos de Fabricademy
creada por primera vez para la Fabricademy 2017
Hannah Perner-Wilson y Mika Satomi, KOBAKANT
* /

#define sensorPin 3
#define speakerPin 2
#define ledPin 0

int sensorValue = 0;
int noiseFrequency = 0;
int ledBrightness = 0;

void setup ()
{
pinMode (sensorPin, INPUT); use el número de pin digital aquí
pinMode (speakerPin, OUTPUT);
pinMode (ledPin, OUTPUT);
} void loop ()
{
sensorValue = analogRead (sensorPin);
usa el número de pin analógico aquí

MAKE SOUND:
if (sensorValue <900) {noiseFrequency = map (sensorValue, 0, 1023, 100, 10000); ruido (speakerPin, noiseFrequency); }
LED FADE: ledBrightness = map (sensorValue, 0, 1023, 0, 255); analogWrite (ledPin, ledBrightness); } HAGA SONIDO EN EL ATTINY SIN LA BIBLIOTECA DE SONIDO: ruido nulo (ruido de char sin signo Pin, int frequencyInHertz) {largo delayAmount = (largo) (1000000 / frequencyInHertz); digitalWrite (noisePin, HIGH); delayMicroseconds (delayAmount); digitalWrite (noisePin, LOW); delayMicroseconds (delayAmount); }ATTINY WITHOUT THE SOUND LIBRARY: void noise (unsigned char noisePin, int frequencyInHertz) { long delayAmount = (long)(1000000 / frequencyInHertz); digitalWrite(noisePin, HIGH); delayMicroseconds(delayAmount); digitalWrite(noisePin, LOW); delayMicroseconds(delayAmount); }


Cinturón

Empecé a cortar un rectángulo de 95 x 22 cm en dos tejidos diferentes. Elegí cuero sintético para darle cuerpo al cinturón y al tul para decorar y esconder los componentes electrónicos.

Para la decoración, vectoricé una imagen para cortarla en vinilo textil.

hh_2_.jpg

Abrí con Rhinoceros y rematé el diseño.

I cut the vinyl with a 45ºC blade that is usually the basic one with these parameters:

Speed: 24

Power: 130

Temperature at 167º (ask the seller, not all vinyls are ironed at the same temperature).

dibujo1.jpg


This week, we worked with Gemma v2 and 4 neopixel.

If you have Windows, download these drivers:

https://github.com/adafruit/Adafruit_Windows_Drivers/releases/download/2.0.0.0/adafruit_drivers_2.0.0.0.exe

Then, open Arduino and configure the board:

captura5.jpg

Then, select USBtinyISP from the Tools→Programmer sub-menu

captura6.jpg

After installing the Arduino IDE with support for Adafruit's boards you can load a simple blinking LED example to test uploading to Gemma works as expected. Open the Arduino IDE and replace the sketch code with the following blink code:

Edit

Blink Gemma:

1. /*
2. Blink
3. Turns on an LED on for one second, then off for one second, repeatedly.
4.
5. This example code is in the public domain.
6.
7. To upload to your or Trinket:
8. 1) Select the proper board from the Tools→Board Menu (Arduino Gemma if
9. teal, Adafruit Gemma if black)
10. 2) Select the uploader from the Tools→Programmer (“Arduino Gemma” if teal,
11. “USBtinyISP” if black Gemma)
12. 3) Plug in the Gemma into USB, make sure you see the green LED lit
13. 4) For windows, make sure you install the right Gemma drivers
14. 5) Press the button on the Gemma/Trinket - verify you see
15. the red LED pulse. This means it is ready to receive data
16. 6) Click the upload button above within 10 seconds
17. */
18.
19. int led = 1; blink 'digital' pin 1 - AKA the built in red LED
20.
21.
the setup routine runs once when you press reset:
22. void setup() {
23. initialize the digital pin as an output.
24. pinMode(led, OUTPUT);
25.
26. }
27.
28.
the loop routine runs over and over again forever:
29. void loop() {
30. digitalWrite(led, HIGH);
31. delay(1000);
32. digitalWrite(led, LOW);
33. delay(1000);
If the blink works correctly, load the program for our neopixels.

Edit

Code:

#include <Adafruit_NeoPixel.h>


#define NUM_LEDS 4 Number of NeoPixels
#define PIN 1
DIGITAL pin # where NeoPixels are connected
IMPORTANT: Avoid connecting on a live circuit. . .
if you must, connect GND first.
Adafruit_NeoPixel strip = Adafruit_NeoPixel( NUM_LEDS, PIN) ;
void setup() {
strip. begin();
strip. setBrightness(100); 100/255 brightness ( about 40%)
strip. show();
Initialize all pixels to ' off'
}
void loop( ) {
for( int j=0; j<256; j ++) {
for( int i=0; i<NUM_LEDS; i++) {
strip. setPixelColor( i, Wheel1) ;
}
strip.show();
delay(20);
}
}
Input a value 0 to 255 to get a color value.
The colours are a transition r - g - b - back to r.
uint32_t Wheel( byte WheelPos) {
if( WheelPos < 85) {
return strip. Color(WheelPos * 3, 255 - WheelPos * 3, 0);
} else if(WheelPos < 170) {
WheelPos -= 85;
return strip. Color(255 - WheelPos * 3, 0, WheelPos * 3);
} else {
WheelPos -= 170;
return strip. Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
}

Then, sew the circuit this way.

Edit

Circuit:

dibujo2.jpg

img_8139.jpg

Finish making the belt.

To have the battery on hand and thus be able to turn on and off the belt, make a small cut on the fabric so that the battery is on the inside of the belt.

Fold it in half and machine sew.

Sew textile clasps at the ends to be able to close our belt.

Video: