Don't wanna be here? Send us removal request.
Text
Project 3
I have been trying to drink more water. Everyone says that you need to be drinking more water than you think and it seems like water is the cure to every ailment. I keep a water bottle next to my desk, but oftentimes I will just forget to drink it. I will have my water bottle next to me, but just not drink for 2 hours when I am distracted by work. The goal of my project was to remind me to drink, but also to reinforce the value of water. I thought that if my project reinforces how important water is I will be more likely to drink it because I understand its importance.
What I ended up making was a coaster. When you place your drink on top of the coaster it activates a sensor inside. This sends a signal to the Arduino to start a timer. Right now my timer is set to 30 minutes. After that amount of time, the Arduino sends a message over the web to discord. This way I will get a message and a notification on my phone or desktop. This message reminds me to drink water every 30 minutes, but also the message has facts about the importance of water and about those who do not have access to water.
I thought it was important my project was more than just a drink reminder so I came up with the adding facts about water. One example is "The average woman in rural Africa walks 6 kilometers every day to haul 40 pounds of water." I have more of these facts and every time you a reminded to drink the message includes one. I thought this was a good way to not only remind you, but also reinforce how valuable water is and how we take it for granted. There are millions of people around the globe who do not have an easy supply of clean drinking water yet I am not able to remember to drink enough? I thought maybe if I had a better idea of what others go through to get water I might be more thoughtful of its impact.
When creating the project I ran into a few issues. First, when creating the capacitive touch sensor inside the coaster I would get a lot of false positives. The sensor would think that it is being activated when in reality nothing was there at all. I ended up fixing this problem by decreasing the tolerance and moving the pieces of foil I had used farther apart but is still not perfect. In the end, it does not take away from my project a ton though as the sensor still works and the worse case is you get an extra reminder to drink when you are not at your desk.
I also had some trouble with the notification system. My first problem was just connecting to the internet. When going over the wifi section in class I could never actually connect to the internet. My password and username were correct, but for some reason, I was not able to. This was a problem when I am trying to send a notification over the web. My first workaround was to remove the web component and just have the Arduino send a message through my desktop. I got a rough design working with Unity to play a sound at a certain time, but this did not feel great. You would only be notified if you were in Unity and it felt bad to have Unity open all the time. So I went back to connecting over the web and eventually figured out how to connect to my mobile hotspot. With this, I had an internet connection and there were already tutorials on how to connect a webhook to a discord server.



