LogoLogo
  • Documentation Pages
  • About Minor Makers Lab
  • Documentation templates
    • Recipe template
    • Label templates
    • Ingredient template
  • Projects
    • Project overview
      • Gelance Cushion - Andrei Motian
      • Landscapes for Warhammer - Dusanka Prvulovic
      • Bioplastic Filters: An Analogue Photoshop - DaniĆ«l van Kesteren
      • Hyperdisposables - Anoush Mazloumian
      • Project Stop Touching - Summer Danoe
      • Foam For Material Activists - Laura Velgersdijk
      • DateKleed - Duncan van Norden
      • One Size Hurts All - Kaz Bison
      • Biodegradable Packaging Bags - Kim Sinke
      • DIY Faceguards - Thijs Uffen
      • Bioplastics on a Rainbow Spectrum - Desiree van Dam
      • Beyond Humanity - Britt de Heer
  • Coursework
    • Britt
      • research zine text
      • Week 11
      • Week 12 / 13
      • Week 14
      • 1 ) Kick-Off
        • Grafische Werkplaats Amsterdam
        • Safetyzine
      • 2 ) Electronics: Connecting Materials
      • 4 ) Cutting Supersurfaces
        • Zine: Art Approach
        • Furry Sample Book
      • 5 ) Additive Manufacturing
      • 6 ) Untoolkit: Electronic Inputs
      • 7 ) Transforming: Moulding and Casting with Bioplastics
      • 8 ) Untoolkit: Electronic Outputs
    • Andrei
      • Week 1
        • GWA
        • Textielmuseum
        • Safetyzine
      • Week 2
        • Ohm's Law & circuits
        • Speaker on denim
      • Week 4
        • Inflatables 2D to 3D
        • Smooth to sharp with polypropylene
      • Week 5
        • Making a switch for the laser cutter in Fusion360
        • Designing and 3D printing molds
      • Week 6
        • Wearable switch for sound
        • Analog Sensor
      • Week 7
        • Home materials
        • Making bioplastics
        • Material properties
      • Week 8
        • Virtual Swatch
        • Processing
        • RGB LED
      • Project weeks 11 - ?
        • Week 11: Kick-off
          • Brainstorm Session
          • 5 min pitch
          • Trail of Evidence
          • Proposal
        • Week 12: Experimenting
          • Research workout materials
          • First Experiment
          • Trail of Evidence
        • Week 13: Project Work
          • Insights
          • Reframing session with Laura
          • Trail of Evidence
        • Week 14: Reframing
          • Reflective design method
          • Going bigger
          • Trail of Evidence
        • Week 15
          • Highlights photo's
          • Reframing, research & insights
          • Trail of Evidence
        • Week 16
          • Going even bigger
          • Trail of Evidence
        • Week 17
          • Trail of Evidence
        • Project
    • Anoush
      • Week 11-19
        • Week 11 | project kick-off
        • Week 14 | First experiments
        • Week 15 | Progress presentation
        • Last reframing session
        • Trail of Evidence
      • Week 1-8
        • Overall Reflection
        • Week 8 | Untoolkit - Electronic Outputs
        • Week 7 | Transforming bioplastics
        • Week 6 | Untoolkit - Electronic inputs
        • Week 5 | Additive Manufacturing
        • Week 4 | Cutting Supersurfaces
        • Week 3 | Reading Week
        • Week 2 | Electronics: Connecting Materials
        • Week 1 | Kick-off
    • DaniĆ«l
      • Week 20: Expo Week
      • Week 19: Project Week 9
      • Week 18: Project Week 8
      • Week 17: Project Week 7
      • Week 1: Kick-Off
      • Week 2: Electronics and Connecting Materials
        • Part I: The Basics and Recreating Circuits
        • Part II: The Making of the Speaker
        • Part III: Testing the speaker
      • Week 3: Reading Week
      • Week 4: Processes & Collaboration
        • Part I: exploring the words
        • Part II: experimenting with the laser cutter
      • Week 5: Critical Making 3D
        • Part I: Creating the injection mold
        • Part II: Creating the two-part mold
        • Part III: Printing the designs
      • Week 6: Electronics & Open Design
      • Week 7: Bioplastics
        • Material Properties Sheet
        • The Ma2E4 Toolkit
        • The Ma2E4 Toolkit (second bioplastic)
        • An application for the bioplastic
      • Week 8: Interfaces & Algorithmic Bias
      • Week 9: Documentation Week
      • Week 10: Assessments
      • Week 11: Project Kick-Off
      • Week 12: Recess
      • Week 13: Project Week 2
      • Week 14: Project Week 3
      • Week 15: Project Week 4
      • Week 16: Project Week 5
        • Presentation Preparation
    • Desiree
      • Summaries
      • Kick-off
      • Week 1 - Safety Zine
      • Week 2-3 Electromagnets
      • Week 4 - Cutting Supersurfaces
      • Week 5 - Additive Manufacturing
      • Week 6 - Untoolkit: Electronic Inputs
      • Week 7 - Transforming: Molding and Casting with Bioplastics
      • Week 8 - Untoolkit: Electronic Outputs
      • Trail of Evidence
      • Website
      • Material Archive
      • Week 11 - Choose a project
      • Week 12 - 13
      • Week 14
      • Week 15
      • Week 16
      • Week 17
      • Week 18
      • Week 19
    • Duncan
      • Week 1: Kick-Off
        • Masterclass Studio Overvelde
        • Workshop letterpress
        • Textielmuseum Tilburg
        • Meet the Makers - introduce yourself
        • Safetyzine
        • extraĀ“s
      • Week 2: Electronics: Connecting Materials
        • Zine: Kits & Open sources
      • Week 3: Reading week
      • Week 4: Cutting Supersurfaces
        • Zine:
      • Week 5: Additive Manufacturing
        • Workshop Amstelstation
        • Zine: 3D-printers & Being editors
        • Overall conclusion
      • Week 6: Untoolkit (Inputs)
        • Together w/ Loes
        • Zine: week 6
        • ExtraĀ“s
      • Week 7: Transforming
        • Zine: Social issues
        • extra's
      • Week 8: Untoolkit (Outputs)
        • Zine: Does being a 'maker' makes you a better civilian?
        • extraĀ“s: week 8
      • Week 9: Reflection
        • Zine:
        • extra's (week 9)
      • Week 10: Assessments
        • Zine:
      • Week 11
        • Makers skills & attitude
        • Design research skills
        • Collaborative learning
      • Week 12
        • Maker skills & attitude
        • Design research skills
        • Collaborative learning
      • Week 13
        • Scenario
        • Maker skills & attitude
        • Design research skills
        • Collaborative learning
      • Week 14
      • Week 15
        • Materialen lijst
        • Lijst met verschillende manier van connecten
        • Scenarios
        • Inspiratie voor vormen
        • Concrete voorbeelden tekenen
        • Samples / plan schrijven om te MAKEN!!
        • Kleuren inspiratie
      • Week 16
      • Week 18
        • Samples
        • The making of Samples
        • Inspiratie
        • Benodigdheden Woensdag 03/06/20
        • Inspiratie foto serie
        • Digitale tekeningen
      • Week 19
      • Week 20
    • DuÅ”anka
      • Week 1 - 8
        • 1 | Kick-Off
          • 2 | Electronics: Connecting Materials
            • Assignment 0 - Zine
            • Assignment 1 - Paper circuit
            • Assignment 2 - Soft speaker
          • Assignment 1
          • Assignment 2
        • 4 | Cutting Supersurfaces
          • Assignment 0 - Zine
          • Assignment 1 - Sample Book
        • 5 | Additive Manufacturing
          • Assignment 0 - Zine
          • Assignment 1 - Mold documentation
          • Assignment 2 - Molds
        • 6 | Untoolkit: Electronic Inputs
          • Assignment 0 - Zine
          • Assignment 1 - Antiprimadonna's
          • Assignment 2 - Working circuit
        • 7 | Transforming: Molding and Casting with Bioplastics
          • Assignment 0 - Zine
          • Assignment 1 - Intro
            • Bioplastics
            • Experiential toolkit
            • Material properties sheet
            • Future applications
            • Reflection
        • 8 | Untoolkit: Eelectronic Outputs
          • Assignment 0 - Zine
          • Assignment 1 - Working circuit
      • 11 | Projects Kick-Off
        • Trail of Evidence
      • 12 | First experiments
        • Trail of Evidence
        • Building the board
      • 13 | Project Work
        • Trail of Evidence
        • Building scenery
      • 14 | Reframing
        • Trail of Evidence
        • Game ideation
      • 15 | Making fake water
        • Trail of Evidence
      • 16 | Making a cherry blossom tree
        • Trail of Evidence
      • 17 | Expo plan & Clouds
        • Trail of Evidence
      • 18 | Research zine & Coffee soil
        • Research zine
      • 19 | Research zine 2.0
    • Kaz
      • 1 | Kick-Off
      • 2 | Electronics: Connecting Materials
        • Assignment 0 - Zine
        • Assignment 1 - Paper circuits
        • Assignment 2 - Building a speaker
      • 4 | Cutting Supersurfaces
      • 5 | Additive Manufacturing
      • 6 | Untoolkit: Electronic Inputs
      • 7 | Transforming: Molding and Casting with Bioplastics
      • 8 | Untoolkit: Electronic Outputs
      • 11 - 20 | Project: Face Mask Strap
        • 11 | Kick-Off / Pitch
        • Trail of Evidence
        • 15 | Midterm presentation
    • Kim
      • 1 - Introweek
        • Discussion notes
        • Try out zine - Week 1
      • 2 - Electronics: Connecting Materials
        • Zine - Week 2
      • Zine - Week 3
      • 4 - Cutting Supersurfaces
        • The making of: The Sample Book
        • Dense - Clear final sample book
        • Zine - Week 4
      • 5 - Additive Manufacturing
        • Understanding Fusion 360
        • Understanding Cura
        • Understanding the 3D Printer
        • Zine - Week 5
      • 6 - Coronaweek Untoolkit: Electronic Inputs
        • LDR LED connection with Arduino
        • Zine - Week 6
      • 7 - Coronaweek Transforming: Molding and Casting with Bioplastics
        • Material properties sheet + Experiential toolkit
        • Future Bioplastic concept
        • Zine - Week 7
      • 8 - Untoolkit: Electronic Outputs
        • Output swatch
        • Zine - Week 8
      • Project Page Biodegradable Packaging Bags
      • 11 - Project proposal week
        • Trial of evidence week 11
      • 12&13 - Project Bioplastic Consumables
        • Trial of evidence week 12&13
      • 14 - Reframing week
        • Trial of evidence week 14
      • 15 - Project work
        • Trial of evidence week 15
      • 16 - Reframing and expo prep
        • Trial of evidence week 16
        • 16 - The first test
      • Material Sample 1
      • 17 - Project work
        • 17 - Ironing a bioplastic bag
        • 17 - New method for sticking a bioplastic bag together
        • 17 - How to compost?
        • Trial of evidence week 17
      • 18 - Trial of Evidence
      • 19 - Trial Of Evidence
      • 20 - Trial Of Evidence
      • 21 - Final Expostion
    • Laura
      • Week 1: Kick off
      • Week 2: Electronics: connecting materials
      • Week 4: Cutting Supersurfaces
      • Week 5: Additive Manufacturing
      • Week 6: Untoolkit: Electronic inputs
      • Week 7: Transforming Molding and Casting with Bioplastics
      • Foam For Material Activists
        • How to protect?
        • To find a material
        • Foam
        • Trail of Evidence
        • Midterm presentations
    • Summer
      • Foto's
      • Midterm presentation
      • Project: Stop touching
        • Project Proposal
        • Inspirational projects
      • Cutting Supersurfaces
      • Additive Manufacturing
      • Molding and Casting with Bioplastics
        • Creating natural dyes
        • Created bioplastics
      • Electronic input
      • Electronic output
    • Thijs
      • Week 1 - Kickoff
      • Week 2 - Electronics : connecting materials
      • Week 2 - Workshop : debugging circuits
      • Week 2 - Making a speaker
      • Week 3 - Processes & Collaboration
      • Week 4 - Cutting supersurfaces
      • Week 4 - Zine editor
      • Week 5 - Additive manufacturing
      • Week 6 - Untoolkit: Electronic Inputs
      • Week 7 - Transforming: Molding and Casting with Bioplastics
        • Ma2E4 Toolkit
        • Future applications & reflection
      • Week 8 - Untoolkit : electronic outputs
      • Week 11 - Project kickoff
      • Week 12 - First experiments
      • Week 13 - Project work
      • Week 14 - Reframing & trail of evidence
        • Reframing : additional research
        • Shopping list
        • Testing bioplastic material
      • Week 15
      • Weeks 15 - 20
      • Expo prep
  • CLASS NOTES
    • Zine documentation (collaborative doc)
    • Discussions week 2-8
      • Week 02 - Connecting Materials
      • Week 04 - Cutting Supersurfaces
      • Week 05 - Additive Manufacturing
      • Week 06 - Untoolkit Electronics Inputs
      • Week 07 - Transforming Bioplastics
