In this section, we tried out several sensors to see which information from real life could be translated into electrical signals using circuits. The codes were basically all the same except some tiny revision. However, although I thought building these circuits only involve changing the sensor part, some problems still occurred during this recitation. This led me to reflect on how well I actually understand the whole idea behind the pre-made diagrams.
Circuits
Materials:
1 * Arduino Uno
1 * USB A to B cable
1 * breadboard
1 * buzzer
1 * LEDs
1* Moisture sensor
1* Ultrasonic sensor
1* Vibration sensor
A handful of jumper cables
Sensor 1: Moisture sensor
The moisture sensor is a small device that has three ports, each goes to one in GND, power, and pin. It works by returning a value that represents how moisture it is on the device. When it is not at all moisture, it returns 0 and the value increases when in touch with more water (it has a max value though). We uploaded the AnalogRead code to read the value returned by the sensor. This device can be used in settings that involve controlling how wet something is such as auto watering when the soil is dry. However, the device is not very sensitive because when we breathe to it, it didn’t change a large value, although there was vapor in my breathe.
Here is how we are changing values returned by the moisture sensor in a lab:
Sensor 2: Vibration sensor
This sensor returns how strong the vibration is on it. We used the special “knock” code so that the string “knock!” is printed on the serial panel. The code is pretty simple, however building the circuit is kind of tricky. Because we built a circuit with a sensor that had three ports before this one, we couldn’t really take that sensor down and plug the vibration sensor in directly. Moreover, we needed to add an additional resistor as well as another output device into the circuit. We chose the LED, and successfully fried it because we had it in parallel with the resistor and sensor. When breaking it gave a soft but horrifying blast sound and an unpleasant smile. Lesson learned.
This is the sad scene of a broken LED:
After consulting an instructor, I learned that to adjust the brightness of the LED using values returned by the sensor, we don’t really need to connect them in one single circuit. We can actually code it and give it an output value mapped from the input analog value. This is the part of this section that actually deepened my understanding of how Arduino worked in real life.
Following is the video of a working vibration sensor:
Sensor 3: Ultrasonic sensor
We would like to get a joystick yet all three of them are on lease. So we got our second choice. This is quite easy to put together because there are no other electronic parts related and the codes are already done. Since it calculates distance based on ultrasonic, it should be more accurate than the infrared one. It is indeed quite smooth, just sometimes it is quite hard for a user to keep track of the changes of a value when information is displayed on the serial panel in the form of horse race lamps. I wish there were a user’s interface or something that I could just read the values from one box without unnecessary information. This is one part of coding that I want to learn in the future using C.
Reflections
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 assemble a circuit that takes the input from the sensors and gives this input back to the computer. Then the computer or the circuit makes an output in a certain way using the input value.
The vibration sensor could be used to detect whether people has walked through it. So we can use it to build a floor light that automatically turns on when people pass by. It can be assembled in a family to build switchless light systems.
The moisture sensor can be used in a sauna house to track if the sauna room is too wet. When visitors hate it wet in the room, the room can automatically turn on its dehumidification device.
Code is often compared to following a recipe or tutorial. Why do you think that is?
Because when we cook following a recipe, we do the instructions step by step from bottom to top. And when the computer is executing the codes, it runs from the first line to the last unless specified.
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?
Sometimes computers detect and give feedback to help us better track our own status and behavior. Using computers, human can have a better insight into what they are doing and check continuously whether their behavior meets their expectation of themselves.