1. the device we are doing on the recitation session is a device that can detect the rise and fall of your arm and give a certain reflection on the computer according to the coding. my assignment is to make such a device and write code according to the instruction. we hope we can learn how to write certain code and how to build our device by ourselves.
2. the first assignment was to solder the sensor to two wires. it was my first time using the solder machine on my own. it was difficult because it was hard for me to hold the two ends together. also, the smoke kept coming to my eyes and it was uncomfortable. but in the end, I succeed. from this experience, I learned to fix the two ends to the cardboard before soldering them together.
3. the next assignment was to build the circuit. at first, I didn’t recognize the picture of the circuit because it is not the same as I used to see before. but then, after reaching for help from the learning assistant, I figured out what each component means. then I connected them. but the Arduino couldn’t be connected to my computer. so I asked another learning assistant, Christine. and she told me that my circuit is a short circuit. so I unplugged several wires that leads to this situation. after that, my Arduino was connected to the computer. by doing this project, I learned that we should always check out our circuit to find whether it is a short circuit. and always reach out for help when there’s something wrong with your circuit.
4. the third assignment was to copy and paste one of the codes to the Arduino IDE to test whether the circuit is working well. this assignment went go very well. I managed to do it with no difficulties.
5. the next step was to wear my sensor. at first, I didn’t know how the sensor works so I lifted up my arms in a small range, so the number doesn’t change as I wished. then I tried and succeed in figuring out how the sensor works. then I moved my arms in a bigger range and the number changed as wished. from this, I learned to figure out how things work before trying to make that work.
6. the next task was to edit the code so that when the arm is down, there will be no number there. at first, I didn’t know how to add an “if” to the code. then I asked one of the professors, professor Gati. he told me that I should print two = to make the computer understand that I was not giving it a value. so I tried again and I succeed. in this assignment, I learned the difference between one = and two = and know how to use them to achieve my goals.
7. the next task is to make the computer add a number every time I lifted and lowered my arm. I first forgot to declare a variable so I couldn’t upload my code to the computer. then I found out about this mistake and declared this variable. through this task, I learned to check every step of the assignment before actually writing the code. I also remembered to declare every variable before making use of it.
8. the next task was to set a limit to the number it can count. first, the limit was 8 and then it was 16, 24. at first, I didn’t know that to make the computer print a sentence, I need to use “”, so the code can’t be uploaded. then I asked Iris for help and she told me about my mistake. so I mended it. then it worked perfectly. I learned to put an “” every time I make the computer print a sentence.
9. the next assignment was to design where else this device can be put on. what I thought is that it can be used to count the number of sit-up one did if it was put on the belly of the tester. this taught me to think about the practical use of a device once it was designed.
int SENSOR_PIN = 2;
int tiltVal;
int prevTiltVal;
int count;
void setup() {
pinMode(SENSOR_PIN, INPUT); // Set sensor pin as an INPUT pin
Serial.begin(9600);
}
void loop() {
// read the state of the sensor
tiltVal = digitalRead(SENSOR_PIN);
// if the tilt sensor value changed, print the new value
if (tiltVal != prevTiltVal) {
if (tiltVal == 1) {
count = count + 1;
Serial.println(count);
if (count==24){
Serial.println(“yay, you’ve done one set of curis”);
}
}
prevTiltVal = tiltVal;
}
delay(10);
}
10. the value will show high if the device inside it was tilted over. I noticed that it was very sensitive. I don’t need to do anything too violent to make the value change. if I rotate my arm, the value will also change. if I shake it, it will also change. if I hold the wire several centimeters away from it and tilt it, the number will also change. I think it is too sensitive to be used on people. but I do think it can be used on sensitive machines.