Powered by GitBook
On this page
  • Zine design
  • My text
  • My visuals
  • My files
  • The end product
  • Assignment 0 - Zine with the entire group
  • Assignment 1 - individual
  • Connecting sensor with led
  • Connecting button with led
  • Connecting the motor
  • Connecting button with motor
  • Connecting sensor with motor
  • Mixing Led colors with sensor
  • Changing Led colors with button
  • Swatch
  • Show and tell
  • Reflection
Export as PDF
  1. Coursework
  2. Desiree

Week 8 - Untoolkit: Electronic Outputs

Untoolkit: Electronic Outputs

PreviousWeek 7 - Transforming: Molding and Casting with BioplasticsNextTrail of Evidence

Last updated 5 years ago

This week we are going to work with outputs. We have to write 150 words about our own toolkit that we may have used in the last couple of weeks. Next to that you have to make an original image that fits your text. This week the editors for the zine are Kim and Summer.

Zine design

My text

This week we talked about toolkits and how this was a part of the exercises the last couple of weeks. A lot of the things we did, I’ve never done before, so what I found really helpful is to start with an introduction. We had this in workshops, but you can also look online for videos. It’s always nice to know the basics and to know what’s possible. The next step is to lay out everything in a comprehensive and clear manner. This way you know which materials you have, and you can start experimenting. I always go in blindly and start doing stuff. Sometimes it works and sometimes you’re not getting anywhere. When things are not working out it’s nice to draw it out, to find instruction videos online or talk to other people about it. This always helps me. You’ll usually figure out really quickly what to do with this new inspiration and explanations.

