Name of the recitation: Sensors
Partner: Thomas Tai
Professor: Professor Antonius
Goals for this recitation:
-Meet with new sensors.
-Attach the sensor to Arduino and use the data from that sensor to turn an output (Servo-motor, LEDs, Buzzer, etc.) on and off.
-Document my work.
-Post an individual reflection.
PART A (In Pairs)
- New sensors
(sources credit to http://ima.nyu.sh/interaction-lab/category/recitations/)
- Moisture Sensor
- Vibration Sensor
- Infrared Distance Sensor
- Ultrasonic Ranger
- 3-Axis Analog Accelerometer
- What did you intend to assemble? Why did you choose that specific sensor and output?
Since both of us are fairly interested in sensors, Thomas and I decided to do something cool and challenging. We intended to assemble a circuit called “magic traffic lights”, which consisted of three LEDs respectively with color red, yellow and green, and when the sensor was moved differently, only the according LED would automatically be blinked while the rest would keep shut like a magic.
In order to realize this idea, we decided to utilize the sensor called 3-Axis Analog Accelerometer.(image below is a little different from the sensor we used in recitation).
Frankly speaking, this sensor seemed to be the most complicated one among the five sorts of sensors available. The reason why we chose it can be explained in two dimensions. On the one hand, since we wanted to manipulate the LEDs as precisely as we could, we dismissed the idea of using moisture sensor and vibration sensor because they seemed to be hard to control. On the other hand, compared with distance, acceleration is not static but quite dynamic, which is very interesting, so we decided to use this sensor.
In regard to the output, as we intended to make a “magic traffic light”, we certainly chose LEDs as output 💡 💡 💡.
- Which materials did you use? Which circuit(s) did you use as a reference for them?
Materials we used, aside from LEDs and 3-Axis Analog Accelerometer, were all basic components of circuits such as wires, breadboard, Arduino, resistors and so on.
Since we needed to control each LED individually and separately, we referred to the exercise we have done before– Multiple Outputs with Multiple Inputs:
- What sources did you use in order to program them? Did you have to modify them?
Given that we were both unfamiliar with this component, we first referred to the website offered in guidance for instructions. We were informed by the website that this sensor actually need a library:
However, when we decided to apply those schedules into practice, problems emerged– after we upload the library to the Arduino and decided to regulate the sensor, it just kept reporting a weird error which is called “calibrate error” :
We have tried many times and we even asked professor Rudi for help but we still failed to resolve this problem in the end. But professor Rudi gave us a very important advice was that we could use a more simple way by using basic examples built in Arduino instead of using some alien libraries because sensors produced by different companies could be rather different inside. So we mainly referred to two sources:
Examples/01Basics/AnalogReadSerial and Examples/06Sensors/ADXL3xx :
We kind of combine these two examples together and have also made some other commodification in order to realize our goal.
- Which different steps you went through to make it work? Did it work as expected?
We first built the circuits with nine LEDs because we thought it would become even cooler if we could control each of them individually. However, this attempt was soon sentenced to death because too many LEDs messed up the input and output and that it was just too difficult for us beginners. So we then began with three LEDs.
After completing the circuit, we then turned to writing sketches. We first tested the function of reading serial and then since it is an analog sensor, we utilized “map” to transfer. We used if conditions to let each LED only sparkles when it is required to. We didn’t meet much trouble during coding but we ended up only using three LEDs which is a little bit below our expectation.
The final look is like this and the codes are attached below the post:
- What conclusions can you draw over the work you did?
Sensors are of good importance for interactive design.
We should always begin with simple forms and gradually work for the complex one.
Modifications are of great significance and require a lot of wisdom.
- Can you relate your experience building this circuit to any device you interact in your daily life?
I think the circuit we built is to some extent similar to maybe a part of our phones. As we all know, especially for some types of games or apps, when we shake our phone in different directions or at different rates, the phone will receive some different signals and accordingly conduct different reactions. Though it may not necessarily use accelerometer, I think the basic principles are almost the same.
- If you were to continue experimenting, what would your next steps be?
As I mentioned before, I would strive to add more LEDs to the circuit and maybe let nine of them all receive individual orders and blink in different times. Or even more LEDs would be attached to this circuit and my final goal is to create a kind of “light waves”.
PART B (Individual) / Reflections
How is writing code similar to making dumplings?
First, they both consist of many different steps and the sequence of them really matters. You can never mess up the order or you won’t achieve either delicious dumplings or beautiful sketch.
Second, they both require innovation and experience. Though it may sound a little bit strange for making dumplings, innovation does matter because if you want to make tasty dumplings, you have to keep improve your recipes and learn from former experiences.
Third, practice makes perfect. Both activities need practices and effort. Endeavors and time should be paid in order to make progress in these two areas.
- 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?
First and foremost, computer changes the way we think. This can be explained in three dimensions. Firstly, computer, especially with the help of Internet, makes it possible for us to communicate over a long distance. The earth becomes a global village and people’s horizons are no doubt greatly broadened. Secondly, computer’s fast pace of processing task and calculating helps people to think on the basis of proper, concise, abundant dependable datas. Thirdly, computer changes the way people view interaction and its combination with other tools is also revolutionary.
Also, computer creates a lot of convenience and entertainment for people, which is also a very meaningful and important point.