Physical Computing




Week 13 - Usertesting

Even though I didn’t have a fully physical product to show during the playtesting, It was fun to pitch my idea and demostrate it by using a regular carton cup and the illustration I made. I got nice reactions and good feedback from people! It was nice to hear people say that this product is “usefull” and “easy to carry”. 

I went back to the discussion of “pressure sensor”. I decided that for the coaster to work well, it should sense pressure and using a light sensor would be efficient. Using just one of those wouldn’t be enough. So now, the temp sensor starts reading data if both pressure and the light sensor is activated! Then, it reads the data and uses that data to change the colors of the LED’s. If there was only a light sensor, than, whenever you cover up the sensor orput your coaster inside a cabinet or maybe even at night, It would turn on. Or if we only had the pressure sensor, when you stack things together, it might create the necessarry pressure level to turn of the coaster aswell. So, it made much sense to have them both. 
Below, is a screen shot from the serial monitor. The temperature level is pretty stable and it was the ambient temperature. The third data is coming from the FSR, there were no pressure on it, so it’s 0.  The first line reads the light level. I used a phone flash on it and it jumped immediately. 




The image at the middle shows what was happening in the physical world. I didn’t have enough hands, so my friend cover the light sensor and put pressure on FSR while I hold a hot water cup on the temp sensor. The temp level was optimal so the LED’s turned green!!!!!!! YEY. 

Here is a link to the demo video, click here!  In the video, I cover up the FSR and the light sensor, since it was cold even inside the house, the LED’s turn blue -which symbolizes cold/cool temperature-.


By using the sin() function I create a motion within the light. The curve of the sin function was reflected on the brightness of the LED’s.

int sinToDigital(float s) {                  //the sin curve for motion of light
return int(abs(s) * 30) + 20;               //maks brightness level becomes 50
}


IT’S FABRICATION TIME
I bought this plastic cup from Target (image on the left), which was perfect for what I had in mind! To create the sleeve part, first 3D modeled this cup in Blender. I realized that the cork would not transmit heat and the temp sensor needs that, so I found this perfect metal plate and I’ll put it right under the cup. (image at the middle)



The right image shows the section of the coaster. The top part will have the led strip
. The bottom part will hide all the wires and the arduino. I won’t use a breadboard but a smaller prototyping board to fit all the sensort etc. within that area. For this product, I decided to use the 4-axis CNC to cut the cork. I had to make a lot of calculations to blend the metal plate and the cup with the sleeve/coaster.



Unfortunately, the machine had an issue in the middle of the cutting process for the second and third section. This being said, the cork that I had became useless because it got half cut and it was not possible to do the rest by hand. So, after fixing the problem I had to continue with foam.The bottom part will have the wires etc. and the metal plates had the holes to hit the light and temperature sensor.   



The circuit was working well and as you can see I could get the colors out of the LED’s by creating contact with different temperatures of water etc. Unfortunately, after I tried to solder those into a smaller prototyping board, I realized how bad I was and I didn’t wanted to risk what I had. I only had 1 arduino and 1 temp sensor so I just fixated the sensor into the metal plate. 





The FSR has this pressure point and it was hard to find the exact spot. So I had to place the FSR close to the corner so that the cup would put more pressure on there. The image on the left shows me that there were no pressure. Click here to watch LED’s light up when the cup is on the metal plate. IT WORKS!

To see the full code, click here!


