Liquid Light — PComp Midterm

For our midterm, Yeseul Song and I decided to play with gyro sensors. We had many ideas of what we wanted to create, starting with a pen that you can draw in 3D space. We then saw that VR controllers already play with this concept, so we decided to go in another direction. I liked the idea of a pen in 3D space, so I will probably revisit this idea in the future.

Yeseul and I decided that we wanted to use the gyro to play with light. The major reason I came to ITP was to learn about building light structures, so this was a great opportunity to learn how to program LED pixels with raw data from a sensor. Little did I know how complicated the gyro sensor would be!

We decided that we were going to hook up a gyro to LEDs and shape them into a cube. We would then program the LEDs to act like how water would act in a cube.

We first hooked up the gyro to test what kind of data we would get out of the sensor (GY-521). Connecting our gyro to our Arduino, we saw that we got seven values from our sensor: an X,Y,Z coordinates for the gyro, an X,Y,Z coordinate from the accelerometer, and a temperature gauge. I built a simple p5 sketch using WebGL in order to pull the values from the serial communication to visualize how the XYZ coordinates of the gyro worked.


Once we got the p5 sketch to work, we connected our gyro to a Adafruit NeoPixel strip and wrote Arduino code to make the light travel the strip as we moved the gyro sensor.


With our gyro interacting with our pixel properly, we began to solder some pixels together into the shape that we wanted, as well as developing an algorithm to imitate water.


The algorithm to imitate water proved to be very difficult. We first created a p5.js sketch to illustrate the effect we wanted on a canvas. However, translating this canvas to a strip of pixels proved to be very difficult. After hours of debugging, we finally realized that it would be easier to think about the strip of code as a graph, and that the preliminary effect we wanted our lights to imitate was similar to y=mx+b on a coordinate system.


This breakthrough helped us develop our algorithm for how our gyro could interact with our LEDs in a 2D space. Once we had our lights working in a 2D space, we could extrude the LEDs into 3D space by using the gyro Y and Z coordinates.


Unfortunately, we ended up running out of time to finish a complete project, but we definitely learned a lot in building this concept. We had a ton of practice coding and debugging our Arduino, as well as developing p5.js sketches to help us visualize what we were trying to do. I was happy that we got to use LEDs, as it was a major interest of mine coming into ITP. Here is our final concept for our midterm.

I look forward to completing the cube and developing the algorithm for the z coordinate as well. I will update this blog in the future with our final product.

For more photos/videos regarding this project, check out the flickr page here. Code can be found here.