Desiree van Dam

My visuals

My files

The end product

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.

Assignment 1 - individual

  • 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

Connecting sensor with led

First I tried to connect my sensor with the new led. This worked pretty quickly because I'd done this before two week ago. However, I accidentally caused a short circuit at one of the LED lights, now only the blue and the green still work. This is a bit stupid of me but sadly I can do nothing about it at this time.

Connecting button with led

Then I connected the button with the led. I used one from the kit because Anoush has our homemade switches at her home. Again this went very smoothly.

Connecting the motor

Later I tried to connect the motor. I asked Micky for some help because I didn't know where to start. Micky gave me then some links with explanations. I followed the instructions and it accually went very smoothly then. It worked and I was very happy. Then I looked into how to connect the sensor and button with the motor.

Connecting button with motor

First I tried to connect the motor with the button because I thought this would be easier (and I was right). This also was very easy and I was happy and confident to try it with the sensor.

Connecting sensor with motor

The sensor was a completely different story. I attached all the wires but the motor kept going at full speed. At first I thought that was because the motor is attached to it's own energy source, so I removed the vin. But that didn't work so I looked at the picture of the button and saw that I put the D1 in the circuit of the sensor. So I tried to do that aswel but it still didn't work. It was very frustrating and I tried a lot of different ways but I couldn't figure out how to get it to work. So then I asked Micky if she could help me.