Overall, I’m happy with the project. I learned how to use different librariries and alter the code accordingly. I’m not good at the fabrication or the soldering/wiring part and it took me more time to built the thing up compared to writing and testing the code. The initial idea took a long journey and changes everytime a feedback come up. I learned how to work with different sensors aswell. I’m upset that I had this problem with the machine and couldn’t wire up the LED’s into it’s designated place. I feel like there would be a solution and only print out 2 sections but I didn’t know how to do that. :(




Week 12 - Playtesting

I gave a lot of thought into the questions that people raised during class time. What took a lot of time was definitely the design and overall interaction. This is my final illustration for the product! It will serve as both a coaster and a sleeve for your hot beverage! It will be made with cork and the middle part will have an LED strip that changes color accordingly to temperature levels. The light will be subtle, not to bright. By making this product like this, I feel like it kinda solves the problem of how left and right handed people will drink this and the question of what would happen while the drinking time. If you don’t want to turn it on, you can easily use it as it is and hold from the sides of the sleeve. 






TMP36 sensor gave me a hard time. All the readings were super volatile. Even though I used
smoothing and took the average of the readings by putting more weight on the last readings, it still didn’t make any sense. Me putting my hand on top of the sensor, or creating contact with a hot boiled water even didn’t change anything.

  


I bought MCP9808 High Accuracy I2C Temperature Sensor because it has an accuracy of ±0.25°C over the sensor's -40°C to +125°C range and precision of +0.0625°CH. Hopefully, this will work better than the other sensor. Finally, I got to solder something! But, overall,even with the TMP36, I made the LED’s to change color. Below, I had this jar of boiled water (probably around 100C, but the temperature of the jar was lower.), the LED’s were red, since it was so hot to drink!



float temperatureC = calculateTemperatureFromVoltage(voltage);
// Fill along the length of the strip in various colors...
averageTemp = calculateWeightedAverage(averageTemp, temperatureC); Serial.print("Average: "); Serial.print(averageTemp); Serial.println(" degrees C");

if (averageTemp > 40) {
colorWipe(strip.Color(255, 0, 0), 50); // Red

} else if (averageTemp > 30) {
colorWipe(strip.Color( 0, 255, 0), 50); // Green

} else { colorWipe(strip.Color( 0, 0, 255), 50); // Blue
} delay(50);}


This was the code I used to make the LED’s to change color whenever the temperature level is in between those levels. 






Week 11 - 12C and SPI
During class time, I talked about the questions I had in mind. Basically, hot beverages have different optimum temperatures. Tea is frequently served below 65C and at 57C ideally. On the other hand, coffee’s notes shine between 50C-60C. Below 50C is what we call “cool-cold coffee”. 


  • So maybe, the coaster can have different modes for different hot beverages? (since the optimum temperatures differ)(but also, they are pretty close)
  • What about LED’s? They can signal the temperatures in different modes? (LED Strip might help)

Then, I did a little research on other “smart” coaster ideas. Here are some examples from my competitive analysis:

  

 

I like the cork structure and look of the first one. It’s just a regular coaster but it was good to see options.The second one on the top-right had different color settings for different coctails. The overall design and look is pretty chic, eventhough the wire is waterproof, it kills the vibe. The third one at the bottom has a power button. It has both a pressure and a temperature sensor on the circular area. It measures the temperature when there’s something on top of it. So, both of the examples read the temperature from the bottom of the cups/glasses.

After discussing these at class, these are the questions that was raised:

  • What happens during the drinking time? When the cup is lifted up and there’s nothing on the temp sensor, then what happens?
  • For tea, you mostly wait for the tea to brew. But, after pouring down into a cup, you drink the coffee immediately. How can you differ this situation?
  • What is the best location to put the temp sensor? Is there gonna be a handle on the cup? How will if work with left vs right handed people?
  • Can there be sound notifications? Is it going to remind me casually or is it a once time thing? If I get annoyed can I snooze this notification?
  • To keep the hot beverage hot can there be a motor that puts a lid?





Week 10 - Final Project Planning


I’ve been sick this weekend and had to drink a lot of hot tea. Unfortunately,I usually forgot that I’ve made myself tea. So, I decided to go forward with my coaster idea. I believe that there are people like me! 

As we discussed during the class, I thought about the 3 steps: verbal description, system diagram and the inventory. 










Week 9 - Asynchronous Serial 2