Code:
include "discord.h"
include
CapacitiveSensor cs_10_8 = CapacitiveSensor(10,8); String quotes[] = { "The average cost for water supplied to a home in the U.S. is about $2.00 for 1,000 gallons, which equals about 5 gallons for a penny.", "A person can live about a month without food, but only about a week without water.", "785 million people lack access to clean water.", "Women and girls spend an estimated 200 million hours hauling water every day.", "The average woman in rural Africa walks 6 kilometers every day to haul 40 pounds of water.", "Every day, more than 800 children under 5 die from diarrhea caused by contaminated water, poor sanitation, and unsafe hygiene practices.", "2 billion people live without access to adequate sanitation.", "One of the United Nations’ Sustainable Development Goals aims to provide universal access to clean water and sanitation by 2030.", "Over 2 billion people live in water-stressed countries, which is expected to be exacerbated in some regions as result of climate change and population growth.", "Globally, at least 2 billion people use a drinking water source contaminated with faeces. Microbial contamination of drinking-water as a result of contamination with faeces poses the greatest risk to drinking-water safety.", "Microbiologically contaminated drinking water can transmit diseases such as diarrhoea, cholera, dysentery, typhoid and polio and is estimated to cause 485 000 diarrhoeal deaths each year.", "In 2020, 74% of the global population (5.8 billion people) used a safely managed drinking-water service – that is, one located on premises, available when needed, and free from contamination." };
void setup() { Serial.begin(9600); connect_to_wifi(); discord_send("Hello World"); }
void loop() { long start = millis(); long total1 = cs_10_8.capacitiveSensor(30); delay(10); int scaled = map(total1, 0, 90000, 0, 255); if (scaled < 1000){ delay(1800000); discord_send(quotes[random(12)]); } }
include
include
const char ssid[] = SECRET_SSID; // Network SSID (name) const char pass[] = SECRET_PASS; // Network password (use for WPA, or use as key for WEP)
const char server[] = "discordapp.com"; const int port = 443; const String discord_webhook = SECRET_WEBHOOK; const String discord_tts = SECRET_TTS;
int status = WL_IDLE_STATUS; WiFiSSLClient client; HttpClient http_client = HttpClient(client, server, port);
void connect_to_wifi() { String fv = WiFi.firmwareVersion(); if (fv < "1.0.0") { Serial.println("Please upgrade the firmware"); }
// attempt to connect to Wifi network: while (status != WL_CONNECTED) { Serial.print("[WiFi] Connecting to: "); Serial.println(ssid); // Connect to WPA/WPA2 network: status = WiFi.begin(ssid, pass);// wait 10 seconds for connection: delay(100);
}
// you're connected now, so print out the data: Serial.println("[WiFi] Connected"); }
void discord_send(String content) { Serial.println("[HTTP] Connecting to Discord…"); Serial.println("[HTTP] Message: " + content); Serial.println("[HTTP] TTS: " + discord_tts); http_client.post(discord_webhook, "application/json", "{\"content\":\"" + content + "\", \"tts\":" + discord_tts + "}"); // read the status code and body of the response int statusCode = http_client.responseStatusCode(); String response = http_client.responseBody();
Serial.print("[HTTP] Status code: "); Serial.println(statusCode); Serial.print("[HTTP] Response: "); Serial.println(response); }
Sources:
Discord webhook: https://create.arduino.cc/projecthub/usini/send-a-message-on-discord-f216e0
Water facts: https://www.who.int/news-room/fact-sheets/detail/drinking-water
Arduino Documentation:https://www.arduino.cc/
0 notes
Text
Arduino Operation
My idea is similar to operation or a fishing game. The user will need to balance time and precision to win. A piece of yarn with foil wrapped around it is connected to an arduino. A soda can is also connected. The goal of the game is to lower the string down into the soda can to hook up some object (like a bottle cap) without touching the side of the soda can. By touching the sides a circuit is completed and an alarm is triggered and you lose! The implementation would be fairly straight forward. Using capacitive touch sensors we can check if the string is touching the soda can. We would then need to attach this to the arduino along with a speaker to let the player know if they lost. We could also code in a timer and track time to complete the challenge. The speaker could also be used then to let the player know they are out of time.
You can set up multiple cans for more challenges or have two strings two play against someone else. You could also increase the difficulty by decreasing the space for the string.
0 notes
Text
Project 2
I had some trouble coming up with an idea for this project, but eventually decided on combining the ultrasonic sensor and servo motor. I ended up creating a small experience centered around the idea of balance.
An ultrasonic sensor measures how far a person is. By moving away and towards the sensor a servo motor moves and arm back and forth. The goal is to balance a coin on the arm by just moving the arm with your body. In this way I tried to encompass the feeling of balancing something with your own body except the experience is now external. You no longer have direct control and have to try and use the arduino instead.
I figured the idea of balance was universal. Taking the idea a step further as a student you are trying to balance many things in your life, so my goal was to create a small reflection of that physically.
I had a few issues while working on this project. I see myself as more straightforward so creating a poetic experience did not come to me easily. I bounced around with a lot of different ideas, before landing on what I have now. I think in the end it does a good job of creating a poetic experience.
When building the system I had some issues with the ultrasonic sensor. For some reason I was not getting any input and ended up taking it apart multiple times trying to find the issue. Eventually I realized I was using the wrong resistor. After changing it out I was finally able to get a reading.
I also experimented with adding a capacitive sensor where the coin rests. My idea was to start and stop the experience if the coin is not on the arm. I tried using foil and some resistors to measure if the coin was placed on the arm, but I could never get the reading to be very accurate. The sensor would either think the coin is always there or never there and sometimes my hand or something else would trigger it. My final solution was to just slow the movement to make it easier to just place the coin. The variations in the ultrasonic sensor make the experience challenging enough still with the slower movement.
I also hooked my ultrasonic sensor up to processing to map the movement. This was probably the most challenging part. I went through multiple different projects to try and read arduino input on my PC. I finally landed on Processing as it worked right out the box and I was able to graph the users distance.
Video link: https://youtu.be/vOSW7lRcbXY



