Skip to content

Final project

For my new final project, I wanted to expand on my project from week 7, my butterfly shelf and make it more interactive with its environment. Jada Greene used a similar concept with her interactive lamp that she made. I want to take neopixles and put them in various places on my shelf. I want to have those neopixles turn on when the lights in the room are off. I also want to have the color of the neopixles change to fit is environment similar to Mrs. Dhiman’s final project.

Pre-Project Design Specification Considerations

  • What do you want your project to do?

My project will be an interactive butterfly that will react to its environment by changing color along with its surroundings.

  • Will your project be inside or outside?

My project will be inside.

  • Will your project be portable?

My project will be light enough that I can carry it, but it is a wall hanging, so it will mostly remain stationary.

  • Will your project connect to the Internet?

No, at the moment there is no need for my project to be connected to the internet.

  • Will your project use Bluetooth?

At the moment I do not plan to have my project connect via bluetooth, but in the future I may add a smaller part to my project that required bluetooth.

  • Does your project use a vinyl cutter?

No, I will not need to use the vinyl cutters for anything.

  • Does your project use a laser cutter?

I might use the laser cutters to engrave designs onto my butterfly, so I can add more detailed smaller designs on my butterfly.

  • Does your project use a 3D printer?

Yes, I will use the 3d printers to create housing for my electrons

  • Does your project use a large CNC machine (Shopbot)?

Yes, I will need a large CNC machine to create the body and the shelf of my project.

  • Does your project have intelligence (Arduino, Raspberry Pi, computer)?

Yes, I will need some sort of micro controller to control the color sensor I will use along with the other sensor

  • What are your project inputs?

the input will be the the color sensor that will detent the color of its

  • What are your project outputs?

My outputs will be either a music analyzer, or some kind of amplifier for my project.

  • What are the dimensions of your project?

I do not currently have specific dimensions for my project, but I will make it about the size of a standard electric guitar.

  • What materials will you use?

will use wood, acrylic, LEDs or neopixels, metal strings for the guitar, and epoxy.

  • How will you conceal the electronics?

I will put my electronics inside my guitar, or i will create a small box to conceal my electronics.

Milling out the body

designing:

I made the body of the butterfly shelf in week 7 where I further expand on the process. After much thought, I decided that I wanted to make a shelf that I could hang up in my room. I looked on Etsy for some inspiration and came across this beautiful butterfly shelf that I wanted to recreate, linked here. To start, I opened Fusion 360 and imported an image of the butterfly as a canvas which I used to create the shape of the shelf. Using the fit point spline tool, I traced the shapes of the wings and then extruded it to 1/2in. I made the extrude 1/2in because that is the thickness the material should be, however, I will need to change this later because the wood I will be using won’t be precisely 1/2in. After I extruded the sketch, I created a new sketch on the surface of the body I created and made a ton of shapes and designs on one half of it. I then made a construction line down the center of the sketch and selected everything within the second sketch. After that, I mirrored everything over to the other side. When I did this Fusion 360 crashed. When it crashed the first time I thought it was a coincidence, but when I tried again and Fusion crashed again. I then realized that I had way too many items selected. Once I thought about it, I realized that not only were the lines I had created being selected but, with the way I was selecting the items, all the constraints were being selected too. To fix this, I manually selected all the items I wanted to mirror and I mirrored them. This time Fusion did not crash and I learned that when right-click and drag to select items in fusion you also select the constraints associated with them. After I put in all the designs I wanted on my shelf, I extruded the main body up to .5 in, which I would also change to my material thickness later. I then extruded all of the designs in by -100 just so that they would cut all the way through and there will be no issues later. The next thing I needed to create was the shelf and the slots for the shelf. I went about this by first making the holes for the tabs on the shelf on a new sketch. I then extruded them down the same distance I did with the designs. From there I created a new sketch in which I traced the slots I made and once I was sure they lined up and were evenly spaced I connected them with a line. I then used the move tool to relocate the sketch and I extruded the main part to be 8 in. After that, I extruded the tabs to be .5in (screenshot 1). Once all of that was done, I finally had access to my wood, so I measured it to be .469in, so I updated all of my extrudes to match that. I then saved my file and exported it as a .dxf (screenshot 2), so I could further work on it in Aspire. Final Fusion 360 file

milling:

The smartest way to go about the actual milling process was to cut all of the small pieces inside of the body of the shelf, then cut out the rest of the body. I started by saving all of the tool paths for the inside of the shelf and I uploaded it to the Shopbot with an offset so it would perform an air cut and I could see how the Shop bot was going to cut. After I looked at it and everything was ok, I sent the first of the inside profile cuts to be cut (image 4). This went perfectly and I sent the second cut to the machine (image 5). This cut was progressing nicely until I dropped the emergency stop button on the floor and completely reset the Shopbot. This was very difficult to overcome without completely restarting however with Mr. Dubick’s help I was able to. The main problem was that I needed to re-zero the Z axis, but the wood that I was already fastened to the bed of the machine was preventing me from doing that. Lucky for me I already had a few pieces cut out of my board, so I was able to use that small area to re-zero the Z axis. To start I jogged the X and Y axis to the small opening I was going to use (image 6). Once the bit was over the cutout area, I used the JZ command to lower the bit at low as possible without breaking it (image 7). From there I used a few pieces of scrap wood at used them to fill the gap from the end of the bit to the bed. Once I was able to create a snug fit between the bed and the bit, I measured the thickness of the wood I used to create that snug fit (image 8). I then took that measurement and added it to the value that Z was already at, and set it to be the O for the Z axis. After the 0 was reestablished, I used the JZ, 2 command to raise the Z axis 2in. We then measured the distance from the end if the spindle to the bed of the Shopbot to see if it was 2in away (image 9). I used J2 0,0 to return the machine to the origin. After that, I started the last profile cut that I had before the machine reset and I re-milled it. That way I could see if something managed to be thrown off during that whole ordeal. Everything from there cut smoothly and to the bottom without cutting through to the bed of the machine (image 10).

Resin

first layer:

The first step I took in this process was Painting a clear coat of resin on the inside of my cutouts that I would be putting resin into. To do this I put on gloves and gathered a silicon mixing cup and spatula, a disposable cup, and a popsicle stick. I took sheets of cardboard and put them underneath the area where I would be working, that way I would not make a mess. I poured in a 1:1 ratio of part A and part B of the resin. I then proceeded to mix the two parts together for 5 minuets. Once the 5 minuets were complete, I slit the resin into 2 cups, one for me and one for my sister, so we could conquer the job faster. We used cheap paint brushes to spread the resin around the inside of each area I wanted to put resin in. Because the chemical reaction that takes place between parts A and B when resin in mixed is exothermic, as we were painting the resin on, we could feel the heat being emitted from the reaction. Once we finished the first coat of resin I left it to cure overnight.

prep:

Because resin is self leveling, it is very important to make sure that what you are pouring onto is as waterproof as possible, so the resin does not leak everywhere both creating a mess and more work later on while sanding. To prevent this, I used silicone caulk to create a border around the areas I wanted to pour into. That way when I over-poured the resin, the caulk would stop it from spreading all over the project. Along with the caulk, I also used tape on the bottom of the areas I needed it on. I used the take because my wood was very bowed and when I would pour it the resin would leak out everywhere. On top of adding the tape, I also took pieces of scrape wood and clamps to keep the seal tight.

final pour:

Electronics

testing:

To start off I used the previous knowledge I had from my work during outputs week to start off with testing. Because I was using the the WS2811 LED instead of the WS2812B (neopixels), I wanted to test out simple codes to make sure the strip worked. At first I had trouble getting the LED strip to turn on. I was originally using a 5v power supply and a seeed RP2040, the code was uploading to the board with no problem so I was very confused. I thought the LED strip wasnt working and started to look for a new one on amazon; then I noticed the ones on Amazon used a 12v power supply. I switched out the power supply and the strip turned on solid white. I then attempted to upload a strandtest example code but it was not working. I tried to move my wiring to the other side of the LED strip just in case it was simply on the worng side, again it just lit up white and there was no change to the colors. I had no idea what was wrong with the strip and I thought it was possible that the strip I was using was not addressable, so I took another WS2811 strip and wired it the same way I did with the privious one. From there I noticed the strip was lighting up however the colors and patterns were not correct. It was sparatically flashing random colors attempting to respont to the code I had uploaded. I assumed this was due to a faulty ground or a bad connection somewhere so I adjusted all of my wires and made sure eveything was sharing a ground. This did not fix my problem however when I looked at the chip I was using, I noticed that some of the solder connections may have been the problem. because I was borrowing someone elses chip, I returned it to them and decided to solder my own, I made sure to melt the solder extra long to ensure there were no cold solders and I plugged the newly soldered chip into the breadboard. After I replaced the chip, I reuploaded the code and then nothing was happening. While looking over my code again, I noticed I did not have the correct pin, once I changed the pin in the code back to what I had it to when I first started testing, the LED strip started working. Once I had the new LED strip working I took the old one I was trying to use and wired it the same way. This made the strip finally start working, however, I noticed they were pretty dull, so I looked at the code where the brightness was and noticed it was at 50. I changed it to 200 and uploaded the code and the LED strip got brighter. The nest thing I needed to focus on was the color sensore and getting it to work with the LED strip.

Electronic production

