INTM-SHU 101 002
20 February 2018
W3 Documentation for Lab 6
Partner: Yutong Zeng
- Breadboard *1
- Arduiono *1
- Infrared distance sensor *1
- Buzzer *1
- Jumper wires
- LED *2
- 220 ohm resistor *2
Inspired by car parking alarm in the garage which produces large noise when the distance between the car and the sensor gets too close, we decided to use a buzzer, an infrared distance sensor, and two LEDs (one green and one red, to tell visually if the distance is too close or not).
When we first got the distance sensor, we did not know how to program it to make it work. Anyway, we decided to make the circuit first and then we could worry about coding and here is the schematic plot:
and this is the circuit we made:
One thing we encountered when connecting the circuit is that I did not know how to connect the infrared distance sensor and we sought help from the lab assistant Nick. We then knew that red wire being connected to the power source and black wire being connected to the ground is usually the case in connecting any device to the circuit, which is truly helpful (thank you, Nick!).
Then, we referred to the instruction page of W3 recitation and clicked on the wiki page of this specific sensor: there we found the code. After a slight change in the parameter, we copied and pasted the code, which was officially provided by the producer, into Arduino IDE, although I’m not sure if we have to cite the source… Anyway, after that, another problem arose: the code worked well by itself, but if we added the code we write to run the whole circuit, we could no longer get the sensor value. Again, we turned to the lab assistant. After going over our code, Luis told us that the problem is too complicated for us to understand but there was a simple solution to it. As a result, we added a new variable that gets value from the sensor value so that we can avoid directly using the sensor value, which will create the problem we met.
Everything should be find since then but soon we found that the buzzer in the Arduino kit didn’t work in the same way as those provided by the school. We consulted the lab assistant for the third time (this time Rudi) and figure out the correct coding for the buzzer.
Then, things worked pretty fine. We failed to record the final product but I can describe it. Basically, when something is too close to the sensor (closer than 10 cm in our case), then the red LED will lit up and the buzzer will make noise; otherwise, the green LED will lit up, indicating that everything is within safe distance. One interesting thing in this alarm is that when the buzzer starts working, the pitch of it will vary as the distance between the object and the sensor changes. This tiny trick was told by Rudi when he was teaching us how to program the buzzer.
If I were to continue experimenting, I believe I would start testing the practical use of this device. For example, I would like to collect data about what distance can be considered “unsafe” or “too close” when parking or what should the pitch and volume be so that driver in the car can hear the alarm when it is triggered.
My takeaways from this week recitation are;
- how to connect a device you’ve never seen before to the circuit on first sight (but always refer to the instruction if possible)
- how to use infrared distance sensors and buzzers
- be creative and have fun with coding!!!
Q1: How is writing code similar to making dumplings?
Ummmm…. I don’t find writing code similar to making dumplings. Running code is. When the code is being run, one can compare the process of it with a team making dumpling. There is CPU, or the chef, making all the decisions; there is memory, or plates, where one can store/place value/ingredients…
Q2: As Manovich describes in the Language of New Media, the influence of computers on new media is clear. In what ways do you believe the computer influences our human behaviors?
I believe the most substantial influence computer brought is on how we human process information. Although I forgot where I saw it, there was a study on how modern people process information given to them differently from people in the past. The study showed that people nowadays are less efficient in memorizing concrete knowledge but they can usually remember methods through which or places where they can find the exact same pieces of information. In this way, modern humans are equipped with brain that can deal with vast amount of information. Also, creativity is more and more important as computer can do the repetitive job for us.