Project 2: Breathing/stress reliever balls
I worked on this project with En Tong. It was great to have someone to bounce ideas off. This is a stressful time for everyone, and we all need to take better care of ourselves. Our main goal of the project is to make something that assists people to breathe better and relieve some stress.
From brainstorming, we thought about the breathing ball toy for kids and stress ball (see pictures above). From there, we wanted to incorporate those two elements in our product. We started to think about how to incorporate the motion for squeezing balls to assist breathing.
At first, we thought about games, like making bubbles burst and hate the circles to make a melody, which led us to drift away from our initial goal of the project. It helped us uncover some good inspirations by questioning our product, like how we could use visuals to assist people to breath, and does it make sense to combine squeezing stress ball breathing. After doing more search and asking some people on the floor, it helped us to finalize on our ideas.
We want to put the force sensing resistor into a cotton ball to create the stress relieve ball, so we tried it out (see above picture and video). It worked! Then, we made a simple visual (see below). The green circle is controlled by users. As users press it harder and harder, the circle grows bigger and bigger. The blue circle expands and shrinks by itself. The goal is to synchronize both circles, so you breath and squeeze at the same pace. There will also be singing bowl sound added, which will also be controlled by force sensor.
Lab
Goal: Send data from multiple sensors to a program in P5.js. I’ll use the data from the sensors to create a pointing-and-selecting device (i.e. a mouse).
I used two potentiometers and a button to complete this lab (see Figure 1).
Figure 1
After I made sure potentiometers and button worked by printing out the values in serial monitor, I wrote the code following the lab (Code: https://editor.p5js.org/Jenny-yw/sketches/RYSrx3z6_ ). The button can make the circle appear and disappear on the canvas, but circle keeps flickering regardless how I rotate the potentiometers. I wasn't sure why that happened (see Figure 2).
Figure 2
Flow Control: Call and Response (Handshaking)
Sometimes there's a problem when the sender sends faster than the receiver can read. Flow control can help with that problem. The simplest way to do this is using a call-and-response method, where the sending program only sends when it'd told to do so. So, I added the if() statement to Arduino code, and this is what I see on the serial monitor (see Figure 3). As I type different characters in the output box, it shows different values.
Figure 3
After I modified P5.js sketch according to the lab, the circle is behaving normally now (video 1)! The serial communication is managed much better through the flow control because Arduino's only sending when P5.js is ready to receive.
Video 1
Comments