Introduction
In the third recitation we were asked to choose a sensor and build a circuit that integrates the sensor with Arduino. My partner Xueping Wang and I chose the Ultrasonic Ranger Sensor which can detect distance and built a working circuit. We also added a buzzer to the circuit and changed the code so that the circuit would work as a FamilyMart-style doorbell.
Ping Ultrasonic Range Finder Circuit
Hardware
- Arduino or Genuino Board
- Ultrasonic Range Finder
- hook-up wires
- (buzzer)
Following the schematic we successfully connected the Ultrasonic Ranger Finder to Arduino. What’s worth noting is that the Trig and Echo of the Ultrasonic Ranger should be connected to the same digital pin.
After copying the code from the website, the Ultrasonic Range Finder is properly functioning…!
And then we decided to add something to the existing circuit to make it a real design. My partner chose the buzzer and we decided to make a Family-Mart-Style door bell. Connecting a buzzer to the circuit was not too difficult, but changing the code was a challenge for us.
We tried to combine the code for the Ultrasonic Ranger and that for the toneMelody Buzzer. However, simply copy-pasting the old codes is not enough in this case. We have to adjust the code to the right sequence and define the note. We used the “If” sentence so that when the distance is < 10 cm, the door bell will go off. We failed a few times, but with the help of a fellow, we identified our mistakes and corrected them. We first forgot to define the notes in a new tab, so the door bell did not work. We also forgot to set the pinMode. And the “}” was kind of annoying because we often did not know if we are missing one at the end of a sentence. I think I still need a bit more practice in coding so that I can be more familiar with the language.
The code for the toneMelody is in the former link in Recitation 2: https://www.arduino.cc/en/Tutorial/toneMelody
Finally we got the code right and the device was working as we expected! Whenever my hand comes close to the sensor (within 10 cm), the buzzer would go off.
Question 1:
My partner and I intended to assemble a door bell that works based on the distance. We added a buzzer to the circuit that has a ultrasonic ranger finder and changed the code ourselves. When something comes near the sensor (within the distance of 10 cm), the buzzer would be triggered like a door bell. In real life, I think our design is quite useful. For example, the automatic “Welcome”sound in FamilyMart is designed based on the same principle. When customers enter the shop, an automatic “Welcome”can make them feel different.
Question 2:
Because coding is about following certain rules in a programming language. One needs to sort out the steps of coding and follow the sequence in order to make the codes work. The codes have to be complete and done in the right order.
Question 3:
I believe the computers influence how humans view the world and even how humans think. Before the existence of this new media, people were not able to see things far away at home. What they get to see and experience is largely limited by their geographic location. But the introduction of computer and the Internet has made it easy for people to enjoy the fantasies around the world in front of a screen. This has significantly changed people’s way of life, but it is also sometimes a illusion. Now not only do we submit homework and document our designs on the computer, we also allow the computer to shape our understanding of the world. This new media, as Manovich refers to Adorno’s theory of “culture industry,” may even manipulate human thoughts. As the computer can bring almost anything instantly in front of us on the screen, we may get impatient and spoiled. We may not feel as excited about real-life experiences as we did before. Computers give humans convenience but also the tendency to be lazy, especially lazy in thinking.
good work Feifan!
just never screenshot code, you can copy copy and paste it here or you can post a link to your code on github if you have an account: https://github.com/
Also please add the questions before you answer so any person seeing your documentation can understand what you are talking about.
Thanks for your suggestions!