Category Archives: Week 6 Assignment

Week 6 – Lisa Ho

I connected one of the soft switches I made to your Arduino. I used it to light up an LED. So when I pressed on the switch, the LED will LED up.

Then, I built a circuit with the switch and 3 LEDs. I light up the LED by using different pressure. When the sensor goes greater and equal than 100 but less than 200, the red LED will turn on. When the sensor goes greater or equal to 200, the blue LED will turn on and else the green LED will turn on.

Sadly, I lost the video I filmed. But I have the code which I will post below.

The materials used include Arduino, LEDs, soft switch I made out of felt and sponge, jumper wires, breadboard.

For Midterm

I love constellations. I am thinking of doing an embroidery and incorporating light into the embroidery so it lights up whenever I touch it. I’m thinking this could be an art that hangs up by my wall.

 

Continue reading

Week 6 – Youchun Zhang

Connect a soft switch to Arduino

Demo video IMG_0783

I used a switch from the swatch exchange and uploaded the “Blink” example to control the LED.

Connect a sensor to Arduino

Demo video IMG_0777

Step 1: Set up the LED

Step 2: Build the pressure sensor

Step 3:  Connect to Arduino

I added one if/else and set two thresholds – 450 and 900. When the sensor value is between 450 and 900, the LED will blink slowly. When the sensor value is larger than 900, the blinking will be much faster.

Midterm

For my midterm project, I would like to combine the open-weave pendant style with LED and create a lamp.

Week 6 – Dario Narvaez

To control the LED with the soft button, I used the switch I built in week 3 made out of folded paper, which adds elastic properties to the material. This pushbutton explores a fun way to activate and control a circuit. In this case, I’m connecting the button and the LED through Arduino using a basic digital read function from the inputs and a digital write for the output.

Materials

  • Arduino
  • x3 LEDs
  • Soft Button (Pushbutton)
  • Sensor made with Velostat and fabric
  • Jumper Wires
  • x3 220 k Resistor
  • x1 10k resistor

To control one or more LEDs with a sensor. First, I built a sensor using Velostat. Velostat is a material that must be calibrated very well, since the values can be very variable and instable. To turn the LED off and on using Velostat I used map function where I compared the minimum and maximum number displayed by the sensor (in this case 940 and 1023), with the minimum and maximum intensity of the led (0-255).

To control multiple LEDs with the sensor I created three conditions. When the sensor is pressed and the sensor value is less than 940, the LED 1 (white) illuminates, when the value is greater than 940 and less than 1023, the red LED will light up, and if it is 1023 or maximum pressure, the yellow LED will turn on.

 

Midterm Lamp

For the lamp I found inspiration by the drawings made by connecting dots as a playful way to interact with paper. The idea is grounded under this premise: Can you draw your own lamp? Can you activate the lamp by drawing it? Can you control the light by doodles? As you draw the icons, the circuit closes, and therefore turns on. If the drawing is erased, the circuit opens, and the lamp turns off.

This idea can be scaled to other icons and images such as candlesticks, light bulbs, lamps, etc…

The idea was born when I saw the technology with erasable conductive markers. Although this technology can’t be used in this case due to the limitations in terms of material and the fact that the object will be linked to a specific marker, I believe that I can achieve the same effect with magnets.

Week 6 – Anna Garbier

Part 1: Control an LED using a soft sensor and Arduino.


Part 2: Build a circuit with one constructed sensor (variable resistor), your Arduino, and 3 (or more) LEDs or an RGB LED.

Watch in action here; still images below.

 (the setup)

 (full glass on sensor triggers all three LEDs)

 (playing with light, water, and glass)

Summary: Arduino reads the analog input from a constructed pressure sensor, controlled for example by pouring water into a jar over the sensor pad. Based on the input, the Arduino controls three LEDs: the more pressure, the more lights turn on.

Pressure sensor materials: Velostat, conductive tape, cork, LEDs.

Code: https://github.com/annagarbier/annagarbier.github.io/blob/master/work/courses/2018/fall/computational_craft/resources/code/assignment_6.ino

Code snippet:

```
// This function determines the LED pins' output (HIGH or LOW)
// based on the sensor pin's input (held in the variable "average").
void displayLights() {
if (average > 200) {
digitalWrite(ledA, HIGH);
digitalWrite(ledB, HIGH);
digitalWrite(ledC, HIGH);
} else if (average > 150) {
digitalWrite(ledA, HIGH);
digitalWrite(ledB, HIGH);
digitalWrite(ledC, LOW);
} else if (average > 100) {
digitalWrite(ledA, HIGH);
digitalWrite(ledB, LOW);
digitalWrite(ledC, LOW);
} else {
digitalWrite(ledA, LOW);
digitalWrite(ledB, LOW);
digitalWrite(ledC, LOW);
}
}
```

Part 3: Document midterm ideas.

I’d like to create transparent modular blocks, each containing a piece of a circuit: e.g. one might contain a 3v battery, another a resistor, another an LED, and others just connecting components. A user would be able to play with the blocks by connecting them in 3d space; complete a circuit with the blocks, and the blocks with the LED shines.

The intention is to build something simple, playful, and educational.

 (early ideation on paper)

 (prototyping)

Week 6 – Erica

The first one is controlling the circuit with a button, I used the force sensor from the swatch exchange with the Calibration code, so the sensor can turn on/off the lights and control the brightness with the input force.

 

For the second circuit, I use the force sensor to control the 3 LEDs and they will light up one by one based on the input force value.

 