I talked with Micky for about two hours, to debug the circuit. At first we looked at how everything was plugged in. We deattached the power and put the analog wire next to the wire of the sensor. This didn't work. So we went to check if the sensor worked. We deattached the motor and put in Loes her code. This worked so we attached the motor again, but this time a bit differently. Then the motor stared to make a weird noise. The noise would go louder the more I pressed the sensor. Later we found out that the motor works but doesn't spin, it's moves a bit to the side when I press my sensor and than goes back when I let go. Which meant it worked but the motor can't handle different variations in readings. So it works and Micky is going to look into getting the motor to work.

/*
   Loes Bogers - March 2019
   Liza Stark - May 2018
   This sketch reads an analog sensor. It incorporates smoothing
   and calibration examples by Mellis and Igoe.
   The sensor is attached to A0 through a 10k voltage divider.
*/

// Define the number of samples to keep track of.  The higher the number,
// the more the readings will be smoothed, but the slower the output will
// respond to the input.  Using a constant rather than a normal variable lets
// use this value to determine the size of the readings array.

const int numReadings = 10;     // average number of readings
int readings[numReadings];      // the readings from the sensor
int readIndex = 0;              // the index of the current reading on the sensor
int total = 0;                  // the running total for the sensor
int average = 0;                // the average for the sensor
int sensorPin = A1;                // sensor pin
int ledPin = 3;                // LED connected to digital pin 3 (PWM pin ~ )

