Friday, February 6, 2015

3D Printed Mini Tabletop Warp Core

3D Printed Mini Star Trek the Next Generation Warp Core  with Neopixles


Background:

I first found a model of the Star Trek Next Generation warp core on Thingiverse about a year ago. The designer made it large enough to be about the size of a table lamp. I ,of course, wanted one instantly, however, I was a little wary of the print time all of the pieces required. At the time, my Solidoodle 2 wasn't the most reliable machine for prints longer than an hour or two. The largest part on this model would take about 12 hours to print, which meant overnight, and me not being able to keep an eye on it.

One year and several modifications to the 3D printer later, this project seems incredibly doable. At the same time, I needed to come up with some Christmas presents for my geeky friends and brother. Christmas was just a few weeks away and I did not have the time to print 3 "full size" warp cores, and construct them.  At 25% scale however, I could do that.

Here is a video of the warp core completed, so you can know what you are getting into.


Here is the link for the video external to this page:

https://www.youtube.com/watch?v=Pi0VYY_Y1bo&feature=youtu.be


Construction:

All but one of the files needed are on the thingiverse page here:  Thingiverse: Tabletop warp core


All the parts are printed at 25% normal size, .3mm layer height, and 40% fill.
(They could probably be at a lower percentage fill, but this is just what I had my slicer set at.)

(All credit for the Warp Core 3D design needs to go to ThePlanetMike. His work on the 3D model is awesome.)


I also needed to design a platform of sorts for the warp core to sit on, but to also hold the Adafruit Trinket that drives the neopixel strip. Here is a link to that file on Thingiverse: 25% warp core base

http://www.thingiverse.com/thing:666957

The side opening for the USB port was designed to fit the mini USB male connector on a cable I bought from Amazon. It should be big enough to fit most USB mini connectors, but if not, it can be widened with an exact-o knife.

I left out the three white pieces that are in the center of the "Warp Core MARC4.stl" file. At that scale they were just too frustrating and brittle for me to mess with at the time. This ended up making a pretty cool light effect that can be seen later on.


Electronics:

I used the 5V version of the trinket sold by Adafruit right here: 5V Adafruit Trinket

Solder the header pins that come with the trinket to the board.





The underside of the board is going to be facing inward on the base. That is, towards the warp-core. Orienting it this way gives easy access to the reset button so the board can be reprogramed if you want to change the light effects. To fit in the base, and allow the USB plug to fit, the entire assembly needs to be pretty thin. To achieve this I used a piece of proto-board with copper traces cut to fit on the trinket.   




To make this work, some of the traces need to be cut with an Exact-o or equivalent. In the code that I provide, Pin 2 is used as the data pin. If you decide to use a different pin, obviously, you need to cut the traces in the way that works for your design.

IMPORTANT! Remove the black pin spacers from the header pins after you have soldered the pins in place. This lets the proto-board sit flush with the Trinket board. 

Trim the extra pin length that sticks over the proto-board as low as possible without compromising the solder joint. I saved these trimmed pieces to use to bridge the solder pads together!


How to orient the board and where to cut traces




Using the extra pin length to connect the Trinket pins to the copper traces

The 5V line, Pin 2 for data and then the ground pin on the opposite side.


The neopixel strips can be bought here: Adafruit Neopixel Strip X8

I used another set of 4 header pins to connect the two strips.

Even up the header spacer so there is approximately an even amount of pins on either side of the spacer. Then solder to the DOUT side of one of the strips. It is important to mate up the DOUT of one strip to the DIN of the other strip. Otherwise...it just won't work.



Then, solder the other side of the header to the DIN side of the other strip of LED's.


Finally, solder the DIN Pads of the LED Strip directly to the proto-board on the Trinket at a right angle. This is NOT a very structurally sound joint. It will need to be reinforced with hot glue. Otherwise there is a good chance that if bumped or moved, the pads on the LED strip will be ripped off the PCB. That's a bad thing.


Sorry, some of these pictures didn't come out perfectly. I think the idea gets across though.







Before you reinforce the joint with hot glue, this is a good point to program the board and make sure that everything is working. Just be gentle with the assembly.

The code is simple, and is easily modified to do different patterns and colors, please, feel free to do so.  To program the trinket you need to use a special configuration of the Arduino IDE that is provided on the Adafruit site. Once you have that downloaded, it programs just like any other Arduino. There are countless tutorials on the inter-webs about this so I won't repeat it here.

IMPORTANT! The 5V pin of the Trinket is only capable of supplying 150mA of current, for the code below, that is just fine. If you modify the code and turn on more LED's at once (including multiple colors on the same die) it might cause a brownout.

Here is the code that I used:



// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
#include <Adafruit_NeoPixel.h>

// Which pin on the Arduino is connected to the NeoPixels?
#define PIN            2

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS      16


// When we setup 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 = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 250; // delay for half a second

void setup() {
  pixels.begin(); // This initializes the NeoPixel library.
}

void loop() {
  // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.

while(1){
  for(int i = NUMPIXELS - 1; i >= (NUMPIXELS/2); i--) {
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(0,0,255)); // Blue Bright
    pixels.setPixelColor(i+2, pixels.Color(0,0,40)); // Blue Not So Bright
    pixels.setPixelColor((NUMPIXELS-1)-i, pixels.Color(0,0,255)); // Blue Bright
    pixels.setPixelColor((NUMPIXELS-3)-i, pixels.Color(0,0,40)); // Blue Not So Bright
    pixels.show(); // This sends the updated pixel color to the hardware.
    delay(delayval); // Delay for a period of time (in milliseconds).
    pixels.setPixelColor(i, pixels.Color(0,0,0));
    pixels.setPixelColor((NUMPIXELS-1)-i,pixels.Color(0,0,0)); // Setting the pixel to no output
    pixels.setPixelColor((NUMPIXELS-3)-i,pixels.Color(0,0,0)); // Setting the pixel to no output
    pixels.setPixelColor(i+2,pixels.Color(0,0,0));
    pixels.show();
  }
}
}



Just copy that code and flash it to the Trinket and you should have a blue strip that scans to the middle joint of the Neopixel strip. After that is working, reinforce the joint with hot glue.
Use hot glue to reinforce the joint

Use hot glue to reinforce the joint

Now, mount the electronics into the base. I like to plug in the USB cable and make sure the LED's are square from both the front and side and then hot glue the PCB into place.










All that is left is to assemble the warp core around the LED strips. I used super glue, but thin layers of hot glue would work as well.






If you look at the full scale version of the warp core, the middle most black support piece that holds the white light ring should probably be flipped. So its "base" is above the vertical pillars. Doing that makes the whole thing look a little better, but its a minor detail. 

These made great gifts and everyone who got one loved it!



2 comments:

  1. I didn't get one....Looks pretty good, nice job.

    ReplyDelete
  2. Perfect idea!! Another great invention in the field of 3d printing.... No wonder there will be a lot of good inventions in the future under this field.

    ReplyDelete