TIME FOR SERIAL OUTPUT

It was quite fun to change the brightness of an LED by using my mouse, numbers and some letters.  Initially, the serial value was undefined, but once I dragged my mouse up and down, it updated when Arduino received and returned the actions. 

    

When my mouse was at the top, the incoming value was 13 and the LED was dim. Once my mouse was at the bottom (the level was 221) the LED brightened up. You can see how it changed by clicking here!
Then, I did the same with keyPressed() functions. For the first one, I used the numbers 0-9 (9 being the highest brightness level)(click here to watch it!) and for the second one, I turned the LED on and off by pressing H (H being high) and L (L being low). This would’t work when I tried with low-case h and l because ASCII value of H/L and h/l are different. (click here to watch it!)


  

LET’S MOVE ON TO DUPLEX COMMUNICATION

Okay, my breadbord is ready to gooooo!!

  

Once I run the program, the info I got from two analog sensors and the pushbotton were ASCII-encoded numeric strings, separated by commas.

To watch me move the circle by changing the sensors, click here!

I also tried handshaking. I got “hello”s when I opened the monitor. But once I typed a character and clicked send, I got 3 ASCII numbers separated by commas. (image on the right)

FINAL PROJECT IDEATION

I focused on some of the daily problems that I have. 


1- Personally, I’m not a fan of hot beverages. Whenever I drink something, I usually forgot that they existed. Wouldn’t it be nice that the coaster can feel the temperature and send me notifs (not sure with which form) to tell me that my drink is getting cold?

2- Fun fact about me: It takes me more time to understand the time by looking at the clock. Sometimes the clocks without the actual numbers looks like a decor to me. I just want to mock with the clock. Maybe my clock can capture the motion of a person infront and adjust accordingly. When one raises their arms, the clock will change too. (This can be done with motors that turns the clock or the info that the microcontroller gets can be send to p5 and it can light up an area on a screen) 
 






Week 8 - Asynchronous Serial 1

THINGS ARE ABOUT TO GET REAL.

Things to remember:

  • You can’t open two serial monitors at the same time! Be sure that you close one!!! Otherwise, it doesn’t work. Only one port at a time can access a serial port. 




  • Punctuation matters! You can’t tell which value corresponds to which sensor by reading an endless string.



See how easy to read these:

  

  • Choose the correct port!
After choosing it, you can get data. 



Q1: Once I turn my potentiometer, the numbers highlighed in blue would change. What do they represent? 
-That means that I got the same message in a row for x times. 
  


Q2: Once I turn my potentiometer, the graph changes. But, it’s too slow. What is the graph responding to? 

 






Week 6 - Controlling High-current loads; motors & lights

THIS GAME IS ABOUT MEMORY!

In the end, we combined our initial memory game idea with the Simon Game structure for our midterm project. Rather than having increasing sequences, we fixed the number to 5. Therefore, “Simon” would show a 5-note sequence, and the player has to press those 5 notes in the same order. After 5 rounds, player either wins or loses. We had a lot of problems along the way, but I’m glad we solved them! This has been an insightful experience. Let’s go step by step!

Obstacle 1:  LED kept being light up.
 
  

     
We controlled LED’s by pressing the buttons. Each time we pressed a new button, the LED of that color would light up.  But once we stopped, that LED would stay like on the image on the left. Since, the others would turn off, the issue must have been about the last button states and our digital read’s. Eventually, we solved this issue by controlling our digitalRead’s and Write’s. The image on the right shows how the LED is turned on upon pressing the button. 

To watch, click here! 

Obstacle 2: The buttons and speaker are not working properly.

After trying every possible Serial.println() solutions to find the problem, we saw that the pin number of the speaker was 10. For all this time, it must have been 11. We even wrote down simple code to test just the buttons and the speaker as we did in the labs in Week3. It worked just fine. 

We incorported that code into our code and connected with the LED’s. To see the result, click here!  

