Class process:
I first chose the force sensitive resistor and later tried a bit on the ultrasonic ranger.
Force Sensitive Resistor (FSR)/Pressure Sensor
A FSR can convert physical force into electrical signals. The resistance value changes along with the force received.
Reference: https://www.makerguides.com/fsr-arduino-tutorial/
Circuit 1: This circuit is about connecting the FSR to Arduino Uno. I followed the diagram and went smoothly. The code aims at changing analog read input into the numerical output in the serial monitor.

Code:
#define fsrpin A0
int fsrreading;
void setup() {
Serial.begin(9600);
}
void loop() {
fsrreading = analogRead(fsrpin);
Serial.print("Analog reading = ");
Serial.print(fsrreading);
if (fsrreading < 10) {
Serial.println(" - No pressure");
} else if (fsrreading < 200) {
Serial.println(" - Light touch");
} else if (fsrreading < 500) {
Serial.println(" - Light squeeze");
} else if (fsrreading < 800) {
Serial.println(" - Medium squeeze");
} else {
Serial.println(" - Big squeeze");
}
delay(500);
}
Final Result:
Circuit 2: This time the FSR served as a switch. With the analog read, we can set the LED to change once the pressure value exceeds/is under 500.

One particular thing I noticed besides the circuit is that we might need to use resistors with different values for different colors’ LEDs.
“The value of the resistor depends on the color LED you are using. You can use the following values as a guide:
-
-
- Blue, Green, White or UV: 68 Ω
- Red, Yellow or Yellow-Green: 150 Ω
If you don’t have any of these resistor values, try to find one that is close. You can also put multiple resistors in series, to get the correct value.”
Therefore I used a 220Ω resistor for a yellow LED.
Code:
#define fsrpin A0
#define ledpin 2
int fsrreading;
int state = HIGH;
int previous = 0;
long time = 0;
long debounce = 40;
void setup() {
Serial.begin(9600);
pinMode(ledpin, OUTPUT);
}
void loop() {
fsrreading = analogRead(fsrpin);
Serial.println(fsrreading);
if (fsrreading > 500 && previous < 500 && millis() - time > debounce) {
if (state == HIGH)
state = LOW;
else
state = HIGH;
time = millis();
}
digitalWrite(ledpin, state);
previous = fsrreading;
}
Final result:
Circuit 3: Here the FSR and LEDs are connected similarly as the previous circuit. But the FSR can now control more LEDs in a more dynamic way. The analog input leads to an analog output, showing the degree of pressure added.

Code:
#define led1 2
#define led2 3
#define led3 4
#define led4 5
#define led5 6
#define led6 7
#define echoPin 2
#define trigPin 3
long duration;
int distance;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
Serial.println("Ultrasonic Sensor HC-SR04 Test");
Serial.println("with Arduino UNO R3");
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(12);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = duration * 0.034 / 2;
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
fsrreading = analogRead(distance);
Serial.println(fsrreading);
if (fsrreading > 200) {
digitalWrite(led1, HIGH);
}
else digitalWrite(led1, LOW);
if (fsrreading > 450) {
digitalWrite(led2, HIGH);
}
else digitalWrite(led2, LOW);
if (fsrreading > 550) {
digitalWrite(led3, HIGH);
}
else digitalWrite(led3, LOW);
if (fsrreading > 650) {
digitalWrite(led4, HIGH);
}
else digitalWrite(led4, LOW);
if (fsrreading > 800) {
digitalWrite(led5, HIGH);
}
else digitalWrite(led5, LOW);
if (fsrreading > 900) {
digitalWrite(led6, HIGH);
}
else digitalWrite(led6, LOW);
}
Final result:
Ultrasonic Ranger
After exploring the pressure sensor I started to look into the ultrasonic ranger. One particular thing I notice immediately is that to connect the ultrasonic ranger, we have to use the F/M jumper cables instead of the M/M ones. Then I followed the instruction to build the circuit.

Code:
#define echoPin 12
#define trigPin 13
long duration;
int distance;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
Serial.println("Ultrasonic Sensor HC-SR04 Test");
Serial.println("with Arduino UNO R3");
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = duration * 0.034 / 2;
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
}
Final result:
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?
I first chose the FSR because I think pressure is one of the most straightforward way to realize an analog input. By connecting the pressure sensor with a line of LEDs, the pressure can have a more direct and visualized way of presenting. Therefore I’m thinking of using this idea in elevators. We often experience the situation when an elevator is overloaded and beeps, so someone has to get out of it. If we can set a device to show the passengers’ weight, which is equal to pressure added to the elevator floor, and present it with LEDs showing the load degree, taking the elevator would be more convenient and efficient. To achieve that based on the simple circuit model, we might need to insert pressure sensors into the elevators’ floor and connect more LEDs whose colors can indicate the extent of load.
Question 2: Code is often compared to following a recipe or tutorial. Why do you think that is?
Because the whole program is following codes to run. The computer needs someone to tell it how to read the inputs and transform them into outputs that we want. Therefore we humans are writing the “recipe” or “tutorial” for a computer/program to learn and carry out its practice.
Question 3: In The 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?
I think computers are a complement to human intelligence. Human make computers do those regular but complex things so that human can save their time and gain more accurate analyses. Lifestyle is also different since we more often use computer for work and entertainment. For instance, we are used to typing words but more unfamiliar with writing by hand. One very thing stands out in my mind is the way computer changes human’s communication. The Chinese poet Mu Xin has once written that everything was slow in the past, the bike, the horse, and the epistle (云雀叫了一整天 n.d.). When there’s no computer, people can’t get in touch conveniently enough, therefore things were likely to operate in a low pace. But now computer and the internet enable human to communicate without time and location limit, with multiple media like videos and pictures for people’s reference. Some trends also emerged such as the decrease of face-to-face communication and an increase of sharing personal life online.
On the other hand, we are also developing negative behaviors with the popularization of computers. For me, chatting online makes me less willing to talk to people face-to-face. We also tend to be less healthy when spending more time in front of computers. No matter working, playing video games or just surfing online, people sit and look at screens all day long, which hurts different parts of our bodies. Students have worse eyesight and need to learn more about algorithms in school. More generally,
However, I do think that every coin has two sides. The key here is to make the best use of computers by us humans.
Works Cited
Bakker, Benne. “Force Sensing Resistor (FSR) Arduino Tutorial (3 Examples)”. Makerguides.Com, 2021, https://www.makerguides.com/fsr-arduino-tutorial/.
Jabbaar, Arbi Abdul. “Ultrasonic Sensor HC-SR04 With Arduino Tutorial”. Arduino Project Hub, 2019, https://create.arduino.cc/projecthub/abdularbi17/ultrasonic-sensor-hc-sr04-with-arduino-tutorial-327ff6.
Xin, M. (n.d.) 从前慢 (Chinese poem).