Drawing Machines

Introduction

Part 1

The goal of the project was to get a stepper motor to turn using an Arduino Uno board to control its movement

Part 2

In this step, the goal was to build on the previous step and control the stepper motor direction with a potentiometer

Part 3

This step built on steps 1 and 2, to develop a drawing machine that was controlled by the combination of step 2 and someone else’s step 2.

Process

Part 1

H-bridge circuit diagram

Code:

#include <Stepper.h>

const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

void setup() {
  // set the speed at 60 rpm:
  myStepper.setSpeed(60);
  // initialize the serial port:
  Serial.begin(9600);
}

void loop() {
  // step one revolution  in one direction:
  Serial.println(“clockwise”);
  myStepper.step(stepsPerRevolution);
  delay(500);

  // step one revolution in the other direction:
  Serial.println(“counterclockwise”);
  myStepper.step(stepsPerRevolution);
  delay(500);
}

Part 2

Code:

#include <Stepper.h>

// change this to the number of steps on your motor
#define STEPS 100

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it’s
// attached to
Stepper stepper(STEPS, 8, 9, 10, 11);

// the previous reading from the analog input
int previous = 0;

void setup() {
  // set the speed of the motor to 30 RPMs
  stepper.setSpeed(30);
}

void loop() {
  // get the sensor value
  int val = analogRead(0);

  // move a number of steps equal to the change in the
  // sensor reading
  stepper.step(val  previous);

  // remember the previous value of the sensor
  previous = val;
}

Part 3

Reflection

The process went well up until the very last step. When putting the two machines together, the long arms were not lining up and the blue rings only fit on the motor if put on the correct way. Originally, I forced it on and I thought it was wrong because it took elbow grease to put it on and then take it off to try the other way. However, I couldn’t get the blue ring to fit on the motor after flipping it. 

Questions

  1. I would like to build some sort of walking robot with these motors because as I was looking at the drawing machine,  I could only think of legs instead of arms. The potentiometers can be used to control the movement of the legs. I haven’t really thought of a purpose for the robot besides walking.

2)  I think Shawn Deckers’s Scratch Series is very interesting. I don’t think I would be able to be in the room with that installation because I am uncomfortable with that kind of sound, and I know other people are. I think this installation is pretty similar to the project we made in the end because they both record movements. The difference between these two projects is that Deckers’s installation records natural movement, while the project I made was created through fixed movement controlled by two users. The actuators of Scratch Series are the controllers that bring the scratchers across the surfaces. I think Deckers chose to use these actuators because the focus should be on the surfaces, not the actuators themselves since it’s meant to be natural scratches, so the scratches should be similar.  The actuators adjust to each other, therefore creating complex, natural rhythms. 

Pianote – Sarah Armstrong – Marcela

Individual Reflection

     This project was not entirely inspired by the Group Project, but the original reason for both was the same. For the group project, the original reason for creating the Life Saver was solving a problem many people face, swimming. In the case of the Pianote, the problem being solved was that many people walk up to a piano and say, “I wish I could play piano”.  This project was similar to traditional player pianos but tried to get the user actually involved instead of just letting the piano play itself.  In the case of the player pianos, I do not think this was an example of interaction because they only reacted to the user turning them on.  In addition, a few weeks before the project began, I went to the World Music Expo and saw them attaching screens to pianos to teach children how to play the piano without having a teacher. The problem I saw with the set up of the piano I saw was that the screen assumed you already knew how to read music, and not many people can.  In our take of this kind of situation, we wanted the piano to be more like a teacher and not like a screen that you looked at. 

     I wanted users to feel like they were playing a real piano, so I wanted to make sure that the keys stood out on the box. In addition, after the User Testing session, we switched our box to be more focused on the piano keys themselves because many thought the brown was an out of place color for a piano. We used the element of color to emphasize these keys and show the contrast as the keys were white and the box was white.  We originally were using a normal cardboard box but changed it to a laser-cut box instead because it had cleaner lines compared to the flimsy cardboard box.  In addition, we decided to add 2 modes to the piano because we knew some people already knew how to play the piano (found in the User Test), so we made a free play mode that allowed those with previous experience the ability to play.

For the keys, we used 3D designing to make them and print them. The first time when we printed it, the keys would not split apart, so we had to re-edit it so they would come apart as separate keys. In addition, the 3D printers only have one filament, so we had to print 2 copies of the piano file. The first set, the all-black keys went off without a hitch. The white keys were a very different story. We had a very hard time working with first the white filament, so we changed it to white PLA and then the printer kept having trouble heating the plate to keep the keys attached to the platform. To solve this problem, we switched to the printers in the fabrication lab to print the keys. On the day of the User Testing Session, we got many comments about the aesthetic of our box, so we laser-cut a new one and spray-painted it black.  

