Recitation 3: Sensors – Ariana Alvarez

In this week’s recitation, we were assigned to build circuit with sensors, and code their programming into the arduino board. In my opinion, building the circuits was not quite as complex for some of the sensors, however each one had its own specific code that we had to programme in order for it to actually work, so that was the more tricky part for which we used many sample codes at a certain point. 

Circuit: Infrared Distance Sensor

>>Materials:

  • 1 Arduino Board
  • 1 Infrared Distance Sensor 
  • 1 Bread Board
  • Jumper Cables

     

>>Sample Code:

/******** start code ********/
//connect gp2d120x to A1
#define pin A1

void setup () {
        Serial.begin (9600);
        pinMode(pin, INPUT);
}

void loop () {
        uint16_t value = analogRead (pin);
        double distance = get_IR (value); //Convert the analog voltage to the distance
        Serial.println (value);                 //Print the data to the arduino serial monitor
        Serial.print (distance);
        Serial.println (" cm");
        Serial.println ();
        delay (500);                            //Delay 0.5s
}

//return distance (cm)
double get_IR (uint16_t value) {
        if (value < 16)  value = 16;
        return 2076.0 / (value - 11.0);
}

/******** end code ********/

My partner and I created this circuit by connecting the sensor to an analog input A1, power 5V, and to ground. After completing the circuit, we used the AnalogInput feature in the Arduino programming, to insert the sample Infrared Distance Sensor code into the program. 

Question 1:

In this recitation exercise, we intended to assemble an Infrared Distance Sensor, which measured how close or far an object was from it. While building it and seeing its purpose, I thought about its possible pragmatic use in security related situations, where alarms go off if a person gets too close to an object. For example, in high quality jewelry stores, they may implement that sensor within the box of displayed diamonds, so that if anyone were trying to steal it, just by touching the crystal box, it would automatically trigger the alarm as the hand’s distance is to close. Consequently, using it because it’s a great method to measure and keep people away from precious objects. 

Question 2:

It is very true that code is quite similar to following a recipe or tutorial, as contains the ingredients along with its steps that are needed for a sensor or anything connected, in this specific case of the arduino board, to actually work. This idea of code as “cooking”, was also introduced through the video showed in class, where a computer scientist made a cooking tutorial, and explained how it related to coding. Hence demonstrating how coding is a way of giving instructions to the computer so it actually works. However, another way in which they relate, isn’t only by its instructions, but also within the specifications both actions have within them. For example, when cooking, you usually have to add a certain amount of each ingredient for the final product to be delicious. The same occurs in coding, you need to write it with a certain order of instructions, capitalized letters vs. uncapitalized letters, and exact pin numbers. If a code has something out of place, or is missing a fundamental letter, then while trying to run it, it won’t work. Therefore, showing how coding is similar to following a recipe, as recipes are specific, and they need to be followed in a certain way for it to work in the most optimal manner. 

Question 3:

Manovich describes the influence of computers on new media as a starting point for it. He explains how new media hasn’t just been shaped by computers, but also created, distributed and stored within them, hence showing the inextricable relationship they have. A similar concept can be seen through humans, as new patterns of social behaviors have started to rise due to computer influence. Each day with new technological advancements, human life becomes assisted by computers. One example is how people are less likely to go to buy food in person, or go to stores, since they have an “app” that does it for them. Even though this facilitates human lives, it tends to create more lazy behaviors, and shapes our conduct in a way that less in-person interaction is being held, consequently damaging social interactions because of “computer presence”.

Leave a Reply