For the midterm project, I want to design an origami lamp with colorful organza fabric. The circuit will go inside and underneath the origami and the fabric will be the light defuser. I might incorporate the new Gemma M0 I just got into the lamp but it depends whether if I can figure out how to use it or not.

 

 

Week 6 – Carla

  1. Connect one of a soft switch to your Arduino. Use it to control an LED.

I decided to try out Lily tiny ( ATtiny-85). It quite tricky to set up and to control as desired. I got to control the LED with my soft switch.

2. Build a circuit with one constructed sensor (variable resistor), your Arduino, and 3 (or more) LEDs or an RGB LED. 

I tried with the Lily tiny but I didn’t manage to control the analog input properly. So I switched back to the Arduino UNO. I created a switch with copper fabric and Velastat that allows me to control the Leds easily.

I wanted to create a stretchy switch with a french knitter, but I could use conductive yarn, so I used regular yarn.

It looks nice I could use it in the future.

Midterm proposal

I’m planning on creating an interactive scarf. A very handy piece for those cold winters to measure the intensity of those persistent sneezes.

I have to figure out some details, such as how to control the signal with the lily tiny or how to power the system without wires.

 

Week6_Yixun

I used a knitting loom and the conductive yarn to make this soft sensor. The output of the sensor varies according to the shape of the knitting piece. If I fold the sensor, the output will decrease. So I wrote the code that if the output of the soft sensor reaches a certain number, the LED will be turned on.

 

This is a fabric flower made by felt and an RGB LED. I used a photoresistance as the variable to change the color of the LED. Here is the screenshot of the code:

Midterm:

I am going to combine the midterm assignments from New Arcade and Computational Craft. This project will be game design garments that two players can wear and fight each other. The inspiration comes from a traditional Chinese game — Judose. It is a game played by standing on one leg and grasping the other, it is a physically competitive game with one simple rule, to knock your opponent over. The original version of the game is quite violent. What I am going to do is adding conductive fabric and LED instructions to the kneecap. Attacking your competitor on the particular area will cause your competitor to lose his points. The player who loses all the points first is the loser, and the other one is the winner.

 

 

Week 6- Adam Moore

Here is the code for the two Arduino sketches I used to complete this homework. The first photo is the code for the button, the second is for the pressure sensor.

Here are screenshots of the pressure sensor in action!

Here are shots of the button working!

For the midterm I would like to build a modular lamp out of a cube of wood with holes drilled for LED’s. The base would be a the positive and negative terminals of the circuit. I’ll make a prototype and try to upload it before class on Thursday.

Week 6 – Neil V. Techapanichgul

LED CONTROL VIA BUTTON

Thanks to Dario for the soft switch. It works perfectly fine. I like how squishy of the switch. The circuit is pretty simple. I use “INPUT_PULLUP” for the switch. It’s a quick tip for all buttons 😀

LED CONTROL VIA BUTTON CODE


/*
Button

The circuit:
– LED attached from pin 13 to ground
– pushbutton attached to pin 2 from +5V
– 10K resistor attached to pin 2 from ground

– Note: on most Arduinos there is already an LED on the board
attached to pin 13.

created 2005
by DojoDave <http://www.0j0.org>
modified 30 Aug 2011
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/Button
*/

// constants won’t change. They’re used here to set pin numbers:
const int buttonPin = 8; // the number of the pushbutton pin
const int ledPin = 7; // 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_PULLUP);
}

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, LOW);
} else {
// turn LED off:
digitalWrite(ledPin, HIGH);
}
}


MARCH OF LEDs

It is tricky to make each of them light up when I press my switch. I have to make the specific states for them to light up in order. It’s pretty fun and cute with 3 LEDs with Red, Yellow and Green.

MARCH OF LEDs CODE


/*
Button

Turns on and off a light emitting diode(LED) connected to digital pin 13,
when pressing a pushbutton attached to pin 2.

The circuit:
– LED attached from pin 13 to ground
– pushbutton attached to pin 2 from +5V
– 10K resistor attached to pin 2 from ground

– Note: on most Arduinos there is already an LED on the board
attached to pin 13.

created 2005
by DojoDave <http://www.0j0.org>
modified 30 Aug 2011
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/Button
*/

// constants won’t change. They’re used here to set pin numbers:
const int buttonPin = 8; // the number of the pushbutton pin
const int ledPin = 7; // the number of the LED pin

bool startCapture;
float Timer = 0;
float Duration = 10000;
int State = 0;

bool Pressed;
bool Added;

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

void setup() {
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT_PULLUP);
}

void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

Serial.println(State);

if (!Pressed && buttonState == 0)
{
Pressed = true;
}

if (Pressed && buttonState == 1)
{
Pressed = false;
Added = false;
}

if (Pressed && !Added)
{
State++;
Added = true;
}

if (State == 1)
{
digitalWrite(7, HIGH);
digitalWrite(6, LOW);
digitalWrite(5, LOW);
}

if (State == 2)
{
digitalWrite(7, HIGH);
digitalWrite(6, HIGH);
}

if (State == 3)
{
digitalWrite(7, HIGH);
digitalWrite(6, HIGH);
digitalWrite(5, HIGH);
}

if (State > 3)
{
digitalWrite(7, LOW);
digitalWrite(6, LOW);
digitalWrite(5, LOW);
State = 0;
}

}


MIDTERM IDEA

I want to make one big squishy doll that can emit some lights through its eyes by dragging the tail. It could be really cute! The technique I use is going to be wool felting.Image result for Felt Doll animal

Image result for Felt Doll animal