Arudino Code:
include
define echoPin 2
define trigPin 3
long duration; int distance; int pos = 0; Servo myservo; bool pause = true;
void setup() { pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); Serial.begin(9600); myservo.attach(9); } 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.println(distance); if (distance > 18) { myservo.write(95); delay(1); } else if (distance < 5){ myservo.write(88); delay(1); } else { myservo.write(93); delay(10); }
}
Processing Code:
import processing.serial.*;
Serial myPort; // Create object from Serial class String val; // Data received from the serial port int xPos = 1; float inByte = 0; float prevInByte = 0;
void setup() { size(400, 300); String portName = Serial.list()[0]; myPort = new Serial(this, portName, 9600); background(0); }
void draw() { if ( myPort.available() > 0) { val = myPort.readStringUntil('\n'); if (val != null) { val = trim(val); inByte = float(val); println(inByte); inByte = map(inByte, 0, 1023, 0, height); } if(inByte < 100){ stroke(127, 34, 255); line(xPos, height, xPos, height - inByte * 10); prevInByte = inByte; } else { stroke(127, 34, 255); line(xPos, height, xPos, height - prevInByte * 10); }if (xPos >= width) { xPos = 0; background(0); } else { xPos++; }
} }
Sources: https://docs.arduino.cc/built-in-examples/communication/Graph
https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing/all#introduction
0 notes
Text
Project 1: Blink
For this project I ended up making a small game of hot or cold. A random distance is chosen then the player uses the ultrasonic sensor to find the correct distance using the five leds. By moving your hand or another object the player can move back and forth to find the right distance. The leds will light up if the player is too far or too close. The goal is to light up the center led and not move for a few seconds. When the player finds the right distance a new distance is randomly selected and the player can play again. If the player can not find the distance they can flip the switch to choose a new random distance and try again.
My initial idea was to use the ultrasonic sensor as a mouse. My idea was you could move your hand back and forth and at the same time the mouse would move on the screen. By flipping the switch it would change the axis of movement, this way you could move the mouse in all directions by just moving your hand either forward or back. I scrapped this idea because it did not really fit with the theme of the project of blinking leds. I could not think of a good way to incorporate the led controls.
I then changed my idea to my current game and was able to reuse a lot of the elements I had already created. When coding the game an issue I ran into was spikes or variation in the measured distance. The ultrasonic sensor works well, but it is not perfect and your hand is never perfectly still. This means that the player would almost never line up with the exact distance. I did a few things in the code to get around this problem. My first solution was just to increase the range of accepted values. Rather than having the random distance and the player's distance from the ultrasonic sensor be the exact same it can be within plus or minus 0.5cm. I also coded a rolling average distance. I average the 5 most recent measurements together so small hand movements or inaccuracies by the sensor will not be as big an issue.
At this point it was mostly just wrapping things up. I already had the switch wired from my previous idea so I made it a reset switch for the game. I then needed to wire all five leds. I was able to use only one resistor by wiring them all to ground together behind the resistor. This created a problem though, when any led is turned on it means the others become less bright. I avoided this problem by only ever having to leds on to show the distance.




Code:
Documentation:
https://www.arduino.cc/reference/en/language/functions/random-numbers/random/
https://create.arduino.cc/projecthub/abdularbi17/ultrasonic-sensor-hc-sr04-with-arduino-tutorial-327ff6
0 notes
Text
For this assignment I added another switch. The first switch still turns on or off each led. My other switch makes one led blink and dims the other led. My original idea was to use a dial to dim both leds however, I could not figure out how to wire it. I tried treating it just like a switch, but I could not receive any input. I then decided to use a switch instead since I knew that would work. I ended up being able to change the brightness level of an led using analogWrite and having a low value to decrease the brightness. This only worked with one led. I then decided to have the other led blink instead.
Code:

Resources:
Fade:
https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fade
Button
https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button
0 notes
Text
KIDS Exhibit/Game/Film by Michael Frei and Mario von Rickenbach
You may have seen the above gif before. It has been in a few popular posts around the internet in recent years. When I first saw it I thought it was small animation and nothing else, however when looking at digital tangible art I saw a post and recognized it. It turns out to be more than a short gif, but a combination of art, game and film.
The gif comes from an interactive animation called KIDS by Michael Frei and Mario von Rickenbach in 2019. Rickenbach is a game designer from Switzerland where he currently teaches. Frei is a Swiss animator who has worked on other interactive and digital art and film. They previously worked on a film/game called Plug and Play. KIDS was made in Unity and can be played on almost any platform, but was also presented as a standalone film and an exhibit.
The animation is made up of crowds of faceless characters. The game page describes it as “KIDS allows you to move with and against crowds until everyone is gone.” The lack of defined purpose leaves the meaning up to interpretation. However, the audience's experience very much depends on the medium it is interacted with. Frei says, “it is interesting to observe how the project gets viewed differently by the context it is shown in. When I stick a tablet to a wall in an art gallery, people contemplate it. When a gamer downloads it for 3 dollars, she or he either gives it a thumbs up or thumbs down, and if I am lucky the game gets an insightful review. When an audience at a festival sees the film they clap and sometimes compliment me on the quality of the sound mix after the screening”. It is very interesting to see how the same work can change depending on how it is presented. From my own perspective I first saw it as only a gif which is very different from a piece in a museum. The different mediums play into the different experiences it can create for the viewer.

KIDS was first showcased at the Museum of Digital Art in Zurich a week before its release. It was presented as an exhibition showing off the interactive animation combined with images and characters from the project created in real life. They then went on a small tour presenting to different small communities around the world. The film was shown in a few different film shows before being released worldwide along with the game. I would imagine that the experience created would vary drastically based on where you see the same work. A museum or film show creates a more immersive experience with an audience undivided attention.

Sources
https://www.shortoftheweek.com/news/michael-frei-kids-game/
https://muda.co/kids/
https://variety.com/2019/gaming/news/kids-launch-1203226585/
https://ars.electronica.art/outofthebox/en/kids/
https://playkids.ch/#
https://michaelfrei.io/
https://mariov.ch/project/kids
1 note
·
View note