User Test notes

new filament

   printer issue

  plate heating issue

plate heating issue

  new box

Top of final project Inside of final project

CONCLUSIONS:

The original goal of the project was to teach someone how to play Twinkle Twinkle on the piano.  I think my project aligns with my definition of interaction because it was able to get the user to give input and have the project take that input return output and also give an input for the user. I think the free play mode does not align with my definition of interaction because the project is only reacting to the pressing of the buttons. With more time, I would have made the switch between modes universal, as you could only switch from free play to learning mode and not the other way around. I think making sure you have enough time for the preparation of final prototyping is needed for next time.  I think this project was important because many times no one has the time to pick up a new skill and this project eliminated this issue by teaching Twinkle Twinkle without even needing to read sheet music, nevermind hours of practice. 

CODE:

int speakerPin = 10;
int C = 3;
int D = 4;
int E = 5;
int F = 6;
int G = 7;
int A = 8;
int B = 9;
#define white 11
#define black 12
bool menu = true;
bool freePlay = false;
bool twinkle = false;
#include "pitches.h"

// notes in the melody:
int melody[] = {
  NOTE_C4, NOTE_C4, NOTE_G4, NOTE_G4, NOTE_A4, NOTE_A4, NOTE_G4, NOTE_F4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4, NOTE_D4, NOTE_C4, NOTE_G4, NOTE_G4, NOTE_F4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4, NOTE_G4, NOTE_G4, NOTE_F4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4, NOTE_C4, NOTE_C4, NOTE_G4, NOTE_G4, NOTE_A4, NOTE_A4, NOTE_G4, NOTE_F4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4, NOTE_D4, NOTE_C4
};

// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
  4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 2
};

void setup() {
  Serial.begin(9600);
 
  // iterate over the notes of the melody:
  for (int thisNote = 0; thisNote < 42; thisNote++) {

    // to calculate the note duration, take one second divided by the note type.
    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
    int noteDuration = 1000 / noteDurations[thisNote];
    tone(10, melody[thisNote], noteDuration);

    // to distinguish the notes, set a minimum time between them.
    // the note's duration + 30% seems to work well:
    int pauseBetweenNotes = noteDuration * 1.30;
    delay(pauseBetweenNotes);
    // stop the tone playing:
    noTone(10);
  }
  pinMode(speakerPin, OUTPUT);
  pinMode(C, INPUT);
  pinMode(D, INPUT);
  pinMode(E, INPUT);
  pinMode(F, INPUT);
  pinMode(G, INPUT);
  pinMode(A, INPUT);
  pinMode(B, INPUT);
  pinMode(white, INPUT);
  pinMode(black, INPUT);
  Serial.println("Welcome to Pianote, where you learn to become Beethoven!");
  delay(1000);
  Serial.println("Which mode would you like to play in?");
    delay(1000);
    Serial.println("If you would like to free play, press the white button");
    Serial.println("If you would like to learn how to play a song, press the black button");
}

void loop() {
  // no need to repeat the melody.
  if (menu == true) {
    //Serial.println("If you would like to free play, press the white button");
    //Serial.println("If you would like to learn how to play a song, press the black button");
    
    
    if (buttonPressed(white) != false)
    {
      Serial.println("Alright, let's head to free play!");
      menu = false;
      freePlay = true;
      Serial.println("Welcome to free play");
      Serial.println("This is a C major keyboard, so we will only use the white keys");
    } 
    
                                                                               
    if (buttonPressed(black) != false)
    {
      Serial.println("Alright, let's learn a song!");
      menu = false;
      twinkle = true;
      Serial.println("Today, we're going to learn how to play Twinkle Twinkle");
    }
    //delay(10000);
  }
  if (freePlay == true)
  {
    
    if (buttonPressed(C))
    {
       tone(speakerPin, NOTE_C4, 1000);
       delay(1000);
    }
    if (buttonPressed(D))
    {
       tone(speakerPin, NOTE_D4, 1000);
       delay(1000);
    }
    if (buttonPressed(E))
    {
       tone(speakerPin, NOTE_E4, 1000);
       delay(1000);
    }
    if (buttonPressed(F))
    {
       tone(speakerPin, NOTE_F4, 1000);
       delay(1000);
    }
    if (buttonPressed(G))
    {
       tone(speakerPin, NOTE_G4, 1000);
       delay(1000);
    }
    if (buttonPressed(A))
    {
       tone(speakerPin, NOTE_A4, 1000);
       delay(1000);
    }
    if (buttonPressed(B))
    {
       tone(speakerPin, NOTE_B4, 1000);
       delay(1000);
    }
  }
  if (twinkle == true)
  {
    Serial.println("We're going to learn how to use Twinkle Twinkle in C major, so we will only need the white keys");
    Serial.println("The first note of Twinkle Twinkle is C");
    tone(speakerPin, NOTE_C4, 1000);
    Serial.println("C is the first key on the left. Press it.");
    if (buttonPressed(C))
    {
      tone(speakerPin, NOTE_C4, 1000);
      Serial.println("Good job!");
    }
    else
    {
      if (buttonPressed(C) == false)
      {
        Serial.println("Sorry, not that one, the white key all the way to the left!");
      }
    }
  }
}