Obstacle 3: Sounds are generated before the LED lights. 

When “Simon” plays we want to see and hear the light and the notes at the same time. Unfortunately, we first hear the notes and then LED light up. Apparently, there was a problem with out delay()’s. To hard-coded each step to make them simultaneous. Too much delay messes up with concentration too. It was harder to keep track our Simon’s moves. 
 
void simonTone() {
for (int i = 0; i < 5; i++) {
int x = random(0, 4);
note = notes[x];
tone(speaker, note, 1000); //make speaker play
delay(80);
digitalWrite(x + 2, HIGH); //make LED work
delay(500);
digitalWrite(x + 2, LOW);
simonOutput[i] = note;}
noTone(speaker);
}


Obstacle 4: Only pressing the Start Button generates a new sequence, game does not continue without interference. 

Image on the left demonstrates how I move on to a different step by clicking the start button. The image on the right shows a different sequence. 

  

Each time player plays, they have to press the start button to move on with the next step. The problem here was that, our check() code for checking whether Simon == Player was not working. Therefore, our code was not storing the results of each game. (Before that, players actions were not recorded at all, but we figured that one out). We also had some issues how to compare two arrays. Not knowing how to properly code is a huge step back (sometimes).

To see what happens when you press Start Button, click here!

bool check() {
bool playerDo = true;
for (int i = 0; i < 5; i ++) {
if (simonOutput[i] != playerInput[i]) {
playerDo = false;
break; } }
if (playerDo == true) {
answerTrue();
currentMode == speakerMode;
Serial.println("true");
} else if (playerDo == false) {
answerFalse();
Serial.println("false"); }
return playerDo;}

Our main problem here was we used int instead of bool. Thanks to Mary, we changed it into bool and it worked! Also, the game was ending because we forgot to add the return playerDo() part!

After that, we were able to track whether the player was true or false. As shown below, players actions are printed out as true and false. Each game had 5 rounds. Once you press a wrong button, yoı lose. That’s why our second game has only 1 round. 



THE GAME WORKED!! 

We managed to solve a big part of the game. All we had to do was figure the Quit/End button and add something to differentiate between winning and losing. 

To watch us play, click here!


Obstable 4: End button doesn’t work.

Our initial code had:(Also, we used currentMode = checkMode, which was incorrect. Then we corrected it with == and now it works!)

currentMode == checkMode
check();
currentMode == endMode

This was wrong because “end” means you had pressed something wrong or you have pressed the End Button. Even if the player == true, this took as to the endMode aswell (It should have took us to the simonPlayMode instead). Therefore, we added int = winMode; to separate between states. 

if (currentMode == speakerMode) {
Serial.println("IAMSPEAKER");
delay(500);
simonTone();
delay(500); // give player some time to react, you can change the delay time
currentMode = playerMode;
} else if (currentMode == playerMode) {
playerTone();
} else if (currentMode == checkMode) {
int playerDo = check();
if (playerDo == true){
if (gameCounter < 4) {
currentMode = speakerMode;
gameCounter ++;
} else if (gameCounter == 4) {
currentMode = winMode;
gameCounter = 0; }
} else {currentMode = endMode;}
} else if (currentMode == endMode) {
end();
} else if (currentMode == winMode) {
win();
}

To turn it back to speakerMode, with the help of Yonatan, we added a while loop inside the winMode function.

void win() {
. . .

while (digitalRead (20) != HIGH) {};
currentMode = playerMode;
}

End button kept playing the loop endlessly. We wanted to play the tone once. We also added a while loop inside the end() function because otherwise, it was looping. 

To listen to our awkward loosing sound, click here!


HOW CAN WE IMPROVE THIS?



The way we constructed this game can look as something like this. I found these buttons in the shop and solder the blue one to test whether it will work istead of our blue button on the breadboard. Unfortunately, when it was players turn, it generated 5 blue presses. I guess there was somehing wrong with the button. Anyways, we couldn’t do any fabrication, but this is how it looks in our minds. 

