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
  • On/off switch with LED light
  • First try analog Switch with LED light
  • Debugging
  • Second try analog switch
  • Reflection
Export as PDF
  1. Coursework
  2. DuŔanka
  3. Week 1 - 8
  4. 6 | Untoolkit: Electronic Inputs

Assignment 1 - Antiprimadonna's

on/off switch & analog sensor

PreviousAssignment 0 - ZineNextAssignment 2 - Working circuit

Last updated 5 years ago

On/off switch with LED light

For this antiprimadonna me and Loes made a circuit where the LED would go on when the button is pushed. The code was found, I just changed the pins for the button and LED.

int ledPin = D2; // choose the pin for the LED
int inPin = D3;   // choose the input pin (for a pushbutton)
int val = 0;     // variable for reading the pin status

void setup() {
  pinMode(ledPin, OUTPUT);  // declare LED as output
  pinMode(inPin, INPUT);    // declare pushbutton as input
}

void loop(){
  val = digitalRead(inPin);  // read input value
  if (val == HIGH) {         // check if the input is HIGH (button released)
    digitalWrite(ledPin, LOW);  // turn LED OFF
  } else {
    digitalWrite(ledPin, HIGH);  // turn LED ON
  }
}

I also drew a schematic of this circuit. But i'm doubting this is right:

I don't think this is right because I didn't know where to put all the pins from the arduino, I feel like there is more on the board than there is on my schematic.

Ultrasonic sensor

Ive tried working with the Ultrasonic sensor, so that I could ideally change the pushbutton to the ultrasonic as a start for my working circuit. First, I just wanted to see the output of the sensor in the serial monitor just to check if the sensor was working. I did this with the following code:

#include <NewPing.h>
// ( trigger, echo, max cm)
NewPing sonar(D5, D6, 20);

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

  Serial.begin(9600);
  delay(50);

}

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

  Serial.print("The distance is:");
  Serial.println(sonar.ping_cm());
  delay(1000);
}

in the parameters of NewPing sonar you can how I connected the Ultrasonic to my Arduino. I've connected them with wires from the Ultrasonic straight into the Arduino pins (without breadboard, just to check). But unfortunately the distance in my Serial monitor kept staying on 0cm. So I think I accidentely took a broken ultrasonic.

First try analog Switch with LED light

I basically started here, with the crystal, without doing the first steps that were posted on Youtube, because I'm stubborn I guess. I connected the resistor with the backside of the copper tape, which is not conductive, I found out later because of Loes' whatsapp video. For some reason I thought it was possible because I vaguely remember doing something like this in week 2 with the paper circuits.

This was my first try with connecting a LED light with copper tape and the breadboard. I am not sure what I did here, the confusion began.

I decided to start over with the button and LED I have made before but then on a paper circuit, hoping I would understand it better.

First I wanted to check if the button was working so I connected it to my breadboard and sent the state of the button to the serial monitor with this code:

int pushButton = D3;
// the setup routine runs once when you press reset:
void setup() {
  Serial.begin(9600);
  // make the pushbutton's pin an input:
  pinMode(pushButton, INPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input pin:
  int buttonState = digitalRead(pushButton);
  // print out the state of the button:
  Serial.println(buttonState);
  delay(1);        // delay in between reads for stability
}

And it worked:

Debugging

Then I connected the button on a paper, exactly how I connected it to a breadboard.

I checked it again with the same code, unfortunately the button didn't work anymore. This was because the pins of the button were sodered together on the copper tape. Because of this the currtent can not go around the circuit anymore. So I soldered the pins that weren't needed loose and tried it again. During the soldering I accidently broke a pin so I used another button but it worked! I could now see the right state of the button in the serial monitor. I soldered it like this:

The side that the paperclip is on togetheer with the resistor is connected GND(-), the other paperclip is connected to V3V(+).

Now I did the same thing but with the LED lights

The long side of the LED (upper one) is + and the one in the bottom right corner is GND(-). I connected the button and LED together on the breadboard and used the same code as before with the on/off switch to check if my first paper circuit was working. (And it worked, yay!)

Now that I understood the paper circuits better I wanted to take another try in a sensor paper circuit.

Second try analog switch

I used Loes' examples as a reference for the crystal sensor. I soldered everything together like she had done before with hers. I tried using the thick copper steel but unfortunately I had nothing to break and bend it with so I had to use the thin copper wire which was hard to solder on the copper tape.

I got really weird outputs in the beginning in the serial monitor, but this was because I didnt match the baud with the serial.begin and upload speed. After Loes told me this and I changed it the sensor was working!

Then I connected 2 LEDs with the sensor to make it a bit different than Loes' example and I changed the code a bit with an if/else statement.

/*
  created by David Cuartielles
  modified 30 Aug 2011
  By Tom Igoe
  modified 13 March 2020 
  By Loes Bogers
  This example code is in the public domain.
  http://www.arduino.cc/en/Tutorial/AnalogInput
*/

int sensorPin = A0;    // select the input pin for the potentiometer
int ledPinRood = D1;      // select the pin for the LED that has PWM (~) e.g pin D1 on Node MCU
int sensorValue = 0;  // variable to store the value coming from the sensor
int mappedValue = 0;  //store the mapped values
int ledPinGroen = D2;

void setup() {

  // initialize serial communication with computer:
  Serial.begin(115200);     //make sure it matches with the number in the serial port

  // declare the ledPin as an OUTPUT:
  pinMode(ledPinRood, OUTPUT);
  pinMode(sensorPin, INPUT);
  pinMode(ledPinGroen, OUTPUT);
}

void loop() {
  delay(1000);
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);

//// FIND MIN & MAX RANGE FIRST, THEN COMMENT OUT
  // print values to serial to find lowest and highest values (min and max) in serial monitor
  Serial.println(sensorValue);      // met 10K voltage divider: bijv. range 100-850 zonder een fietslampje erbij (beter voor de video)
   
//PUT THE VALUES YOU FOUND (YOUR_MIN, YOUR_MAX) INTO THE LINE BELOW (line 36)
//put your min value and max value (as seen in the monitor) and map to a range 0- 255 for output
  mappedValue = map(sensorValue, 242, 1024, 0, 255); 

    // print values for debugging
    Serial.print("Old Value (no mapping) = ");
    Serial.print(sensorValue);
    Serial.print("\t");   // add a tab between the numbers
    Serial.print("New value (mapped) = ");
    Serial.println(mappedValue);

    if (sensorValue > 300) {
      digitalWrite (ledPinRood, HIGH);
      digitalWrite (ledPinGroen, LOW);
    }
      else {
        digitalWrite (ledPinRood, LOW);
        digitalWrite (ledPinGroen, HIGH);
      }
    }

If the sensor will catch light, the red led will go on and the green led is off and vice versa.

Then I tried to make the sensor in another kind of shape. Unfortunately because I understood the assignment a bit wrong and went so many ways because I didnt understood the circuit at first, I didn't had much time left for the actual creative part so I made a simple box. I would've loved to put more effort and time in this.

Box open = Red ON, green OFF Box closed = Green ON, red OFF.

Reflection

To be honest I'm not too proud of what I've made. It all took so much time because I couldn't understand how the circuits were working. I discovered that I was having trouble with understanding the assignment first, and then begin at the very first step. Instead of diving into the crystal sensor and being in a cycle of not understanding it. If I had started from the beginning I would've had more time left to make something nice. But I am happy that it is working at the end, it took a lot of time and patience.

  • From the video class Ive just learned that the crystal is not a light sensor but a pressure sensor.. :')

Then I connected the crystal sensor like I did before with the paper LEDs and button to the breadboard to see the outputs of the sensor. I used .

here
Loes' code
Arduino, Led + pushbutton, Dusanka, Loes, 2020
Arduino, Led + pushbutton, Dusanka, Loes, 2020
Arduino, led + pushbutton schematic, Dusanka, 2020
Ultrasonic to Arduino (the Arduino was connected to my laptop when testing), Dusanka, 2020
Back of crystal paper non-conductive, Dusanka, 2020
Arduino confusion, Dusanka, 2020
Button check, Dusanka, 2020
Button on paper circuit, dusanka, 2020
Button on paper circuit, dusanka, 2020
LED on paper circuit, dusanka, 2020
on/off switch with LED light, dusanka, 2020
Back side crystal sensor, Dusanka, Loes, 2020
Front side crystal sensor, Dusanka, Loes, 2020
Crystal sensor with 2 leds, dusanka, 2020
End result Paper circuit with sensor & 2 leds, dusanka, 2020