XAMI Posted February 10, 2020 Share Posted February 10, 2020 Infinity cubes and icosahedrons are things that have always caught my eye. They however always seemed quite hard to make, because of the relative complex frame. This infinity cube, however, has a frame that is printed in one piece. Making the build a lot stronger and easier than most other projects. The size of the cube is chosen so only 1M of LED strip is needed for the entire cube, keeping the cost low. I am very happy with how this project turned out and hope you like it as well! Step 1: Materials / Tools 1meter ws2812b 144LED/m IP30 $8.69 microcontroller (Arduino) $2.58 6 plexiglass squares (91*91*3mm) mirror film $2.19 (Product arrived in bad quality, I can't recommend ordering it on Ali) wire (to connect LED strip pieces) $1.61 3D printed frame soapy water (is this even a material?) 5V power supply $4.86 (10 A if you want all LEDs to be white, but 5A should be fine in most cases) Tools: Soldering iron second glue hot glue (optional) wire strippers small pliers ( to help with soldering in tight corners) 3d printer (or someone willing to help you out with printing the frame) Step 2: The Frame This is the most important part of this project. The part is printed on one of its corners so there is less difference in layer lines and because "theoretically" no support is needed when printed in this orientation. However, after this print failed once I decided to add supports anyway. The supports are actually drawn in the model because a slicer can not generate them efficiently for a model like this ("v3 v11.stl" has supports, v3 v12.stl" does not have supports). Due to the orientation a 180*160*180 space is needed to print an 114*114*114 cube. It took me 10h to print and approximately 65g of filament is needed for the model. v3 v11.stl v3 v12.stl Step 3: LED Wiring It is important to understand how the wires need to be soldered before actually soldering them since there is not a lot of space to work with. The drawing above (which represents the cube) should give you an idea of how everything is soldered. 5 Wires go through the hole into the cube. Two pairs of 5V and GND, one to power the beginning of the LED strip (on the bottom layer) and one to power the end (on the top layer). This is not just powering the strip on two ends, this is actually necessary to eliminate the need for more complex solder joints. The other wire that goes in is the Data line, this is the line that sends data to all LEDs to specify the color of them. If you follow the green line you can see the order in which the strip sections of 12 LEDs are connected with each other (they are numbered in order on the image). In the parts where the green line runs next to a piece of LED strip, it means that it is running underneath the strip (The frame has space for these wires). In the sketch, you can see that there are three parts, the center square, the outside square, and the middle 4 pieces that are in between the two squares. The middle 4 pieces get their 5V from the outside square and their GND from the center square. Note that the wires that power the outside square come in on the bottom layer and go through the frame (behind a part of the LED strip) to the top layer. Step 4: Soldering Step 1 I am going to divide this section into sub-steps to explain everything better. I numbered the parts of the LED strip in the image above to explain everything better. This is how I did this, if you have a better way, just use your own. Make sure to pay attention to the direction of the LED strip pieces! Placing one piece incorrect can give you a lot of trouble. Step 1: Since we need sections of 12 LEDs you should start by cutting the LED strip in 12 pieces of 12 LEDs each. Next, connect 3 wires to part 1, make sure to connect them on the Din side. Add 2 more wires to connect to the V5 and GND on part 12 to the Dout side, the wires for this side need to be at least 12cm longer since they need to run through the frame, the wires do not need to be soldered to part 12 yet. Run all the 5 wires that connect these pieces through the hole. Then remove the cover of the sticky tape and stick part 1 to the frame, don't worry, the tape does not stick very well, the parts will later be attached with glue. Step 5: Soldering Step 2 Make sure to pay attention to the direction of the LED strip pieces! Placing one piece incorrect can give you a lot of trouble. Step 2: Now parts 2-3 will be added, the same process can be repeated for 4,5 and 6,7. First, a wire needs to be soldered to the Din of part 3, this wire needs to be 15 cm or longer and is the one that goes to the Dout of part 2 (blue line in image). This wire will be trimmed down later. After soldering the wire remove the sticky tape cover of this part and place it down. Next, connect the Dout op part 1 with the Din of part 2, to do this, you might need to pull part 1 a bit of the frame. this needs to be a very short wire with a piece of insulation in the middle. Remove the tape from part 2 and place it in its position, make sure the blue wire runs behind it. Now trim the wire connected to the Din of part 3 and solder it to the Dout of part 2. To solder this, it is very likely that you have to remove part 2 from the frame again to get some space. This is a very tight corner and the wire that is underneath part 2 will need to make a sharp 180-degree turn to connect to the Dout of part 2 (this can be seen in image 4). Now connect the V5 of part 1 and part 3, a short wire might be needed to do this. Finally, take a small piece of wire to connect the GND of parts 1,2 and 3 with each other. If the 5V pad of part 2 is in the way, you can just cut the corner of that part of diagonally to remove the solder pad. Check for shorts if you think you might have made a mistake. Now repeat for part 4,5 and 6,7 ? Step 6: Soldering Step 3 Make sure to pay attention to the direction of the LED strip pieces! Placing one piece incorrect can give you a lot of trouble. Step 3: Right now part 1 to 7 should be placed down, make sure to triple check everything because you can not easily test it because parts 2,4 and 6 do not have 5V yet. Connect the 5V and GND wires that run through the hole to part 12. Remove the sticky tape cover from part 12 and place it down. make sure the wires run nicely trough the gutter at the place of part 8 (which is not placed yet). You can pull the wires a bit more trough the hole to make them fit better. Next connect the Din of part 8 to the Dout of part 7, just as in the previous step. then connect the GND of part 7 with part 8. (In the image above I have not yet added part 12, I did add it but do not have an image of it.) Step 7: Soldering Step 4 Make sure to pay attention to the direction of the LED strip pieces! Placing one piece incorrect can give you a lot of trouble. Step 4: You are almost done, only part 9,10 and 11 need to be placed down. Soldering these should be straight forward, just make sure to solder the Dout of one piece to the Din of the next first, since it is difficult to access afterward. Do not forget the connect the 5V of this layer with the 5V of part 2,4,6 and 8. To test if all the LEDs work, I used the following code. It will go through all LEDs one by one. If something does not work, you can use a multimeter to figure out what is wrong. <p>#include <br>#define LED_PIN 7 #define NUM_LEDS 144 CRGB leds[NUM_LEDS]; int counter; void setup() { FastLED.addLeds(leds, NUM_LEDS); counter=0; } void loop() { counter=(counter+1)%144; leds[counter] = CRGB(255, 0, 0); FastLED.show(); delay(20); leds[counter] = CRGB(0, 0, 0); }</p> Since only one LED is powered at a time, this code can be powered through the Arduino. This means the external power supply is not needed to run this code, you can just connect the 5V and GND of the strip to the Arduino. Step 8: Gluing the LEDs to the Frame As mentioned before, the sticky tape on the strip itself does not stick well to PLA. That is why I lifted all the LED strip pieces a bit and put some second glue underneath them and pressed them down afterward. Be careful not to spill this glue. Besides sticking your hands together It will leave stains on the frame. Step 9: Cutting Acrylic Squares (If You Did Not Have Them Cut) Instead of cutting the acrylic in squares of 91mm, I used a ruler and a knife to make lines in the acrylic at points where I wanted to break it. After making a line in the acrylic with the knife, I placed the line on the edge of a table to break the piece on the line. This is not super accurate and might result in a bit uneven edges, but there is room for a few mm error so it does not matter that much. (I already applied film to two squares in the image) Step 10: Applying Mirror Film Here is a link to someone explaining how to do this, to summarize it: Clean acrylic, remove fibers or dust Apply soapy water to acrylic remove plastic from film place the film on the acrylic remove bubbles and soap from the center out with a plastic card trim edges Make sure to remove all particles before applying film, this makes a significant difference in how well it looks. Step 11: Placing Mirrors in Frame Before placing any mirrors in the frame make sure the mirror side is cleaned well, this side will be placed inwards and can not be cleaned afterward. I placed the mirrors in opposing pairs just to check that they were perfectly pacing the same way. This is actually very easy to achieve since the frame should take care of the aligning. I attached the mirrors with some second glue to the frame (Hot glue might be better for this, it does not stain the PLA). The mirror side facing inwards because that is the most fragile side and this way light does not have to travel through a layer of acrylic before being reflected again. Step 12: Electronics I started with cleaning up the wires that were coming out of the cube, this just makes everything look a bit neater in my opinion. Since this project is just an Arduino with an LED strip everything is quite simple. 5V from the power supply should be connected to the 5V of the cube and to the 5V of the Arduino. The GND from the power supply needs to be connected to the GND of the cube and to the GND of the Arduino. Make sure you get the polarity right, check this with a multimeter if necessary before powering it on, otherwise you could fry your Arduino. To avoid this you could also power the Arduino trough the power connector, but you will need an extra connector to do this. Now the only thing left to do is to connect the Din of the cube to a pin on the Arduino, I ended up using pin 5, but this does not really matter. Simple right?! Note: the third image is just some scheme I found online, the resistor in there is not needed. You could decide to include it though Step 13: Code ? The code I used up til now was quite simple, I just took some code from the fast LED example library and changed a few numbers to run on this cube (the original code I used can be found here). Before connecting the Arduino to your PC using the USB port, make sure to unplug the 5V connection between the power supply and the Arduino. I ended up writing code that has multiple animations, some of them can be seen in the video above.: Dont copy paste from this, it wont run due to the way instructables pastes code <p>#include <br>#define LED_PIN 5 #define NUM_LEDS 144 CRGB leds[NUM_LEDS];</p><p>void setup() { FastLED.addLeds(leds, NUM_LEDS); fill_solid(leds, NUM_LEDS, CRGB(0,0,0)); // fill all black FastLED.show(); } void loop() { onesnake(10000); fill_solid(leds, NUM_LEDS, CRGB(0,0,0)); fadeFromCenter(10000); fill_solid(leds, NUM_LEDS, CRGB(0,0,0)); //rainbow(5000); fill_solid(leds, NUM_LEDS, CRGB(0,0,0)); sparkles(10000); fill_solid(leds, NUM_LEDS, CRGB(0,0,0)); //loopThroughColors(5000); fill_solid(leds, NUM_LEDS, CRGB(0,0,0)); } void onesnake( int duration){ unsigned long startTime; startTime=millis(); int location=1; int nextpath =1; int corners[8][3] = {{-7,8,1},{-1,2,3},{-3,4,5},{-5,6,7},{-8,-12,9},{-2,-9,10},{-4,-10,11},{-6,-11,12}}; int ledsInSnake[48]; int color=0; for (int i=0;i<48;i++){ ledsInSnake[i]=0; } while(startTime+duration>millis()){ if (location>0){ for(int i=0;i<12;i++){ color=(color+5)%2550; leds[ledsInSnake[0]]=CHSV(255, 255, 0); for(int j = 0; j < 48; j++){ if (j!=0){ leds[ledsInSnake[j]]=CHSV(color/10,255, (j*255)/48); ledsInSnake[j-1]=ledsInSnake[j]; } } ledsInSnake[47]=(location-1)*12+i; leds[ledsInSnake[47]]=CHSV(color/10,255, 255); FastLED.show(); delay(20); } } if (location<0){ for(int i=0;i<12;i++){ color=(color+5)%2550; leds[ledsInSnake[0]]=CHSV(255, 255, 0); for(int j = 0; j < 48; j++){ if (j!=0){ leds[ledsInSnake[j]]=CHSV(color/10,255, (j*255)/48); ledsInSnake[j-1]=ledsInSnake[j]; } } ledsInSnake[47]=(location+1)*-12+11-i; leds[ledsInSnake[47]]=CHSV(color/10,255, 255); FastLED.show(); delay(20); } } nextpath=random(0,2); for (int i=0; i<8;i++){//differen 8 if (corners[i][0]==-location || corners[i][1]==-location || corners[i][2]==-location){ if (corners[i][nextpath]!=-location){ location=corners[i][nextpath]; }else{ location=corners[i][nextpath+1]; } break; } }</p><p> FastLED.show(); delay(20); } } void fadeFromCenter( int duration){ unsigned long startTime; startTime=millis(); int counter = 0; while(startTime+duration>millis()){ counter=(counter+1)%255; for (int i=0;i<12;i++){ for (int j=0;j<6;j++){ leds[i*12+j]=CHSV((counter+j*15)%255,255,255); leds[i*12+11-j]=CHSV((counter+j*15)%255,255,255); } } FastLED.show(); delay(20); } } void loopThroughColors(int duration){ unsigned long startTime; startTime=millis(); int counter = 0; while(startTime+duration>millis()){ counter=(counter+1)%255; for ( int i=0;i</p><p>void rainbow(int duration){ unsigned long startTime; startTime=millis(); int counter = 0; while(startTime+duration>millis()){ counter=(counter+1)%255; for(int i = 0; i < NUM_LEDS; i++){ leds[i]=CHSV((i*5+counter)%255, 255, 255); } FastLED.show(); delay(20); } } void sparkles(int duration){ unsigned long startTime; startTime=millis(); int LENGTH = 40; int blink[LENGTH]; int color =0; for (int i=0;imillis()){ color=(color+5)%2550; leds[blink[0]]=CHSV(255, 255, 0); for(int i = 0; i < LENGTH; i++){ if (i!=0){ leds[blink[i]]=CHSV(color/10,255, (i*255)/LENGTH); blink[i-1]=blink[i]; } } blink[LENGTH-1]=random(0,NUM_LEDS); FastLED.show(); delay(50); } }</p> multiple_animations.ino Step 14: Enjoy Your Awesome Infinity Cube!! Original Source: https://www.instructables.com/id/Easy-Infinity-Cube/ 1 Link to comment Share on other sites More sharing options...
Recommended Posts