For this board I wanted to reduce the amount of neopixels I would be using for my final project, so I decided to only light up the perimeter of the shelf. I needed two sets of four header pins for the neopixels and for the color sensor. I connected the header pins for the color sensor to the ground, 3.3V, SDA, and SCL pins of the color sensor. I then moved onto the neopixles. I used neopixels that had red, green, and blue pads, so I connected each color to a pin on the Xiao Rp2040. and connected the 5v power to the 5v power pin.

PCB board

Next I needed to add net connections to each component so it could be milled. once that was done, I made the overall size of the board as small as possible to minimize the amount of space it would take up.

## Milling and soldering I then followed all of the mentioned earlier and milled out my board. I then soldered the header pins to the correct space and the Xiao Rp2040 in its place. once that was done, I when to test the board, but I noticed a major flaw, one set if header pins were placed directly in front of the cable port.

To fix this I simply moved the set of header pins further to the side of the board and remilled it.

I soldered the new version of the board and connected the appropriate parts of the color sensor and neopixels with female to female jumper wires.

## Code following Mrs. Dhiman’s advice, I perused this site to find a code to test out my board. The website provided me with this code: ```

include

include “Adafruit_TCS34725.h”

// Pick analog outputs, for the UNO these three work well // use ~560 ohm resistor between Red & Blue, ~1K for green (its brighter)

define redpin A1

define greenpin A0

define bluepin A2

// for a common anode LED, connect the common pin to +5V // for common cathode, connect the common to ground

// set to false if using a common cathode LED

define commonAnode true

// our RGB -> eye-recognized gamma color byte gammatable[256];

Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_4X);

void setup() { Serial.begin(9600); //Serial.println(“Color View Test!”);

if (tcs.begin()) { //Serial.println(“Found sensor”); } else { Serial.println(“No TCS34725 found … check your connections”); while (1); // halt! }

// use these three pins to drive an LED

if defined(ARDUINO_ARCH_ESP32)

ledcAttachPin(redpin, 1); ledcSetup(1, 12000, 8); ledcAttachPin(greenpin, 2); ledcSetup(2, 12000, 8); ledcAttachPin(bluepin, 3); ledcSetup(3, 12000, 8);

else

pinMode(redpin, OUTPUT); pinMode(greenpin, OUTPUT); pinMode(bluepin, OUTPUT);

endif

// thanks PhilB for this gamma table! // it helps convert RGB colors to what humans see for (int i=0; i<256; i++) { float x = i; x /= 255; x = pow(x, 2.5); x *= 255;

if (commonAnode) {
  gammatable[i] = 255 - x;
} else {
  gammatable[i] = x;
}
//Serial.println(gammatable[i]);

} }

// The commented out code in loop is example of getRawData with clear value. // Processing example colorview.pde can work with this kind of data too, but It requires manual conversion to // [0-255] RGB value. You can still uncomments parts of colorview.pde and play with clear value. void loop() { float red, green, blue;

tcs.setInterrupt(false); // turn on LED

delay(60); // takes 50ms to read

tcs.getRGB(&red, &green, &blue);

tcs.setInterrupt(true); // turn off LED

Serial.print(“R:\t”); Serial.print(int(red)); Serial.print(“\tG:\t”); Serial.print(int(green)); Serial.print(“\tB:\t”); Serial.print(int(blue));

// Serial.print(“\t”); // Serial.print((int)red, HEX); Serial.print((int)green, HEX); Serial.print((int)blue, HEX); Serial.print(“\n”);

// uint16_t red, green, blue, clear; //
// tcs.setInterrupt(false); // turn on LED // // delay(60); // takes 50ms to read // // tcs.getRawData(&red, &green, &blue, &clear); //
// tcs.setInterrupt(true); // turn off LED // // Serial.print(“C:\t”); Serial.print(int(clear)); // Serial.print(“R:\t”); Serial.print(int(red)); // Serial.print(“\tG:\t”); Serial.print(int(green)); // Serial.print(“\tB:\t”); Serial.print(int(blue)); // Serial.println();

if defined(ARDUINO_ARCH_ESP32)

ledcWrite(1, gammatable[(int)red]); ledcWrite(2, gammatable[(int)green]); ledcWrite(3, gammatable[(int)blue]);

else

analogWrite(redpin, gammatable[(int)red]); analogWrite(greenpin, gammatable[(int)green]); analogWrite(bluepin, gammatable[(int)blue]);

endif

} ``` I changed the pins in the given code to match those of the LED strip on the pcb board. After that I plugged in the Seeed Xaio Rp2040 to the computer, selected the appropriate board and COM port, then uploaded the code. At first I was receiving the same error message over and over again essentially saying that the Xiao was not connected. Later on Ginny pointed out that I had Thonny running in the background along with other Arduino tabs. She said that other tabs could interfere with the connection of the board. After I closed out all of the other tabs I had opened, I noticed that the the board was connecting properly. Once the code was uploaded, I noticed it started working:

add video

Assembly


Last update: April 5, 2024