In week 3 recitation we are tasked with building a circuit that utilizes a sensor as input. And then use the Arduino to process the input value and output it into a different part of the sensor to create some kind of corresponding feed back. There is no schematic provided for this recitation as we are designing it ourselves. The sensor I chose was the infrared distance sensor and my output is the buzzer.(hand drawn diagram below)
Process:
The process was very smooth, I used the code I wrote during lecture and simply changed a few variables to match the new circuit, plugged everything in and it worked with no problem. The code that I wrote utilizes the analog input to generate tone, and as the input value gets larger, the length of the note decreases and the tone increases, the generated sound is very cool and natural. Since I finished early I also swapped the infrared sensor with a moisture sensor, I also later replaced the buzzer with an LED just to see if other output works, and the LED lights up very responsively(Working video below).
My Code:
int var = 0;
int buzzer = 9;
void setup() {
pinMode(buzzer,OUTPUT);
pinMode(A0,INPUT);
Serial.begin(9600);
}
void loop() {
var = analogRead(A0);
int mapped = map(var,0,1023,0,1000);
Serial.println(var);
if(mapped>=50){
tone(9,mapped*4,100-(mapped/10));
}
else{
analogWrite(buzzer,0);
}
delay(100);
}
Reflection:
With the sensors I am able to get a better sense of the interaction that is possible with technology and machines. Even though the code and circuit it self is pretty much as simple as it can be, The moment that the LED lights up and when the buzzer starts responding to my interaction, it feels very nice.
Documentation questions:
Q1:What did you intend to assemble in the recitation exercise? If your sensor/actuator combination were to be used for pragmatic purposes, who would use it, why would they use it, and how could it be used?
I assembled an circuit with distance as input and sound as output, if it were to be used for practical purposes, I think it resembles a sonar alarm on a car used when parking. It is very common for all car owners to use, as the tone and frequency of the beep increases as the car gets closer to a wall.
Q2:Code is often compared to following a recipe or tutorial. Why do you think that is?
The reason why Code is compared to recipe or tutorial is because it requires clear instructions that is not ambiguous, a tutorial that is ambiguous will leave the user confused, a code with bad syntax will cause an error. Everything have to be done in a good structure so that the computer can understand the code.
Q3:In Language of New Media, Manovich describes the influence of computers on new media. In what ways do you believe the computer influences our human behaviors?
Computer and technology in general changes human in so many ways, one thing that I found interesting is how humans expect to interact with computers, as modern day user interface is designed to be very user friendly and easy to understand, Humans get more and more used to touching, speaking, to their machines, and expect a feedback. Just like in the amazon alexa advertisement, the users expects the lamp to talk back to them, just like how my parents sometimes touches a computer screen assuming its touch screen. This is whats interesting about human behaviors, we are born to interact with things around us using the senses we are given, and when we get a feed back that does not match up with our expectation, we feel weird.