Jack Chen
Pcomp Project 3
Nov 23:

I took inspiration from “The Last Question” by Isaac Asimov – a short science fiction story published in 1956 about humanity’s inability to prevent the eventual heat death of the universe. I was blown away by the story’s ambitious setting along with its philosophical approach in exploring the limits of existence on a cosmic scale.
Using the skills I’ve learned over the semester I plan to create an interactive simulation of a universe, with the intention of evoking similar cosmic existential contemplations in the users as Asimov’s story did in me.
I am exploring the same idea for my ICM project so I have created a rough sketch so far with 3D particles:
https://editor.p5js.org/ukpfilms/sketches/-2x5c-b7Q

The structure of this project will have commonalities with my previous Pollock light drawing project in using serial communication to connect Arduino with P5. However, I am researching into potentially using Kinect this time for motion detection.
Dec 2:
In refining the interaction design, I decided to use a flex-sensor + accelerometer glove to control my universe simulation in order to give a more tactile interaction to the project. The idea is to have the flex sensor attach to a finger on a glove to allow the user to control the gravity/shrinking rate of the universe while an accelerometer on the back of the glove senses the hand rotation and use the data to change the rotation of the view of the P5 sketch.
After ordering the flex sensors, I tested it with my Arduino to make sure it worked in a circuit:


flex_sensor_arduino from Jack on Vimeo.
For the accelerometer I used the GY-521, which uses an I2C connection. Conveniently, there is already a tutorial online on how to set up the GY-521 with an Arduino, so I was able to integrate the accelerometer with the flex sensors in the same circuit once I had it set up.


(the diagram uses a different accelerometer but shows the same connections)
The next step is to setup serial communication between my circuit and P5 sketch. This uses the same technique as my previous project and labs on P5 serial communication, with the exception that this time I am transmitting 4 values instead of 1-2 between Arduino and P5. With Daniel’s help, I implemented a modified version of the P5 serial communication code into my sketch.
Once the circuit and the code from Arduino and P5 are set up correctly, I was able to console log the values coming from Arduino on P5 (xyz value from accelerometer and one value from flex sensor):

I am still working on attaching the Arduino Values to aspects of the P5 sketch, but in a test run I am already able to link the flex sensor value to the amount of ringed planets in my sketch:
flex_sensor_p5.mp4 from Jack on Vimeo.
What to do next:
To finish the project, I will have to link the Arduino values to the changeable aspects of my sketch (flex sensor changes rate of shrinking/gravity/size of planets, accelerometer changes the perspective). I will also need to construct housing for the circuit, which in this case will be a glove with the flex sensor attached to a finger and the accelerometer attached to the back. Once all that is finished, I plan to project the P5 sketch onto a wall in a dark room where users can put on the glove to control the universe.
One problem I need to solve or work around right now is that the current circuit/code only updates the sensor data form the Arduino about once a second. There is a delay function in the Arduino code which when removed, will cause the accelerometer to stop sending data. Receiving data at a rate of once per second will not be ideal since it will cause input lag when users interact with the project, especially when the P5 sketch already runs slowly on some browsers/laptops.