//Checking if button is pressed
int buttonPressed(uint8_t button)
{
  static uint16_t lastStates = 0;
  uint8_t state = digitalRead(button);
  if (state != ((lastStates >> button) & 1)) 
  {
    lastStates ^= 1 << button;
    return state == HIGH;
  }
  return false;
}

Life Saver – Sarah Armstrong – Marcela

Part 1: Briefly define “interaction” as you now understand it and post your definition to the blog. Next, return to the two projects that you researched when shaping your definition. Point to what specifically in those projects triggered your understanding of interaction, and then your definition of it. Address why one project’s approach aligns better and the other less well to that definition.

Part 2: Make sure in your discussion of how you shaped your definition that you reference relevant ideas and specific information from the readings. Cite them appropriately! (Embed any media you consider helpful)

Part 3: Finally, describe the idea your group focused on in its design of an interactive device that fulfills the assigned criteria. Explain precisely how what you proposed to do derives from, responds to, or relates in some significant manner to your definition of the established form of interaction you identified in your research of the two projects above.

Part 1 & Part 2: I originally defined interaction as just reaction. However, after this project and examining the two projects, I define interaction as the reaction between at least two users. Originally, I had worked with projects like a Rube Goldberg machine, which I thought were interactive, but I think this one is only reactive and not interactive as the only actions are only between the user initially starting the machine. However, I think it’s interactive because the end result is eventually reacting with the original user, becoming a full circle. In the second project, I looked at, I think the Arduino-based light-up wear is instead only reactive because it reacts to the wearer’s movements but does not provide any input for the other user besides the colorful light. 

Part 3: When our group was coming up with the design,  we tried to come up with ideas of problems in the future. We thought natural disasters were going to be at the forefront of the problems in the future because of climate change. Originally, we only thought of the ice caps melting, but further developed the project to handle other disasters. The Life Saver is interactive because given by the input of what kind of natural disaster the user faces, the Life Saver will respond accordingly.

  

Recitation 3: Sensors

Introduction

A joystick module and light up correspondence was the original idea. We hoped to create a light that would like up according to the direction, but we ended up switching to using an RGB LED at the advice of LA Eszter. 

Process

We originally tried to get directions attached to the direction of the joystick module, however, it was not working correctly, most likely due to an error in the wiring. LA Eszter suggested we use an RGB LED in order to have an easier time wiring.  However, when we switched to the RGB LED, we still had trouble with the color-changing, most like caused by a coding error. Our table of values for the X and Y:

Direction X Y
Left 0-200 490-540
Right 900-1023 490-540
Up 490-540 900-1023
Down 490-540 0-200

Each direction corresponded to a different color, but,  we were only able to get red to blink, and once green to blink. 

Reflection 

The process did not go as planned. We were hoping that using simple wiring would create an easier way to solve the issue, but we did not have enough experience with the RGB LED to know how it worked and how to control it through the code.  I think in the future, I would just use the simple LEDs to start before moving on to the RGB LED. 

Questions

  1. We intended to create a light reactive joystick module. I think this is very similar to a gaming input and output because when the joystick moves, the screen moves with it, however, this was a simpler case in which lights interacted with the joystick in order to see the joystick’s movements. 
  2. I think code is often compared to a recipe or a tutorial because that is what it is. It is a recipe that the computer is reading in order to create a delicious program. 
  3. I think more and more rapidly human behaviors are being influenced by computers as new technology develops; humans become more dependent on this smarter and smarter technology without having to think about it because the computer is already knowing what is needed or what is going to happen. 

Recitation 2: Arduino Basics

Introduction

This project was done to learn basic Arduino principles. Through this project, Arduino coding and schematic basics were learned.

Process

Circuit 1: Fade

Circuit 2: toneMelody

Circuit 3: Speed Game

Reflection

The project went as planned. The only issue that occurred was the orientation of the LEDs. The proper orientation of the LEDs caused the LED to not turn on when it was supposed to.  The orientation of the LED needs to be taken better care of.

Questions

  1. I typically use my computer and cell phone
  2. The 10k resistor was used with the push button in order to make sure that the
  3. If I had 100, 000 LEDs at my disposal, I would probably make some form of wearable technology that would react to the music playing near me.