Iteration assignment

rrr

For my iteration assignment, I decided to combine my name tag with lights to create a light box. My original name tag had a leaf at the centre of it to represent my love for nature and my name tag was in black and brown on an acrylic sheet. I wanted to add colors green and yellow to it so I decided to create a light box with lights in them with my initials and a leaf on top of the clear acrylic sheet as my name tag. The idea was to iterate on the original name tag to add color that was otherwise missing on the original name tag by using lights.

All of the sides of the box were in wood except the top which was in clear acrylic. I started out by creating a smaller box to test that it wouldn’t break under the pressure when put together. For that I got the prototypes from ‘boxes py’ for a small box.

The  wooden sides and acrylic top got put together nicely and so I decided to laser cut the bigger pieces too. I went on to the next step to build a circuit that would light up led’s on an Arduino.

But I decided to replace these led’s with neopixels as I wanted to create dancing lights and give the lights nicer colors. I soldered the neopixel to jump wires and connected it to my Arduino board. I downloaded the neopixels library from Adafruit and played around with a few examples to get the pixels to light up in a way I wanted. I used green and yellow colors to represent nature. I added green cloth inside the box with some green, yellow and white feathers to represent more of the nature I wanted to portray in my light box.

Finally I made the neopixels light up by connecting the Arduino board to the source. I initially was going to put the lights very close to the leaf but I realized later that acrylic can disperse light, so I put it lower than the surface of it. I changed the lights to go from one level of brightness to another consecutively and changed the colors from green to yellow one after the other. Here is a video of the light box with the dancing lights.

On my second iteration, I changed the code further to include different effects on the lights. I added a fast flicker, a simple plain light up without any effects, all in green and yellow and a rainbow effect to include more color.

CODE

// When setting up the NeoPixel library, we tell it how many pixels,
// and which pin to use to send signals. Note that for older NeoPixel
// strips you might need to change the third parameter — see the
// strandtest example for more information on possible values.
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

#define DELAYVAL 500 // Time (in milliseconds) to pause between pixels
Adafruit_NeoPixel strip(2, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
// Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
// END of Trinket-specific code.

pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}

void loop() {
pixels.clear(); // Set all pixel colors to ‘off’

// The first NeoPixel in a strand is #0, second is 1, all the way up
// to the count of pixels minus one.
for(int i=0; i<NUMPIXELS; i++) { // For each pixel…

// pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
// Here we’re using a moderately bright green color:

pixels.setPixelColor(i, pixels.Color(0, 250, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(0, 200, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(0, 150, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(0, 100, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(0, 50, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(250, 250, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(250, 250, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(200, 200, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(150, 150, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(100, 100, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

}

for(int i = 0; i<50; i++){
pixels.setPixelColor(0, pixels.Color(0, 250, 0));
pixels.setPixelColor(1, pixels.Color(250, 250, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(50);

pixels.setPixelColor(0, pixels.Color(0, 200, 0));
pixels.setPixelColor(1, pixels.Color(200, 200, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(20); // Pause before next pass through loop

pixels.setPixelColor(0, pixels.Color(0, 150, 0));
pixels.setPixelColor(1, pixels.Color(150, 150, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(10); // Pause before next pass through loop

pixels.setPixelColor(0, pixels.Color(0, 100, 0));
pixels.setPixelColor(1, pixels.Color(100, 100, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(2); // Pause before next pass through loop

pixels.setPixelColor(0, pixels.Color(0, 50, 0));
pixels.setPixelColor(1, pixels.Color(50, 50, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(1); // Pause before next pass through loop
}

for(int i = 250; i>100; i–){
pixels.setPixelColor(0, pixels.Color(0, 255, 0));
pixels.setPixelColor(1, pixels.Color(255,255, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(50); // Pause before next pass through loop
}

for (long firstPixelHue = 0; firstPixelHue < 5 * 65536; firstPixelHue += 256)
{
for (int i = 0; i < strip.numPixels(); i++)
{ // For each pixel in strip…
// Offset pixel hue by an amount to make one full revolution of the
// color wheel (range of 65536) along the length of the strip
// (strip.numPixels() steps):
int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
// strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or
// optionally add saturation and value (brightness) (each 0 to 255).
// Here we’re using just the single-argument hue variant. The result
// is passed through strip.gamma32() to provide ‘truer’ colors
// before assigning to each pixel:
strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
}
strip.show(); // Update strip with new contents
delay(15); // Pause for a moment
}

}

Reflection

I was inspired by appreciation for lights in general to make this project. Lighting has a way of changing my mood and it’s my favorite thing in the world. I love different kinds of lights. They are very good mood uplifters so based on some examples of students in the previous semesters, I decided to create a light box. I was excited about using led’s to light up my light box. There are some pitfalls to avoid in the project. The wires are sensitive and the box pieces should be checked to see if they can handle pressure. I was adjusting the position of my neo-pixel after putting green cloth on top of the Arduino when one of my jump wires broke inside my Arduino. So it is important to be very nifty with the wires as the neopixels are soldered to the jump wires and tugging too hard on them can break them. I care about this because I believe lights are beautiful. The natural sunlight is my favorite type of light and I love everything about nature. I wanted to add some color to my name tag as I wanted to make the name tag more representative of nature in all of its colors also. I still need to learn how to write better code to add even more effects to the lights. If I had more time, I would experiment with more examples from Adafruit. My goal was to get the box to light up and I feel satisfied that I was able to make the light box close to what I had expected. I wasn’t expecting the light to dispense from so far but acrylic could do that. I also didn’t expect to use neopixels but they were much better than the simple led’s. The big moment that moved my project forward was when I got the led’s to light up in a dancing way. I knew then my project was going to be a success. Learning to solder was also a lot of fun. Soldering requires precision and concentration. I really liked building the whole thing and combining different techniques to make it happen. I was a little doubtful about my ability to combine the different techniques but now I am hopeful for the final project that I will be able to think up something for that as well.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest