8 - Untoolkit: Electronic Outputs

26 March - 01 April 2020

THIS WEEK'S ASSIGNMENTS

Assignment 0 - Zine with the entire group

Produce a class zine on the RISO printer together, 2 people will be editors this week. Individual contributions in the form of zine spreads.

Zine prompt:

"In a 'post-post-it' society, I wonder what the ultimate design toolkit to train the 21st century designer could be. Rather than the usual canvases or user journey maps, this toolkit would feature a set of basic design exercises that help everyone, not only design students, to make things that move, think, communicate, sense, see, compute or augment. These exercises would help students to control technology, to assertively own it as a material, a tool, and a key factor influencing society today." - Serena Cangiano

Reflect on your experience in the minor thus far. Can you link this to the readings of this week?

This week the zine will be an ultimate design toolkit. Think, create, design an exercise that would be part of this ultimate design toolkit, Cangiano mentions. Reflect on this exercise, why did you choose this, how is it linked to the minor and to this weeks reading.

Zine this week: http://summerdanoe.nl/zine/

Assignment 1 - individual/duo

  • Build an electronic circuit with at least one input (made by you!) and one actuator.

  • Program a microcontroller in the Arduino IDE to control your actuator with the input

  • Design an output swatch of 10x10cm that is archive worthy. How can you make hardware look interesting/appealing/evocative? Use all the techniques you learned in previous weeks.

  • Document the design, building, debugging and working results step by step

Testing and prepping

Testing the LED

The first thing I wanted to test with the NodeMCU and my LED is if my LED really worked. So I attached the LED to my NodeMCU and the breadboard and run an empty Arduino code:

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Now I'll make a code which will let the LED blink.

I conncect everything like this:

Then I ran this code:

/*
  ESP8266 Blink by Simon Peter
  Blink the blue LED on the ESP-01 module
  This example code is in the public domain

  The blue LED on the ESP-01 module is connected to GPIO1
  (which is also the TXD pin; so we cannot use Serial.print() at the same time)

  Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/
int werkend = D2;

void setup() {
  pinMode(werkend, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
 
}

// the loop function runs over and over again forever
void loop() {
 
  digitalWrite(werkend, LOW);   // Turn the LED on (Note that LOW is the voltage level
  // but actually the LED is on; this is because
  // it is active low on the ESP-01)
  delay(1000);  // Wait for a second
  digitalWrite(werkend, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)
}

And it worked!

Now I'll connect the button and LED to the NodeMCU board. I'll send some information to the Serial so I know that the button will respond.

I tried out his code and my LED went on when I pushed the button:

void setup() {
pinMode(D2, INPUT);    //set the button pin as an input 
Serial.begin(9600);  
}


void loop() {
digitalRead(D2);      //reading a digital sensor on pin D1
delay(50);              
Serial.println(digitalRead(D2));    // printing read of D1
delay(50);
}

Reading Resistive Sensors - Light sensor

You can find my new try out here:

pageLDR LED connection with Arduino

Connecting a RGB LED with a button

This worked perfectly after some help form Mickey. Make sure you attatch the button to the D6.

//       RGB LED Color Control
//      circuits4you.com
//========================================================================
//Changes made by Micky van Zeijl 
 
// constants won't change. They're used here to
// set pin numbers:
 
// Make sure to change the pinnumbers when you’re using the Arduino MKR.
// For the nodeMcu you can use all pins except 0. Don’t forget to add a D
// so it’s redPin = D3; for example

const int buttonPin = D6  ; // for Arduino MKR 1010 I used 6
const int redPin = D3; // for Arduino MKR 1010 - use pin 3
const int bluePin = D4; // for Arduino MKR 1010 - use pin 4
const int greenPin = D5; // for ARduino MKR 1010 - use pin 5

int counter = 0;
bool previousbuttonstateLow = false;

void setup() {
  pinMode(buttonPin, INPUT);
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
  Serial.begin(9600);
}

void loop() {

  int buttonState;
  buttonState = digitalRead(buttonPin);

  Serial.println(counter);

  if (buttonState == LOW && !previousbuttonstateLow) {
    counter++;

    if (counter > 3) counter = 0;
    previousbuttonstateLow = true;

  }

  if (buttonState == HIGH) {
    previousbuttonstateLow = false;
  }

  Serial.print("buttonstate is:" );
  Serial.println( buttonState);
  Serial.print("previous buttonstate is:");
  Serial.println(previousbuttonstateLow);

  if (counter == 0) {
    digitalWrite(redPin, LOW);
    digitalWrite(greenPin, LOW);
    digitalWrite(bluePin, LOW);
  }

  else if (counter == 1) {
    digitalWrite(redPin, HIGH);
    digitalWrite(greenPin, LOW);
    digitalWrite(bluePin, LOW);
  }

  else if (counter == 2) {
    digitalWrite(redPin, LOW);
    digitalWrite(greenPin, HIGH);
    digitalWrite(bluePin, LOW);
  }

  else if (counter == 3) {
    digitalWrite(redPin, LOW);
    digitalWrite(greenPin, LOW);
    digitalWrite(bluePin, HIGH);
  }


}

I got really inspired by this code and a YouTube video of Lisa Spark I saw earlier. I want to try if I can add a switch sensor to the RGB LED with this code.

I got an idea for my output swatch:

I want to have one layer on top with a soft fabric, which people want to touch. And if they touch it the switch goes on or light sensor gets more dark and the RGB LED will turn on.

Process to the final output swatch

Light sensor and RGB LED

I am trying to install a simple LED with the LDR sensor on this page:

pageLDR LED connection with Arduino

Now I'll try it again but not with a normal LED, but with a RGB LED.

I have used my own code, I had made a few years ago when I had to work with a LDR sensor and a RGB LED. I think the code is a little bit more simple and more easy in use for the simple swatch I want to make.

I used the values less or equal to 700 and less or equal to 960.


 void setup() {
   Serial.begin(115200);
  pinMode(D2, OUTPUT);
  pinMode(A0, OUTPUT);
  pinMode(D3, INPUT);
}

 
void loop() {
  int lichtSterkte = analogRead(A0);
  
  Serial.println(lichtSterkte);


  if (lichtSterkte >= 700) { 
    digitalWrite(D2, HIGH);
    
 Serial.println("Blauw licht");
 Serial.println("Mooi blauw in prachtig licht");
    delay(50);
    
  }
  
  if (lichtSterkte <= 690) { 
    digitalWrite(D3, LOW);
 
Serial.println("Groen licht");
 Serial.println("Het kan wat lichter");
    delay(50);
     
  }
  
  
}

PHOTO

The code works so I am very happy about that. But now I want to change the concept. So when it gets darker the LED will become blue and I want the normal state of the LED to be green.

Now I used this code:


 void setup() {
   Serial.begin(115200);
  pinMode(D2, OUTPUT);
  pinMode(A0, OUTPUT);
  pinMode(D3, INPUT);
}

 
void loop() {
  int lichtSterkte = analogRead(A0);
  
  Serial.println(lichtSterkte);


  if (lichtSterkte <= 300) { 
    digitalWrite(D2, HIGH);
    
 Serial.println("Blauw licht");
 Serial.println("Donkere tint");
    delay(50);
    
  }
  
  if (lichtSterkte >= 350) { 
    digitalWrite(D3, LOW);
 
Serial.println("Groen licht");
 Serial.println("Lichte tint");
    delay(50);
     
  }
  
  
}

Now I can start making an output swatch.

Output swatch

Go to this page to see the final output swatch I made:

pageOutput swatch

Last updated