This week, we were given the opportunity to use different sensors to gain new understanding of how Arduino code works. Having learned about map () as well as if else functions during the lectures, this recitation offered an opportunity to apply learnt knowledge into action. I decided on using the soil moisture sensor for the recitation as I was interested in using water density to control other components of the circuit, in which I used an LED light as the dependent component.
For the circuit, it was quite simple, having connected a sensor to a standard light circuit. Programming the Arduino was slightly more difficult as I had to apply past knowledge and combine it together to create a circuit. I didn’t use map () in the program as I found it unnecessary and the end result was successful without the usage of map().
I created the light to create light output when the moisture felt is high where a video will be shown to illustrate how the sensor works. In addition, a circuit diagram will be put down as well.
Now, I will refer to the three questions. For question 1, I intended to assemble a circuit where the light’s output could be controlled by the level of moisture experienced. Hence, I used a soil moisture sensor along with the standard light circuit to create this combination. I felt that this was a pragmatic combination which could be applied and used in the real world by gardeners and farmers. Gardeners and farmers could use this to maintain the level of water for plants by not overwatering plants or underwatering them to elevate the efficiency of plant growth as well as maintain conditions for keeping plants alive. This would help yields for farmers and for gardeners, it would help them maximize cultivation.
For question 2, I think that code is compared to a recipe or tutorial because steps must be followed precisely for the intended output, and if overlooked, it may cause different results. Such an example can be observed in the if else function of code. When the condition of (if) is fulfilled, it will provide x as the result, but if the (if) condition isn’t, it will provide y as the result. Likewise, if eggs whites aren’t separated from egg yolks when baking a cake, it will cause variation in texture and rise of the cake. If the recipe is followed precisely, it will yield the precise result. Another example is the order of following the recipe and the order of code. Void loop (){} cannot be completed first before Void setup(){} has been processed. Likewise, a cake cannot be baked if the mixed solution hasn’t been produced yet. The last example would be that if variables in the code } or ; are forgotten, it would cause errors in the code where it cannot be processed. Likewise, if sugar is forgotten in a cake, it would produce a strange product without taste. In this sense, code is like a recipe where order and precision matters.
For question 3, I believe that computers influence human behavior in three main ways being: psychologically, physically, and mentally. I will start off by explaining their influence on humans physically. Prolonged computer usage has caused humans to shift their posture. Humans nowadays have a physical tendency to have “forward head posture” due to constant usage of computer usage (and digital devices). This shifts the physical behavior of human muscles to shift forward.
Next, computers also influence human behavior psychologically. As computers are essentially products that reflect light, it affects the consciousness of our brain where our alertness system can be affected. For example, viewing computers before sleeping causes our brain to become alert, altering the inactive state of a brain at rest to become active. This in effect changes human body behavior in terms of alertness.
Lastly, computers also affect human behavior mentally where our dependence on them has shifted our independency to become dependent on the device. When researching, modern human behavior is to seek digital sources to learn. When calculating for math, human instinct has become to use a calculator. It can thus be observed that our instinct, a key factor of human behavior, has thus been altered to be in a dependent state.
Coding used:
#include <Servo.h> int sensorPin = A0; int sensorValue = 0; int ledPin = 13; void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { // read the value from the sensor: sensorValue = analogRead(sensorPin); if (sensorValue > 400) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } Serial.print("Moisture = " ); Serial.println(sensorValue); delay(1000); } Work Cited:
Zuo, Baozhu. “Grove – Moisture Sensor.” Seeedstudio, wiki.seeedstudio.com/Grove-Moisture_Sensor/.
Leave a Reply