• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Anna Gudnason

Uncategorized

Pcomp Final Project

December 12, 2018

Messy wires from my tilt switch sensors

Physical Computing Final Project

Overall, my project ended up working, but not exactly the way that I wanted it to. My biggest hurdle were my tilt switch sensors and the hard, stiff wiring that I soldered them too. This prevented the flexibility and sensitivity I ultimately needed from the sensors to detect movement from the tubes. Overall, the code and sensors worked, some tubes just had a hard time picking up the motion, while others were more sensitive. Also, it is way harder to not only work, but also fabricate a project that hangs! I have learned my lesson.

I was unable to have enough time to get the serial communication to work properly so that the sensors that already trigger the LEDs would also trigger a byte to send to my P5 sketch and call the sound. The code was taken from Danny Rozen and can be found here.  At first it would not read binary, but ASCII. I was using the p5.serial control, but when I selected my port (/dev/cu.usbmodem14201), It would keep switching back to Bluetooth instead. I was able to play the sound files from the P5 sketch by themselves, so I knew they worked. My problem was getting the Arduino code to send the proper byte to my P5 when the sensor reached one. 

With Arduino, I tried:

byte byteToSend = 1;
Serial.write(byteToSend);

But I was confused where to put this code. When I put it within the code below, twice with different numbers 1 and 50 so I could track where it was reading the bytes, it only caught the 50, but not the 1. I feel like there is something wrong with my states in sending the proper change to trigger the sound, but what makes me confused about that is if I had something wrong with my states, then the LEDs shouldn’t respond to the tilt switch sensors?

At the end, I had didn’t have enough time and had to focus on the sensors.

Below is a video of my frustrations and confusions with working with a hanging project and my stiff wired sensors that failed to be sensitive enough to hand movements.


Code Code Code:

Previously Documented Progress of How I Got Here:

Code Set Up:

First, I needed to include the FastLED library I would be using to program my LEDs to the sensors I was using as well as define the number of LEDs I wanted to program, which was 39 in total:

#include “FastLED.h”
#define NUM_LEDS 39

Then, I wanted to program the microcontroller to read the tilt switch sensors. I only cared about the sensor being off (not touched, 0) or on (touched, 1) – two states. In order to do this, not only would I need to know the current state of the sensor but also remember it’s previous state – it’s state change detection. I would have to set up 6 global variables to store each of the six tilt switch sensors state detection:

int lastSensorState1 = 0;
int lastSensorState2 = 0;
int lastSensorState3 = 0;
int lastSensorState4 = 0;
int lastSensorState5 = 0;
int lastSensorState6 = 0;

I also wanted to set up some other global variables such as hue, counter and LED state that would relate back to the LEDs later in my code:

int hue = 0;
int counter = 0;
int fadeIncrement = 1;
int LEDstate = false; //rest state
CRGB leds[39];

Now for the set up of my code, I needed to link each pin on my microcontroller to an input:

void setup() {
FastLED.addLeds<NEOPIXEL, 6>(leds, 39);
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(7, INPUT);
pinMode(8, INPUT);

Then I needed to link each of these inputs to one of my six sensors:

void loop() {
int sensorState1 = digitalRead(2);
int sensorState2 = digitalRead(3);
int sensorState3 = digitalRead(4);
int sensorState4 = digitalRead(5);
int sensorState5 = digitalRead(7);
int sensorState6 = digitalRead(8);

Linking LEDs to the Sensors:

Now that I had everything set up in my code, I wanted to then link each of the six sensors to a certain number of individual LEDs on my strip, which would create a tube on my wind chime. I needed to make sure that my code would read the sensor, check the current sensor state against it’s last state and then save that current state of the sensors in a variable for the next time the code loops. Then I would know if sensorState is not equal to lastSensorState, my sensor has changed.

I also wanted to create an LEDstate to make it easier for me to code that if the sensor state was on (1), then that should trigger my LEDstate to be true, meaning that my LED also had two states depending on the sensor state. If my sensor state was on (1) then it would trigger my LEDstate to display a certain pattern (in this case a rainbow movement). Otherwise, if my sensor state was off (0) then my LEDs would continue their blue/violet glow.

//////// TUBE 1 ////////
if (sensorState1 != lastSensorState1 && sensorState1 == 1) {
LEDstate = true;
} else {
  LEDstate = false;
}

I also wanted to set up a counter so that my state change and LEDchange into the rainbow pattern would only last a certain length of time. I would also program a certain number of LEDs to be affected by this sensor change and LEDstate (which was the number of LEDs in tube 1 or any tube linked to that sensor).

if(LEDstate){
 for(counter=0; counter<100; counter++){
  for (int i = 1; i < 10; i++) {
   leds[i] = CRGB::White;
   FastLED.show();
  }
  LEDstate = false;
 }
} else {
   for (int i = 1; i < 10; i++) {
    leds[i] = CRGB::Blue;
     FastLED.showColor(CHSV(hue++, 255, 255));
  }
}
lastSensorState1 = sensorState1;
}

I wanted to get the sensors linked to the LEDs properly before I then properly coded the colors that I wanted. In this case above, I set the colors of the LEDs to be either white or blue to signify clearly if my sensors were triggering my LEDs properly.

Below is a video of me doing a simple sensor state detection with the tilt switch sensor and LEDs using the serial monitor to track my sensor state on one tube only:

Color Tuning the Code:

HSVHue { 
HUE_RED = 0, HUE_ORANGE = 32, 

HUE_YELLOW = 64,  HUE_GREEN = 96, 
HUE_AQUA = 128, HUE_BLUE = 160, 

HUE_PURPLE = 192,  HUE_PINK = 224 
}

Looking at FastLED’s Hue color code, I know that I only want half of this color spectrum (blue, purple and pink) so my hue should only be above 128, which would cut out the colors I did not want.

Now, this may not be the cleanest way to write out the code, but I knew that instead of of the hue being hue++ along 0 to 255, I wanted hue to go back and forth between 128 and 224. Start at 128 and go up each increment, then at 224, go down each increment and repeat. So I created a global variable for the direction of the hue called direct and put it in an if and else if loop. I also made the global variable hue start at 128.

FastLED.showColor(CHSV(hue+=direct, 255, 255));
if (hue < 128){
direct = 1;
} else if (hue > 224) {
direct = – 1;
}

Circuits:

Now I had to figure out how to organize all my tilt switch sensor circuits…

Messy wires from my tilt switch sensors

Trying to organize my circuits from the sensors

I also tried to diffuse the LEDs more by adding bubble wrap to the tubes, but making enough room for the sensors to be affected by movement and touch of the user.

Filed Under: Uncategorized

Fabrication – Motors

December 12, 2018

Materials

I built a clock using wood with a minimalist design.

I didn’t want to put numbers because personally I prefer clocks without the numbered interface and like the clean design instead. I thought it would also highlight the texture of the wood and ring design and patterns on it.

 

I ended up cutting the hour and minute hands because they were too big for my piece of wood, but also I didn’t like the design of the ends and I think removing them makes the overall clock look cleaner.

 

MATERIALS:

Materials

Wood (Blick)

Drill

Drill Bit

Clock Parts (From Amazon)

Scrap Wood

Clamp

 

Drilling the wood

Clamping the wood to be drilled with scrap wood.

 

Clock Assembled

assembling the clock bits onto the wood.

Filed Under: Uncategorized

Fabrication – Two Materials

December 5, 2018

Inspiration Quote

Inspiration Quote

 

Cages have both restrictive and protective functions depending on how they are used. Many belief systems and religions believe the bird cage to be symbolic of the soul. Carl Jung expressed this thought through the sense of a caged spirit. I wanted to create something fabricated with a symbolic meaning to our culture today, expressed in a form of a modern art piece.

Inspiration:

Bird cage installation in Sydney, Australia

Birds singing in Southeast Asia:

 

I got rope from Home Depot and black feathers from Amazon. I wanted the feathers to symbolize the presence of a bird, but also the absence of it. This didn’t come out exactly the way I wanted it to and maybe if I had more time I would have wanted to put in a speaker for bird sounds to come out from the feather/bird cage. 

Fabrication

Filed Under: Uncategorized

Pcomp Final – Basic User Testing Prototype

December 3, 2018

Fabrication of wind chimes - using the bandsaw

Fabrication:

I bought the rest of the necessary materials for my project so I could complete the rest of the wind chimes and start properly user testing a first version of my project. This included buying more acrylic tubes from Canal Plastics and using the band saw to cut them down to pieces in ascending length. The largest piece being 30 cm long with the smallest piece being only 10 cm. I ended up having enough extra acrylic to make an extra tube, having six instead of five tubes.

Fabrication of wind chimes - using the bandsaw

I then used the drill press to make two holes on the top of each tube in order to hand them. The hole was 1 cm down from the top on each tube using a 1.58 mm drill bit.

Fabrication of wind chimes - Drill Press

The final product of all the tubes cut to the proper length with holes, ready to be assembled and hung:

Acrylic tubes for the wind chimes

 

Circuits, Soldering & Sensor Testing:

 

Sensor Testing:

I started with hanging one tube and attaching the LED strip with the tilt switch sensor to sensor test the tube being hit or touched by the user:

I was getting a sensor read, not much, but I think this should hopefully be enough to work? The sensor was going back and forth between 1 and 2. I will have to spend more time figuring out how to successfully integrate the code of the LEDs with the sensor to fully test this out. 

Soldering:

I decided to first focus on getting the wind chimes together and start with soldering the LED strips in series for each of the six tubes before I then added the sensors. GND was the black wire, DIN was the white wire and power (5V) would be the red wire.

Soldering LED Strips for Wind Chimes

 

Soldering LED Strips - Part 2

The soldering took a while, it was hard to get the wires to the strip properly because the space was small and the wires tended to stick up. Finally, I assembled the long soldered LED wires within the tubes (seen below). 

Wiring LEDs in tubes

The wires I used to solder the LED strips together is not as flexible and extremely stiff. My worry is that they may restrict the movement of the tubes (along with not making the wind chime look as sleek as I would like it).

Below is a basic concept of how the wind chimes will look without the sensors. I also tried creating a stand for the wind chimes, but it didn’t come out sturdy enough to hold the weight of all the tubes. Having the tubes hanging rather than lying down on the table makes it easier for me to work with adding the LEDs and sensors.

Now that I have the LEDs wired in, I’m focusing on adding the sensors in. I also soldered the tilt switch sensors to longer wires so I could attach them to each tube individually.

 

Soldered Tilt Switch Sensors

 

Code:

Before I figure out how to code the LEDs and the tilt switch sensors, I tried writing down everything I wanted to implement code wise:

Pseudo Code + Diagram

I know that I want all six tubes to share the same light patterns of a slowly changing rainbow hue:

#include “FastLED.h”
CRGB leds[39];
void setup() { FastLED.addLeds<NEOPIXEL, 6>(leds, 39); }
void loop() {
static uint8_t hue = 0;
FastLED.showColor(CHSV(hue++, 255, 255));
delay(100);
}

(Code above is what I want the wind chimes to be without any user input – a slowly changing gradient of rainbow colors)

I have 39 LEDs and 6 sensors, with each of the six tubes corresponding to a certain number of specific LEDs on the strip and one of the six sensors.

What I need to do is break up the LED strips into six parts that correspond to a tube and sensor and define it in the code. I think I need a boolean value for my sensor because I only care if the sensor read is off (not being touched or hit) and on (user touching or hitting the tubes).

So, if my sensor value is off, all LEDs should display code above (slow rainbow gradient)

else, if any of the six sensors detect a change, the LED’s will have a different color pattern ONLY for the specific LEDs allotted to that sensor and tube. This change will last only for a few seconds before returning back to it’s original state. I’m hoping this will make the user feel the need to interact with the wind chimes in order for there to be any response that will trigger a back and forth interaction. The user is acting as the wind. 

I want the change in LEDs to be an energetic up and down of each individual Neopixel movement to almost mimic the touch of the user. I think I want to also code it so that if all sensors are on, a change is detected, then all LEDs are triggered into a third different color pattern.

As the initial code stands now (above), I’m coding all the LEDs at once and instead need to break them up and control them in six groups.

Starting with the first tube, I need to control LEDS 1 – 10. Ignoring color for a moment, I’m thinking the code needs to look something like this:

if (sensorVal == 1) {
for (int i = 1; i < 10; i++) {
leds[i] = CRGB::White; FastLED.show(); delay(30);
    }
  }

else, keep doing original color.

Filed Under: Uncategorized

Physical Computing Final Project – Updated Protoype

November 28, 2018

BOM for Windchimes

Bill Of Materials:BOM for Windchimes

Unfortunately this project has ended up being more expensive than I originally planned (mostly because flex sensors are expensive!) Because of this, I have bought enough to recreate one of the tubes with a flex sensor to make sure that the prototype works before buying all the materials.

 

System Diagram:

System Diagram - Addressable LED strip divided into 5

I played around with the fast LED library to get a sense of working with LED strips as well as the circuit.

Working with addressable LED Strip

I then soldered my own LED strip that I received in the mail from Adafruit.

Soldering LED strip

And then drilled holes in the acrylic tubes to hang them with clear string.

Acrylic tubes fabrication

Acrylic tubes fabrication part 2

I am still unsure of how to completely fabricate and wire all the sensors with the LEDs because the hanging tubes make it harder. I’m also not sure if Flex sensors seems to work, but I’m not exactly sure how to test them (mostly because I’m not sure if I’m wiring it correctly with the hanging tubes).

Hanging tube with where the flex sensor would go

Would tilt switch sensors work better?

Filed Under: Uncategorized

Fabrication – Enclosures

November 27, 2018

Box

This week I made a simple enclosure. I got my box base from the container store, my black acrylic from canal plastics and my red button from tinkershpere. I measured the diameter of the button and box to create an illustrator file for an “end of the world box”.

 

Box

illustrator

End of the world box

Filed Under: Uncategorized

Pcomp Final Project – User Testing

November 14, 2018

Wind chime prototype

This week, I made a very base prototype of my project idea for the LED wind chimes. 

Wind chime prototype

Questions and observations I hope to get out of tomorrow:

  1. Does the user immediately understand what the object is and if so, do they use their pre-conceived notions of interaction with this object to interact with it? Or do they see it as some sort of abstract object they do not know how to interact with?
  2. What are the user’s first move/interaction with the object? How do they touch it? Gently or aggressively or maybe not at all? 
  3. How long do they interact with the object? Once? Twice? Repeatedly?
  4. What are the user’s reactions to the object (both physically and emotionally).
  5. Are there any observations of the users actions that I did not expect? How does this change my idea of the project?

 

 

Filed Under: Uncategorized

Working With Laser – Fabrication (In Progress)

November 13, 2018

prototype 1

This week I set out to make a polyhedra out of reflective acrylic. I made two prototypes to understand the shape and exactly what needed to be cut out and shaped. It was ambitious and after a while I decided not to go along with it for this project because of timing. I still want to make it, but I will take more time to fully think out the implementation.

Prototype 1

prototype 1

 

Prototype 2prototype 2

 

So I changed my idea to work with the other materials I had from Canal Plastics. I tried to make a hanging window art mosaic like piece with triangles of different colors with a design pattern. I learned that the guides for the laser cutter are really just a starting base and not accurate for what you may need.

 

For my first try, the laser did not cut through the triangle completely, so I ran it again, but it cut it slightly off (even without me moving the acrylic).

Attempt 1

The second time, I didn’t take off the paper that covered the acrylic and I thought this didn’t give me the best results. The etching didn’t come through as well, so I did my next ones with the paper removed as well as increased the power and lowered the speed for the etching.

Attempt 2

Another thing I learned was that for very small pieces of acrylic, it was hard to get accurate results for printing ( a lot fo my pieces were slightly off center, even though I put the pieces at 0,0 on the bed and my illustrator files were placed correctly.

Final triangles

Each triangle has a tiny hole cut on the top that I want o take fishing string to hang from a rod that would hang on my window.

(In progress – I am still searching for this string)

Filed Under: Uncategorized

Ideas for PComp Final Project

November 7, 2018

Interactive Wind Chime with LEDs and Sound

Interactive Wind Chime with LEDs and Sound

One of my ideas was to create an interactive wind chime inspired object. It would respond with the sound of meditative bells (like wind chimes) when touched. The bigger poles would have deeper sounds while the shorter ones would have higher pitched sounds. I wanted the rods to be light diffusing and the LEDs would have gradual shifts of changing light (I’m not sure about if the light serves to attract the user to touch the object or if it also responds to touch or maybe more generally movement).

I am still in the process of working out the details. I need to figure out exactly how I want the user to interact with the object. As of now, the user is acting as the “wind” and “energy” for producing the sound of the bells which acts as a sort of instrument to the user.

Rods that would be the light diffuser for the LEDS and serve as the chimes

Filed Under: Uncategorized

Fabrication – Creating Five Repeatable Objects

November 5, 2018

This week we had to create five repeatable objects and I chose to create wooden tarot cards. I also wanted the chance to use the laser cutter for the first time so I thought using that for the etching would work out well. 

Normally a tarot card deck has 72 cards, so I had to go through my deck and pick out my favorite ones that I wanted to create. These were picked from the Rider-Waite tarot deck, which was originally drawn and published in 1910. Most were chosen from the major arcana and then I added the ace of cups because I really liked the design. I took photos of the five cards I picked and created vector files for them in illustrator. 

Creating vector files for the tarot cards in illustrator.

Once, those were created I wanted to test them out, so I found a scrap piece of wood and laser cut one etching design on it. I had help from Veronica and a guy at the shop to show me how to use the laser cutter properly. I then used the bandsaw and the sander to cut it down into the shape of a card. And my first pancake was made.

Making my first pancake (with a lot of uneven imperfections).

Now, I needed to find actual wood for these cards. I wanted the wood to be as thin as possible. I went to Home Depot, but unfortunately they didn’t have anything I wanted. Tushar was kind enough to give me some of his wood. I used the first machine to the left (I forgot the name of it) that cuts huge pieces of wood. Then I used the bandsaw to cut down the wood into 5 blocks where I would laser cut my tarot etchings. I left enough space to cut the cards down.

Next, I etched each card with a different tarot design.

Once, they were all etched, I measured half an inch space between the edge of where I wanted to cut and the edge of the etching. From making my first pancake, I knew that the bandsaw was really hard to cut accurately with, so I cut near the lines and then sanded the card down to the exact point of where I wanted the card to be cut. 

Overall, I found using the sander to sand down to lines you wanted cut was more accurate than using just the bandsaw. All the cards did not come out the same size (they varied slightly because even the sander was hard to make completely accurate). If I had more time, I would have also wanted to redo my laser etchings. I wished there was more depth to them and they had deeper etchings. Since this was my first time using a lot of these tools, I’m still proud of how they ended up turning out.

Filed Under: Uncategorized

  • Page 1
  • Page 2
  • Page 3
  • Go to Next Page »

Primary Sidebar

Computational Media

Recent Posts

  • Pcomp Final Project
  • Fabrication – Motors
  • Fabrication – Two Materials
  • Pcomp Final – Basic User Testing Prototype
  • Physical Computing Final Project – Updated Protoype

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2025 Anna Gudnason on the Brunch Pro Theme