Questions: 

*How can we make the speaker louder? I guess we’re having troubles with the transistor. Zoe and Tom are using TIP120 transistor with their project. When I used that one, it generated no sounds. 

*How to find better notes for victory and fail?






Week 5 - Review & Reading Datasheets

FOUND A DC POWER SUPPLY!

Back in home, we use to have all sorts of cables and junk laying around the house. Here, it took me a while to find a power supply. Eventually I found one! The wiring is correct and the gearmotor works. To be honost, I couldn’t visualize how this motor works at first. Apparantely, those white parts which sticks out turns around. Then, I wonder what is that silver looking stick part is..

  

The first time I was testing out the motor, nothing moved so I checked my wiring a couple of times. I completely forgot about the potentiometer. I used analogRead() and the motor responded to the potentiometer in terms of change in its speed.  

Then, I made this wheel looking round parts. I imagined it to be like a wheel. Then, it looked like a primitive robot vacuum. The soldered wires on the power supply were not too long, so, the wheel could only move within a short distance. I feel like this is not the correct usage for the motor. 

To see my robot vacuum, click here!
To see my uni-wheel, click here! (Adjustable speed)

I managed to use the H-Bridge and change the direction of the motor. It took me a while to understand the pins of it. Also, it works without soldering wires to the H-Bridge. Did we suppose to solder them? If yes, is it feasible to solder each pin beforehand, or, just solder the ones that you’re using?


WHAT IS UP WITH OUR SIMON GAME

Okay, this is the overall structure of our game. Writing all the steps down helped us understand better. Starting something is always hard, but this thing made it easier. You start the game by pressing the button. Then watch Simon’s moves. After Simon stops, it’s the players turn to record the answers. IF player played the right sequence, Simon moves on with the following sequence. Anytime the player makes a mistake, the game ends!  

Last week, people asked us how are we going to start/quit the game and also how will we understand that it’s our turn or not. To solve these problems, we added two buttons to start and stop the game. There will also be LED’s that light-up when Simon is showing the sequence and when it’s players turn to play. Hence, the player will differenciate between these two states. 



So, I started by wiring the buttons together and giving them states. Going step by step is easier and it’s more clear in my head. After I make the buttons work, we’ll try to add the LED’s. And make them respond to both Simon’s sequence and also to player’s movements. 

  

Basically, there are 6 buttons in total: 4 of them to play, 2 for start/quit. 

void checkForRestartOrQuit() {

     if(inputs[4] == 1) {

     // restart game

     // add start game light show here

     Serial.println("START NEW GAME");

     gameMode = 1;

   } else if (inputs[5] == 1) {

     // quit game

     Serial.println("QUIT GAME");

     gameMode = 0;

   }

}


The image in the middle shows whether a button is pressed or not by serial printing 1 and 0. (The last two numbers represent the start-quit buttons). When we look at the image on the right, we can see that pressing the last two buttons displays a message and it tells which gameMode we’re in. 





Week 4 - Analog Output

CAN’T DECIDE!!!
Keyi and I had difficulties even during our ideation process, we constantly limited ourselves. Since we both don’t have a background in coding, we’re not quite sure about what is possible/doable and impossible/hard to do with our knowledge. The main thing that we want was it to be interactive to make it more fun. After our discussion, we landed on 2 main ideas: a memory game, or something about humidity and plants. 


The memory game would consist of a dial or a potentiometer which both can be used as a nob. The box would show us a sequence of lights and with the dial, the player should do the same sequence with order to make the box happy. (For example, the image on the right shows us a happy box). The memory game could also turn into a 2-player game. You have to press a sequence of buttons in the right order together with your partner to create a collaborative feeling. (But, why?) 

The other idea emerged from our daily lives and how during busy days, we might forget watering the plants. It would be nice to have some kind of a help about this problem. A humidity-meter would measure the water level of the soil and would give information/signal about the state. 

    

