JESSIE ZHAI

Digital artist

A documentation page of rambling and experimenting.

@jessiehaseyes
jessiejiranzhai@gmail.com
MIDTERM
PCOMP WEEK5


Physical Computing
MIDTERM
DISTANCE SENSING LED TREE


Idea Development

Tina and I started conceptualizing the project with thinking about our Asian heritage, which brought us to the idea of using paper lanterns to create light effects that might bring a feeling of nostalgia. We went through a couple to narrow down our ideas:

  1. We wanted to create a tree with paper lanterns that are lit up by LEDs and changes color corresponding to certain measures such as distance, weather, sound etc.
  2. Tina’s professor Yeseul suggested we , while Danny and my classmates suggest to add noise or different modes so there could be more animation/movement rather than the lights just staying at one color.make the tree to be weather responsive (linking open source weather API to arduino)
  3. Jess, the pcomp resident, helped us solidify our idea. she told us about:
    1. using the adafruit neopixels as LED source because they can be programmed with RGB values
    2. the basic outline of how our circuit would be connected, what labs to look at, and how the lights would function
    3. the order of the steps to take, such as placing the LEDs on the tree before soldering, then testing, and fabrication last.
  4. Tina’s professr  suggested we use a temperature sensor instead of API since that might be a bit harder to do.
  5. fifth iteration - at an office hour with tom igoe, he also told us to simplify our idea and to start out by testing a sensor first and going from there, based on how comfortable we are with circuiting and programming it. he also cautioned us against the difficulties of working with a temperature sensor
  6. after meeting with Tom and ran through our idea with him, we purchased the necessary materials to begin putting together our project

Notes that we gathered during the first stage of our project:

how it works


mid-journey generated image as part of our ideation process

weather-responsive - lanterns will display certain colors in the morning based on weather of the day so user can dress and prepare accordingly; colors will oscillate to add aesthetic interest

*update 10/09 - was told by Tom Igoe that API might be too much; thinking about using temperature sensor instead

components needed

  • arduino - to process sensor input and control led lights
  • temperature sensor - interactive portion; for turning on/off
  • nanopixel leds - inside clouds to create dynamic lighting effects

setup

  1. sensor placement - distance sensor can be placed on the top or outside of the lantern to accurately detect motion
  2. wiring - connect distance sensor to the digital input pin on the microcontroller; connect leds together in one string to one output pin
  3. programming - write a function that reads the distance sensor’s digital value. the brightness of the led’s will be controlled using pwm for smooth transitions. weather data will be collected from an api & lighting effects will be controlled by programming individual rgb values
  4. behavior
    • in the morning, leds will display a color based on the high temperature of the day.
    • light can be turned on & off by waving hand over it


Prototyping




ToF Sensor

While Tom showed us two temperature sensors at the shop, but neither of them were available when we checked. So we qucikly switched our direction and stated with a time-of-flight sensor instead.  In her own words, it wook Tina a painful amount of time to get it to work but it was able to detect the distance between the sensor the object in front of it.

NeoPixels
At the same time, I was testing out the NeoPixel LEDs that we got from Adafruit. With Jess’ help during the PComp help session, I was able to connect three LEDs in a serial order and adjust the RGB values to give it different colors. I used the aligator clips first to avoid soldering them together intitally. One thing that was really helpful was that the NeoPixels have arrows on them which indicated the direction of the flow of data, so all I had to do was to follow the arrows and connect the dots. 




It’s really exicitng to use a RGB LED lights, and seeing how the code changes the color of them was such a treat. I used the code provided in the Adafruit NeoPixel library and set up the basic LED circuit. I also tried to changed the colors from RGB values to HSV to test out using different brightness of the lights.



After we each worked through different problems. Tina and I worked on combining the sensor and LEDs into one breadboard. then, we tackled the programming. We tested various different interactions and effects:


  





test 1: displaying red, green, or blue based on distance from sensor
test 2: increased to display 5 colors instead of just red, green, and blue
test 3: changing brightness of LEDs based on distance
test 4: a “beating heart” effect where the “heart beat” got faster the closer you are to the sensor

Code:





Fabrication

Once we figured out the basics of connecting and controlling the LEDs, we decided on how to arrange the LEDs on our tree. this was especially important because one of the great features of working with neopixels is that you are able to chain them together and use only 1 pin to connect to your arduino; the drawback, however, is the direction your wires go is extremely important to ensure all the LEDs both function well and are easily visible on the tree.




after we were relatively happy with the placement of our LEDs, we started soldering wires to the LEDs and figuring out an efficient way to connect them while still keeping the wires neat against the tree. after much back and forth because we completely forgot each LED would need 6 wires connected in total, 3 coming towards it and 3 going away. We braided the wires to make wrapping it around the tree branches easier, and we tried it out with 3 LEDs. after finalizing our wire placement, we gave soldering a try. We eventually got the chain to light up and respond to the arduino!

  



Finishing touches

last components to complete our project were fabrication aspects and presentability. some issues we came across were:
  • best way to present the t-o-f sensor
  • how to make the breadboard a part of the project in an aesthetic way
  • other visual additions like spider webs, critters, and mini rolls of toilet paper
  • building the platform to place the tree on and encase all the parts - required us to learn laser-cutting 

I laser-cut a 7x7in platform to house the breadboard and wiring and we glued the pieces together. then, Tina wired the breadboard to the tree through the acrylic platform and created and installed a switch to allow users to experience different modes of lighting. 









Final Code


 
 


Final

Finally we added all the other decorations and completed the project.

 
JESSIEZHAI