Demos – 16-223 Work https://courses.ideate.cmu.edu/16-223/f2019/work Introduction to Physical Computing: Student Work Sun, 15 Sep 2019 20:42:57 +0000 en-US hourly 1 https://wordpress.org/?v=5.2.20 Demo 2: Tushhar Saha https://courses.ideate.cmu.edu/16-223/f2019/work/2019/09/15/demo-2-tushhar-saha/ https://courses.ideate.cmu.edu/16-223/f2019/work/2019/09/15/demo-2-tushhar-saha/#respond Sun, 15 Sep 2019 20:42:55 +0000 https://courses.ideate.cmu.edu/16-223/f2019/work/?p=3785 For the second demo, I decided to laser cut a new object to integrate a photointerruptor. The new object looks like a vertically flipped Omega symbol, which oscillates quite well.

For this demo, I attached the photointerruptor near the front of the base and the servo motor at the bottom of the base. The servo motor has been programmed in a way to give small jerks to the the object and thus, slowly make it move forward. The photointerruptor receives analog values through the pin A1, which is read and according to the a certain threshold value, it controls whether the servo motor stops or continues. Thus, if there is a wall or another object in front of the moving omega, it stops moving. Once there is no obstruction, the omega starts moving again. The following video demonstrates how this works.

If we look closely, the photointerruptor leads have been soldered to wires that go back to connect to a breadboard, which is then connected to the Arduino to receive inputs. The following picture shows the connections and how they look on the inside.

Here is the code I used to make this demo possible:

#include <Servo.h&gt; 

Servo hi;
int sensorValue=0;
int sensorPin=A1;
void setup() {
  // put your setup code here, to run once:
  hi.attach(9);
  Serial.begin(9600);
  pinMode(sensorPin,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  sensorValue = analogRead(sensorPin);
  Serial.println(sensorValue);
  while (1==1){
  if (sensorValue&gt;=800){
  hi.write(0);
  delay(1000);

  sensorValue = analogRead(sensorPin);
  Serial.println(sensorValue);
  
  hi.write(75);
  delay(500);
  }else{
  sensorValue = analogRead(sensorPin);
  Serial.println(sensorValue);
  hi.write(0);
  delay(500);  
  }
  }
}

]]>
https://courses.ideate.cmu.edu/16-223/f2019/work/2019/09/15/demo-2-tushhar-saha/feed/ 0
Demo 1 – Tushhar Saha https://courses.ideate.cmu.edu/16-223/f2019/work/2019/09/09/demo-1-tushhar-saha/ https://courses.ideate.cmu.edu/16-223/f2019/work/2019/09/09/demo-1-tushhar-saha/#respond Mon, 09 Sep 2019 05:06:30 +0000 https://courses.ideate.cmu.edu/16-223/f2019/work/?p=3682 With some previous experience in Solidworks, I decided to make a system which used the servo motor to rotate anything attached to it. I laser cut attachable wooden pieces. The following picture shows what it looks like:

I designed this so that it could attach to wooden face I laser cut. The servo would be stuck to a rectangular face which acts as base and the servo would be attached to a face above it which would rotate. The measurements were hard to be precise with so the fitting is a bit lose. The following video demonstrates it.

However, I decided to experiment with the mechanism by removing the top face and just letting one face stay. What I found was simple yet amusing, and the first thought that came into my mind was that any child seeing this would appreciate it. I present you the dancing face (switch on sound for a fun rhythm):

The code I was used were simple repititions where I tried to vary the time to create the rhythm in the video.

#include &lt;Servo.h&gt;
Servo hi;

void setup()
{
  hi.attach(9);
}

void loop()
{
  hi.write(0);
  delay(1000);

  hi.write(180);
  delay(1000);

  hi.write(0);
  delay(100);

  hi.write(180);
  delay(100);
  
  hi.write(0);
  delay(500);

  hi.write(180);
  delay(500);
  
  hi.write(0);
  delay(1000);

  hi.write(180);
  delay(1000);

  for (int i=1;i&lt;10;i++){
  hi.write(0);
  delay(100);
  hi.write(180);
  delay(100);
  }

  for (int i=1;i&lt;5;i++){
  hi.write(0);
  delay(500);
  hi.write(180);
  delay(500);
  }

   hi.write(0);
  delay(1000);

  hi.write(180);
  delay(1000);

  hi.write(0);
  delay(100);

  hi.write(180);
  delay(100);
  
  hi.write(0);
  delay(500);

  hi.write(180);
  delay(500);
  
  hi.write(0);
  delay(1000);

  hi.write(180);
  delay(1000);
}
]]>
https://courses.ideate.cmu.edu/16-223/f2019/work/2019/09/09/demo-1-tushhar-saha/feed/ 0