Sept. 27th
Recitation Exercise Introduction (cited from Recitation 3 note):
Choose one of the sensors listed below and read about what it is and how it performs. Once you have picked a sensor, build a circuit that integrates this sensor with your Arduino. Use the data (input) from your sensor to drive an output (Servo-motor, LEDs, Buzzer, etc.). Document the finished circuit and your interaction with it. In addition, draw a diagram of how all the components are connected and add this to your documentation. If you finish your circuit early, swap out the sensor in your circuit with a different sensor.
For these circuits, think back to the lessons from class, such as how to map() an analog input, as well as how to set an analog output with an analog input. This can be seen in the example AnalogInOutSerial
Description & Reflection:
Out of moisture sensor, infrared distance sensor, vibration sensor, ultrasonic ranger and joystick module, we chose to play with the infrared distance sensor. As introduced in the recitation 3 note, the infrared distance sensor
“can by used by implementing the connections and code from a simple analog read sketch. In the case of Infrared Distance Sensors, using the “map()” function can be helpful. This function maps the analog readings from the sensor to the distance between the sensor and the object”.
Therefore, we decided to build a circuit including a led light and the infrared distance sensor, and program a code to enable the led light to respond the the changes of the analog readings from the distance sensor.
Material:
Infrared distance sensor *1
Arduino * 1
Breadboard * 1
Led light * 1
220Ω resistor * 1
1 * USB A to B cable
A handful of wires
circuit in progress… |
circuit schematic |
After completing the circuit, we went ahead into the programming part. This was when we encountered several obstacles. Our first step was testing if the circuit works correctly by running the AnalogInOutSerial code from Arduino library.
AnalogInOutSerial code from Arduino>File>Examples>Analog>AnalogInOutSerial
We wanted to develop a code serving our purpose based on AnalogInOutSerial. Nonetheless, at first we tried digitalWrite() since we believed that since what we wanted is on/off of the led light, then it should be an either/or, namely, a digital problem. Of course, this attempt ended in confusion and failure. After anxiously testing over and over and switching to other codes, we sought help from our dear learning assistant and realized the critical mistake. We should have tried AnalogWrite() because (1) the sensor connects to the analog pin; (2) we want the led light to react to a range of data! (wondering if there’s a way to articulate the second reason better.)
Rather than using map() function recommended in the introduction, we chose AnalogWrite() and limit the range in which we want the led light to turn on. And any number out of the bracket would result in cutting off the power, and therefore the led light will turn off. One point to note is that first of all, we need to know the range of the infrared distance sensor itself so that we can adjust our code. The video below shows our accomplishments.
Questions
Question 1:
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?
We intended to build a circuit that enables the led responds to the analog changes from the infrared distance sensor. Within The target using environment would be space like evacuation passageway/ fire safety passage where constant light is not needed unless someone passes that area. So when the distance from the user to the sensor detected is within the range preset in the code, then the light will be automatically turned on and kept until the user finishes action and leaves that area. Serving that kind of situation, convenience is provided to the maximum while waste of electricity is deduced to the minimum since the light reacts immediately the the analog readings of distance.
Question 2:
Code is often compared to following a recipe or tutorial. Why do you think that is?
I’m not so sure. But recipe and tutorial are both created by different individuals. So there must be great diversity in recipes to cook one dish or tutorials to solve one problem. Since what we want to accomplish is identical in a substantial way, however different the personality in a recipe and tutorial may seem, they are identical in some crucial steps and methods. I imagine code the same. It is entitled a sense a personality thanks to the creator. But it follows and has to follow a rigid universal logic and language.
Question 3:
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?
To review Manovich’s opinion on the transformation from old media to new media, let’s quote the tendencies he summarized in Language of New Media: 1. numerical representation, 2.modularity, 3.automation, 4.variability and 5.transcoding. To be honest, these concepts are still very vague to me even after reading through the article.
But like the title of Manovich’s book, “Language of New Media“, I would say the computer influences us in a linguistic way. Living in a computerized city, contemporary people are not only interacting with other human beings, we are also interacting with computers. Human-computer interface has especially changed the way people conduct conversations. Therefore, the way people tend to express themselves are changing: we might tend to think faster and speak unthinkingly.
References
Recitation 3 note: https://wp.nyu.edu/shanghai-ima-interaction-lab/recitation-3-sensors/
p.27-48 Language of New Media by Lev Manovich