FEEDBACK FROM THE CLASS

  • How can you balance the signal between annoying and enough? (Signal that the humidity level is low and the owner should water the plant)
  • There is a thin line between encouraging and difficult. How can you make an encouraging game?
  • Turning a potentiometer and lighting up LED’s sounds hard. How about adding buttons?
  • How do we know when the game starts? And how will it start? (Maybe press to start?)
  • Is there partial progress?
  • Lenin: WAIT! This reminds me of the Simon Game. 

There was so much to think about! Our goal is not always to activate a sensor! Think about why does a person wants to go somewhere or play with a button? What is users motivation and how does the user approach and interact with something?

AFTER THE OFFICE HOUR

Tom made us feel much better with his advice.We don’t have a invent something. Sometimes it’s good to try recreate an already existing product. It doesn’t mean that it would be easy or that it’s wrong to do so. We’ll definitely learn from trying and this is all that matters.

So, thanks Lenin for introducing us to the Simon Game. ︎ 




Week 3 - Microcontrollers, Digital I/O, Analog Input

I LEARNED HOW TO SOLDER!

Thanks to Phil, my first-ever experience with the soldering iron was successful. To complete this weeks labs, I soldered wires to the speaker. But, accidentaly soldered the red wire to the ground and the black to the voltage. Now, I need an extra 5 seconds each time to connect the speaker to the breadboard. Or maybe I’ll use the solder sucker to desuck it and resolder the speaker. This way, I got to learn how to use the solder sucker as well!

HEY NYC, MAKE SOME NOISE!!!

First things first, I checked the sensor input range for both FSR (0-990) and the phototransistor (20-900). Also, I checked whether my speaker was working since it was my first time using it after soldering. I played a single tone continually. And changed the frequency range to hear different tones. 

To play it louder, I plugged in the N-channel MOSFET transistor. To limit the current, I used the 100-ohm resistor with the transistor. Since all the transistors look alike, I spent quite some time in front of the transistors in the shop. (Image on the left)


    


Then, I used both the FSR and the phototransistor as my analog inputs and listened to the frequency change. Using the flash made me go up to 900ish values as my range and hereby the frequency also increased. 

Middle image: FSR and Speaker (click to watch video)
Right image: Phototransistor and Speaker (click to watch video)



To play a melody, I used the values in
pitches.h. This is what is sounds like!




To try something else, I connected 4 pushbuttons and assigned different frequencies to each of them. Click to listen!

void setup(){
pinMode(8,OUTPUT); //speaker pin
pinMode(2, INPUT); //yellow pushbotton
pinMode(3, INPUT); //green pushbotton
pinMode(4, INPUT); //red pushbotton
pinMode(5, INPUT); //blue pushbotton}


void loop()
{//if the button is pressed
if (digitalRead(2) == HIGH){tone(8,200,1000);delay(300);} else { noTone(8);}
if (digitalRead(3) == HIGH){tone(8,400,1000);delay(300);} else { noTone(8);}
if (digitalRead(4) == HIGH){tone(8,1000,1000);delay(300);} else { noTone(8);}
if (digitalRead(5) == HIGH){tone(8,1200,1000);delay(300);} else { noTone(8);}

}


After figuring out how to manage buttons with frequencies, I tried to implement notes. I just changed the second argument of the tone(). But, the sound paused right after I let the button go. I’m assuming that I used a wrong syntax etc. I figured out the first part of what we tried during the office hour. I feel like I need more time to figure out the millis() etc. 

// when button changes low to high (is pressed): // start tone
// when button changes high to low (is released): // stop tone


// tone pitch depends on which button
/////////////////////// if 5 seconds have passed since last tone started
// start the tone
// lastToneStarted = millis()


SERVO MOTOR WORKS

I replaced the speaker with the servomotor, and continued using the FSR and the potentiometer as my analog inputs. 

  



Right image: motor & potentiometer (click to watch video)
Left image: motor & FSR (click to watch video)

Next time, I’ll try to control the motor without analog inputs. I want it to turn in an angle and make it periodic to experiment as if it was something else. 





Week 2 - Electricity and Components

TIME TO WRITE SOME CODE!

This week was not as painful as last week, since we've already familiarized ourselves with the tools and the basic concepts of electricity. I spent most of my time understanding the schematics and the code. 

First, I did the “Digital Input and Output with an Arduino LAB”. For digital outputs, I used LED’s and worked with the 220-ohm resistor. I also used the 10K-ohm resistor, to see that the LED’s would be dimmer, even to dim to see. After setting up my breadboard, I all got to do was to program my arduino. The example below shows that when the pushbotton is pressed, the yellow LED is turned on; otherwise, when the pushbotton is released, the green LED is turned on. The code we use for this example made me understand the difference between digitalRead and Write.



Working with analog inputs was more fun because I got to see a range in LED’s brightness! I experimented with both the potentiometer, the FSR, and the phototransistor. 

LET’S EXPERIMENT WITH ANALOG INPUTS!

   

Above: The LED’s dims up as I turn the pot to right.



Above: The LED’s dims up  as my force on the FSR increases. It was hard to see the range of brightness with my eyes, but since we added the “Serial.println(brightness);” in our code, brightness value showed up in the serial monitor. 



To fully understand using analog inputs, I attached two FSR’s and 2 LED’s to my arduino. The problem was when I let go of the FSR, the LED’s were still lid up. I wanted them to lid up only if the FSR could sense a force. After my thursday-ICM lecture, I added the “else” function and the problem was solved! After that, once I squized the left FSR, the yellow LED was turned on and once I let go of the FSR, the LED was off. (Visa versa is also true for the red LED.)
else {

    // if the switch is open:

    digitalWrite(9, LOW);     // turn off the yellow LED

    digitalWrite(10, LOW);    // turn on the red LED

  }


Using the phototransistor, on the other hand, took me a while to understand. Yonatan helped me a lot during my journey. I set up my breadboard the same way I saw on the lab-site. Short-leg of the phototransistor was going to the resistor (ground),and the log leg was connected to the A0 input. Even the code was correct, we only got a little bit of light and covering down the transistor didn’t make a change. So basically, something was wrong. Then, I saw an alt text for the phototrasistor image stating: “Phototransistors. The short leg goes to voltage, and the long leg goes to the input pin of a microcontroller.” So, I turned the phototransistor the other way and IT WORKED! Yonatan was also shocked because we both thought that the short leg should connect to ground. 

const int ledPin = 9;       // pin that the LED is attached to

int analogValue = 0;        // value read from the phototransistor

int brightness = 0;         // PWM pin that the LED is on.



void setup() {

  // put your setup code here, to run once:

// initialize serial communications at 9600 bps:

  Serial.begin(9600);

// declare the led pin as an output:

  pinMode(ledPin, OUTPUT);

  pinMode(A0, INPUT);

}


void loop() {

  // put your main code here, to run repeatedly:

analogValue = analogRead(A0);    // read the phototransistor value

brightness = map(analogValue,120,600, 0, 255);       

if(brightness<20) brightness=0;

analogWrite(ledPin, brightness);   // PWM the LED with the brightness value

Serial.println(brightness);        // print the brightness value back to the serial monitor

}


  

Above: The LED’s dims up as the phototransistor senses the light on the floor. As I cover it with my hand, the LED is not on.  

After all of this,  I went back to the pushbotton to study the state change and counted the button presses. Also, analyzed different actions such as, tap, short press and long press. By defining different legths of presses in ms, I got different results for short and long presses. 






Week 1 - Introduction and Basic Part & Tools

AUTOMATIC/TOUCHLESS TOILET FLUSHERS DRIVE ME CRAZY.

I guess I like having control in my hands when it comes to interacting with objects. I didn’t know this fact about myself until we had the discussion about implicit/explicit interactions during our lecture. It also sums up why I love using the home button on my iphone; I just like the touch feeling. Unfortunately, I’ll need to give up the home button since the button is replaced with a larger screen on newer phones. 

Also, while explaining my annoyance towards motion sensors/detectors etc. I was confused about the meanings of force and pressure. So, here is an easy description for future me:  

A force can be a push or a pull. When a force is exerted on an object it can change the        object's speed, direction of movement or shape. Pressure is a measure of how much force isacting upon an area.

Now, it makes sense because I love pressuring buttons: Not tap, but click.



---


WAIT, THIS MIGHT BE A GREAT EXAMPLE FOR PHYSICAL COMPUTING!

Last weekend West Indian Day Parade took place on Nostrand Avenue, a 10-min walking distance to my apartment. It was a sunny summer day and some companies were distributing promotional products. And I got this fan!

All these letters were formed with the sensors on the right! That is crazy! While turning, it  creates an illusion in some sort of. What kind of a sensor is this?  I really want to learn how this works. And maybe I can build up my own promotional product in the upcoming weeks!!


   



---


I HELPED A LED TO LIT UP!!!

My breadboard was super stiff that I had to spent most of my time to loosen it up. The voltage
regulator helped me a lot prepping my board. Also, watching the videos gave me a sense of what we were doing. 

I was having a hard time placing the wires on the right spots of my board. During the PComp workshop, David explained where to place my wires so that my arduino would work. After that point, I figured out the rest and below you can see the first LED that lit up!


 

“Will it Light? Test Your Understanding” part of the second lab was fun! I got to test my knowledge and also get a sense why something is wired incorrectly. 


     

To step up the game, I added the pushbottons. I also did some Voltage measurements to familiarize with the multimeter. The left one worked just fine.  But, I still don’t understand what is wrong with the middle one. There was a touch of light in the red LED and that was it. Some of my other friends tried to wire them in parallels, and it worked. Maybe I should have tried that or maybe I placed the diode into the wrong spot. I’m not sure :( 


   

To experiment more, I tried lid up an LED with 3 pushbottons. I wired them both in series and in parallels. When switches were in parallels, you can push one or all the buttons to lid up the LED.




Whereas in series, this wouldn’t work. You had to press all to get light! 




Lastly, I made my own switch using the copper tape! The broken heart is fixed when complete!! 


         

Questions:

1. What difference would it make if I use the +5V power part of the arduino?
2. Do I always have to use the resistor? I’m still not sure about the resistor?






















































































































































































































































































































































































 










 
Lipsum™
Integer turpis massa, varius ultricies est sed, aliquet feugiat enim. Nulla facilisi. Ut in justo in ex faucibus ultricies. Proin id erat quis lorem vehicula commodo. Phasellus pharetra libero pretium ultricies aliquam. Vivamus eleifend, ligula ut venenatis aliquet, massa elit efficitur lorem, fermentum molestie elit ligula in ex. Duis mauris tellus, pharetra et orci a, aliquam imperdiet augue. Pellentesque elit neque, tincidunt sit amet imperdiet eget, porta ut metus. Nulla id leo tortor. Donec elementum ac sapien eget feugiat. Donec lorem dui, vestibulum quis nisl et, feugiat mattis massa.


Phasellus Rez

Praese
Suspendía

Lipsum Deus

  1. Praese Vita
  2. Nulla Vehicu AI
  3. Ukam Cors
  4. Dictum Magna
  5. Cursus Ex
  6. Suspendis Est
  7. Facili Sap
  8. Et Magni Disc
  9. Phasellus Deus
  10. Deus
  11. Rexus
  12. Maximus
  13. Lorem Ipsum
  14. Dolor 123




©MMXXI
Integer turpis massa varius