Monday, December 4, 2017

3D Art Project



Introduction
This is a project completed in PLTW Digital Electronics class in Glenbrook South High School. In this project, I improved used my skills in Laser Engraving, 3D Modeling, Programming, Soldering, and Wiring to make the Ukrainian Trident glow using Adafruit RGB Leds.

Day 1 - November 30, 2017
This first day, I chose the image that I will engrave on the 6'' by 9'' piece of acrylic. The image will be a black and white Ukrainian Trident to represent my nationality. I added the image to Adobe Illustrator and converted it to a vector to make it ready to engrave.

Day 2 - December 4, 2017

We received most of our electronic supplies on this day so I started doing more serious work on the project. I first downloaded Trinket drivers and the FastLED library to my school computer. I then tested the blink sketch on the Trinket. Then, I soldered header pins onto the trinket and soldered 3 wires onto the Neopixel LED strip. Finally, I used a dial caliper to make some important measurements of the LED strip length, perfboard dimensions, and the example base for the project.

Once I arrived home, I repeated the setup on my home computer and read the 43-page Trinket datasheet, learning that it supports PWM, I2C, SPI and other cool things. This surprised me because the board is so cheap. I also realized why we are not using batteries. The 5V regulator in the board is limited to 150 mA while on full brightness, our LED strip draws 500. I wired everything up on a solderless breadboard and started looking into the code. I understood that the color of every LED is stored in a CRGB array which can be changed very fast. I learned how to set up the library and began programming my overall project. I want to have LEDs change color from inside to outside and back, so I worked on that feature using for loops. I only had 1 or 2 LEDs lit at a time, so I need to develop a method for keeping more of them on and slowly changing the colors. I am considering researching color palettes instead of using individual colors.
void play(){
  counter++;
  for(int i = 0; i < 8; i++) { //goes middle to outside
            leds[7+i] = leds[7-i] = getColorList();//sets LED to color from list
            FastLED.show();
            // clear this led for the next time around the loop
            leds[i+7] = leds[7-i] = CRGB::Black;
            delay(100);
   }
   counter++;
   for(int i = 0; i < 8; i++) { //goes outside to inside of strip
            leds[14-i] = leds[0+i] = getColorList();
            FastLED.show();
            // clear this led for the next time around the loop
            leds[14-i] = leds[0+i] = CRGB::Black;
            delay(100);
   }
}
My final sketch for the day in action

Day 3 - December 6, 2017
Today, I continued working on my electronics. I soldered the trinket onto the perf board along with a 470 ohm resistor and the LED strip. I encountered two problems. First, the wire that is soldered to the LED strip keep falling off so I will solder it on the next day and coat it in hot glue. Also, my resistor is close to touching the USB pin, which can become problematic in the future. Next class, I will cover that area with hot glue as well to keep them from touching. I also have to trim the extra leads. 

At home, I looked at some example FastLED code and learned how to make a palette. I made a striped palette that alternated blue and yellow colors: the colors on the Ukrainian flag. I am planning on doing more work on programming next class where I will have at least 4 different palettes/programs alternating every 10 or 5 seconds. I will also begin modeling by base next class and add a red shape around the symbol I am engraving along which the acrylic will be cut. Below, you can see the perfboard I soldered today as well as a fragment of the palette code.

  CRGB blue = CHSV( HUE_BLUE, 255, 255);//defines blue color
  CRGB yellow  = CHSV( HUE_YELLOW, 255, 255);//defines yellow color
  currentPalette = CRGBPalette16(
                                   blue,  blue,  yellow,  yellow,
                                   blue, blue, yellow,  yellow,
                                   blue,  blue,  yellow,  yellow,
                                   blue, blue, yellow,  yellow );//creates pattern for palette

Soldered Perfboard

Soldered Perfboard

Day 4 - December 8, 2017

Today I applied hot glue to various places on the perfboard in order to dull the sharp lead edges and to prevent contact between components. I also finished all of my code, and I only have to adjust the brightness once everything is built. I have 4 different patterns in my code that switch after every 7 seconds.

I also continued working on the engraving and the shape that I will cut. I used some scrap acrylic for a test and learned some valuable things about the settings. The speed for cutting should be 1% (not 20% like I did) and 3 passes will be sufficient. Also, I observed that not enough light is diffused in my engraving, so next class I will split it into lines to resolve the issue and maybe do another test print (or final).

Here you can see my final code with comments. 

Next class to do list:
1. Split engraving into lines & do another engraving (test or final or both)
2. start 3D modeling
3. Maybe begin soldering the switch

Test engraving in progress
Completed test engraving
Day 5 - December 12, 2017
Today, I edited my Adobe Illustrator engraving in order to have more diffused light. I converted the whole graphic into squares, which also gives a pixelated effect. I made another test print and am now ready for the final print. I also began 3D modeling the base in Autodesk Inventor. 
My second test engraving

Day 6 - December 14, 2017
Today in class and out of class, I modeled the top and bottom of my base in Autodesk Inventor. I made holes for screws, switch, and micro-USB. I carefully measured the components with a caliper to make by base fit everything perfectly. At the end, I began printing my two pieces and will try to put everything together next class. I still have to solder the micro-USB connectors and the switch. 

Also, I did a final engraving of the acrylic. The piece burned a little bit because the Laser Engraver had trouble cutting it. It looks pretty good if the slight burns and scratches are ignored. 

My final engraving
The top and bottom of the 3D-printed base