// Calibration variables
int sensorValue = 0;
int sensorMin = 1023;           //this is supposed to be higher
int sensorMax = 0;              //this is supposed to be lower

void setup() {

  // initialize serial communication with computer:
  Serial.begin(115200);

  // turn on LED to signal the start of the calibration period:
  pinMode(ledPin, OUTPUT);
//  digitalWrite(ledPin, HIGH);

  pinMode(sensorPin, INPUT);   // sets the pin as output

  // initialize all the readings on the sensor to 0:
  for (int thisReading = 0; thisReading < numReadings; thisReading++) {
    readings[thisReading] = 0;
  }

  Serial.println("Calibration beginning");
  Serial.println("Find the extremes of your sensor for 5 secs");

  // calibrate during the first five seconds
  while (millis() < 5000) {        //make shorter if it crashes
    sensorValue = analogRead(sensorPin);

    // record the maximum sensor value
    if (sensorValue > sensorMax) {
      sensorMax = sensorValue;
    }

    // record the minimum sensor value
    if (sensorValue < sensorMin) {
      sensorMin = sensorValue;
    }

    // print values for debugging
    Serial.print("Max = ");
    Serial.print(sensorMax);
    Serial.print("\t");
    Serial.print("Min = ");
    Serial.println(sensorMin);

  }

  // signal the end of the calibration period
//  digitalWrite(ledPin, LOW);
  Serial.println("Calibration end");

}

void loop() {
  // READ VALUES COMING IN FROM THE SENSOR - Take average of 10 readings
  // subtract the last reading:
  total = total - readings[readIndex];

  // read from the sensor:
  readings[readIndex] = analogRead(sensorPin);

  // add the reading to the total:
  total = total + readings[readIndex];

  // advance to the next position in the array:
  readIndex = readIndex + 1;

  // if we're at the end of the array...
  if (readIndex >= numReadings) {
    // ...wrap around to the beginning:
    readIndex = 0;
  }

  // calculate the average:
  average = total / numReadings;

  // print the original average for debugging
  Serial.print("Average = ");
  Serial.print(average);
  Serial.print("\t");

  // map the average value to the min and max we recorded above
  average = map(average, sensorMin, sensorMax, 0, 255);

  // constrain the values within a certain range
  average = constrain(average, 0, 255);

  //set brightness of LED to average value (after mapping and constraining, so between 0-255)
  analogWrite(ledPin, average);  

  // print the new average for debugging
  Serial.print("New Average = ");
  Serial.println(average);

  delay(1);        // delay in between reads for stability

}

Later that evening Micky texted me with the solution. The motor has not enough power to start on its own. So you have to spin it a bit to give it a kick start and than it will spin on its own. I tried this the next morning and it worked. I adjusted the values a bit because when it's standing still, I have to kickstart it again. So I have set the values not to fall below 100, because below 100 the motor will stop. Doing this keeps the engine running all the time and I don't have to kickstart it again.

Values from 0 to 255 when the motor will stop and you have to kickstart it again:

// record the maximum sensor value
    if (sensorValue > sensorMax) {
      sensorMax = 550;
    }

    // record the minimum sensor value
    if (sensorValue < sensorMin) {
      sensorMin = 350;
    }

Values from 100 to 255 so the motor can continue spinning:

  // record the maximum sensor value
    if (sensorValue > sensorMax) {
      sensorMax = 550;
    }

    // record the minimum sensor value
    if (sensorValue < sensorMin) {
      sensorMin = 270;
    }

Mixing Led colors with sensor

Later I tried mixing the colors with code. Sadly my red is burned out so I did my best with the other two. I looked at DLO and made the circuit and copied the code from Micky from google drive. At first I thought it didn't work because I could only get one color. Later I figured that you had to put in some values in the code. I entered the values (highest = 1024, lowest = 370) and it worked. I then commented the code for red out and when the values are low you get blue, by middle you get green and really high you get aqua. It is a pity that I cannot make all colors.

/*
   Micky van Zeijl - March 2020
   Loes Bogers - March 2019
   Liza Stark - May 2018
  
   This sketch reads an analog sensor. It incorporates smoothing
   and calibration examples by Mellis and Igoe.
   The sensor is attached to A0 through a 10k voltage divider.

*/

// Define the number of samples to keep track of.  The higher the number,
// the more the readings will be smoothed, but the slower the output will
// respond to the input.  Using a constant rather than a normal variable lets
// use this value to determine the size of the readings array.

const int numReadings = 10;     // average number of readings
int readings[numReadings];      // the readings from the sensor
int readIndex = 0;              // the index of the current reading on the sensor
int total = 0;                  // the running total for the sensor
int average = 0;                // the average for the sensor
int sensorPin = A1;             // sensor pin I used A1 forArduino MKR
//int ledPin = 3;               // LED connected to digital pin 3 (PWM pin ~ )
//int redPin = 10; // for Arduino MKR 1010 use pin 3 (PWM pin ~ )
int bluePin = 4; // for Arduino MKR 1010 use pin 4(PWM pin ~ )
int greenPin = 5; // for ARduino MKR 1010 use pin 5 (PWM pin ~ )




// Calibration variables
int sensorValue = 0;
int sensorMin = 1023;           //this is supposed to be higher
int sensorMax = 0;              //this is supposed to be lower

void setup() {

 // pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
  // initialize serial communication with computer:
  Serial.begin(115200);

  // turn on LED to signal the start of the calibration period:
  // pinMode(ledPin, OUTPUT);
  //  digitalWrite(ledPin, HIGH);

  pinMode(sensorPin, INPUT);   // sets the pin as output

  // initialize all the readings on the sensor to 0:
  for (int thisReading = 0; thisReading < numReadings; thisReading++) {
    readings[thisReading] = 0;
  }

  Serial.println("Calibration beginning");
  Serial.println("Find the extremes of your sensor for 5 secs");

  // calibrate during the first five seconds
  while (millis() < 5000) {        //make shorter if it crashes
    sensorValue = analogRead(sensorPin);

    // record the maximum sensor value
    if (sensorValue > sensorMax) {
      sensorMax = 1025;
    }

    // record the minimum sensor value
    if (sensorValue < sensorMin) {
      sensorMin = 370;
    }

    // print values for debugging
    Serial.print("Max = ");
    Serial.print(sensorMax);
    Serial.print("\t");
    Serial.print("Min = ");
    Serial.println(sensorMin);

  }

  // signal the end of the calibration period
  //  digitalWrite(ledPin, LOW);
  Serial.println("Calibration end");

}

void loop() {
  // READ VALUES COMING IN FROM THE SENSOR - Take average of 10 readings
  // subtract the last reading:
  total = total - readings[readIndex];

  // read from the sensor:
  readings[readIndex] = analogRead(sensorPin);

  // add the reading to the total:
  total = total + readings[readIndex];

  // advance to the next position in the array:
  readIndex = readIndex + 1;

  // if we're at the end of the array...
  if (readIndex >= numReadings) {
    // ...wrap around to the beginning:
    readIndex = 0;
  }

  // calculate the average:
  average = total / numReadings;

  // print the original average for debugging
  Serial.print("Average = ");
  Serial.print(average);
  Serial.print("\t");

  // map the average value to the min and max we recorded above
  average = map(average, sensorMin, sensorMax, 0, 255);

  // constrain the values within a certain range
  average = constrain(average, 0, 255);

  //set brightness of LED to average value (after mapping and constraining, so between 0-255)

  /* Use the readings of the sensor to control the LED. Each RGB color pin is linked to the readings of average. You can play around with the color combination of each pin. At the moment it’s a bit random.  
*/

  if (average <= 85) {

 //   analogWrite(redPin, average*3);
    analogWrite(greenPin, 0);
    analogWrite(bluePin, (85-average)*3);
  }

  else if (average > 85 && average <= 240) {

  //  analogWrite(redPin, (170-average)*3);
    analogWrite(greenPin, (average-85)*3);
    analogWrite(bluePin, 0);

  }

  else {
 //   analogWrite(redPin,0);
    analogWrite(greenPin, (240-average)*3);
    analogWrite(bluePin, (average-240)*3);
    
  }



  // print the new average for debugging
  Serial.print("New Average = ");
  Serial.println(average);

  delay(1);        // delay in between reads for stability

}

Changing Led colors with button

Later I tried it with the button. I made the circuit that Micky posted on DLO and used her code. This was easier then with the sensor and I got it working pretty quickly. I commented the code for red out again and made the last one aqua (so blue and green on HIGH).

//       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 = 6; // for Arduino MKR 1010 I used 6
//const int redPin = 10; // for Arduino MKR 1010 - use pin 3
const int bluePin = 4; // for Arduino MKR 1010 - use pin 4
const int greenPin = 5; // 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, HIGH);
  }

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

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


}

Swatch

For the swatch I wanted to do something with the motor. What can I attach to the motor to make it interesting? I was thinking of our first lesson when we had to bring stuff that suited us. Sam then took a spiral thing and I tried to copy that. For this I cut a skewer and cut rounds of some gray cardboard. I also found some ribbons in the house and cut them into small pieces. I connected te pieces and attached it to the motor. Later I thought about the unity (black and copper), but I already made mine with colors. Later I will make a new one with only black and white.

I made an hole in the middle of the black cardbox where the tip of the motor could go through. On the side I put some coppertape. On the back I connected the motor to the coppertape with aluminium foil and some coppertape. The motor was not very tightly bound this time. That's why I put some black tape over it for support. At last I connected the spiral thing to the motor with tape.

Show and tell

Reflection

This week I learned how to attach an motor to the arduino and how to work with an RGB led. This was very interesting because I had never done this before and I really had to do it on my own with a bit of help from a website. After a while I figured out how it worked and I was really happy about it. I'm glad I already had an intro about this subject in week 6 so I knew the basics again. I also learned more about the code and how to make different colours with the LED. I liked to figure out how it works even tho it took me awile. Making the swatch was also a fun process even tho it's not working the way I inteded it to. But next time I have to think before I start making it because it has to be black instead of different colours.

This week I didn't had that much time to look at processing but maybe I can look at that later.

Build an electronic circuit with at least one input (made by you!) and one actuator. Bonus assignment connecting your input with .

Source: ,

http://summerdanoe.nl/zine/
Processing
https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/arduino-code
https://www.tutorialspoint.com/arduino/arduino_dc_motor.htm
https://www.notion.so/Week-8-Dezine-toolkit-56c8d7410b4b4cf295017ebebbdd5cb3
6MB
Desiree_Toolkit.zip
archive
My files
5MB
Desiree_Wk8_Motor7.mp4
Video how this is not working
10MB
whatsapp-video-2020-03-30-at-114853-1_FPIIWCNr.compressed.mp4
Video explanation to Micky
5MB
Video micky.mp4
Explanation from Micky
7MB
WhatsApp Video 2020-03-31 at 10.15.55.mp4
Video of motor
Spinners part 1 - Desiree
Spinners part 2 - Desiree
Background - Desiree
Spinner gif - Desiree
Criteria
Attaching the sensor to the new led - Desiree
Wires - Desiree
The led goes brighter the more I press - Desiree
Wires - Desiree
When I press the light goes on - Desiree
The code for the motor - https://www.tutorialspoint.com/arduino/arduino_dc_motor.htm
The wires - Desiree
It spins! - Desiree
Wires - Desiree
When I press the button, the motor spins - Desiree
This is the failed circuit - Desiree
Image Micky send me
The wires - Desiree
The motor is moving when I press the sensor - Desiree
With a lower value the motor keeps on spinning - Desiree
Circuit that I made - DLO
Wires - Desiree
Led changes color - Desiree
Circuit that I made - DLO
Wires - Desiree
When I push the button the light changes - Desiree
Spinner swatch - Desiree
Swatch test - Desiree
Swatch - Desiree
Final swatch - Desiree
Show and tell on Zoom - Desiree