# Gemma 3D Printed Tree Topper

## Overview

https://www.youtube.com/watch?v=YOFb2wgu5GQ

Start a new tradition and design your own Tree Topper. Celebrate this holiday with DIY electronics from Adafruit. Our tutorial will show you how to use Autodesk's 123D Design software and a 3D Printer to create a custom tree topper.  
  
This is a great "Learn to 3D model & print" project as the shape is fairly simple, snaps together and can be customized.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/794/medium800thumb/gemma_topper.jpg?1448311358)

Info: 

## Prerequisite guides

- [Introducing Gemma](../../../../introducing-gemma) or [Introducing Gemma M0](../../../../adafruit-gemma-m0/)
- [NeoPixel Überguide](http://learn.adafruit.com/adafruit-neopixel-uberguide)

## Tools & Supplies

- Soldering iron
- Solder
- Scissors
- Wire strippers
- Wire spool set
- Double sided foam tape
- 3D Printer

## Parts

- Tree
- [GEMMA&nbsp;M0](https://www.adafruit.com/product/3501) or&nbsp;[GEMMA V2](http://www.adafruit.com/products/1222)
- [Slide Switch](http://www.adafruit.com/products/805)
- [Lithium Polymer Battery](http://www.adafruit.com/products/1578 "Link: http://www.adafruit.com/products/1578")
- [NeoPixel Strips](http://www.adafruit.com/index.php?main_page=adasearch&q=neopixel+strip)

# Gemma 3D Printed Tree Topper

## Circuit Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/012/746/medium800/gemma_treeTop-circuit-Layout.jpg?1386361085)

Info: 

## Prototype Circuit

Use small alligator clips to connect the components together for testing; we’ll solder it up later. The pins on the NeoPixel strip are small, so be sure to double check your connections if your having trouble getting them to light up. It might be easier to solder wires to the NeoPixel strip and then alligator clip to those. The NeoPixel strips digital input connects to pin **D1** of the Gemma. The negative connection of the NeoPixel strip goes to the ground pin on the Gemma. The positive power wire of the NeoPixel LED strip connects to the **Vout** pin of the Gemma (_not_ 3Vo!).   
  
If you have all your connections securely clipped, attach the rechargeable battery to the JST port on the Gemma to power it on. The NeoPixel LEDs won't light up because there's no code loaded on the Gemma yet! Use a USB cable to connect the Gemma to your desktop.

Even though the current “v2” and “M0” versions of Gemma now include an onboard power switch, we’ll be **leaving it&nbsp;in the “on” position** and adding **a separate switch of our own** , so the circuit&nbsp;can be easily turned on or off after it’s&nbsp;installed in the 3D-printed case.

# Gemma 3D Printed Tree Topper

## Arduino Code

Info: 

## The Code

The Gemma is programmed via USB with the Arduino IDE. You can modify and customize the code to fit your setup. For starters, we can easy change the pin outs and number of NeoPixels. In our setup, our tree topper used 36 NeoPixels.   
  
If your new to using the Gemma and the Arduino IDE, check out [this guide for the original Gemma](http://learn.adafruit.com/introducing-gemma/setting-up-with-arduino-ide "Link: http://learn.adafruit.com/introducing-gemma/setting-up-with-arduino-ide")&nbsp; or [this guide for the Gemma M0](../../../../adafruit-gemma-m0/)for setting up. Have some extra time on your hands? Learn how to [customize](http://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library) the code to change the animation sequence!  
  
We slightly modified another project’s&nbsp;code to use a single purple color, but you can change it to whatever you like! Look for this line&nbsp;where a hexadecimal&nbsp;color value is listed (around line 10):

```
uint32_t color = 0xA000A0;
```

Just replace&nbsp;"#A000A0" with whatever&nbsp;hex color value you want, it's that easy!

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Gemma/Gemma_3D_Printed_Tree_Topper/Gemma_3D_Printed_Tree_Topper.ino

## Test Code

Once you have the code loaded to the Gemma from the Arduino IDE, it should automatically run and make&nbsp;the Gemma to light up the NeoPixel strip. If your having problems or issues getting it to work, check your connections and be sure to skim&nbsp;the Gemma and NeoPixel guides.

# Gemma 3D Printed Tree Topper

## CircuitPython Code

![](https://cdn-learn.adafruit.com/assets/assets/000/046/291/medium800/gemma_CircuitPython-Gemma-w-Blinka.jpg?1505234261)

 **GEMMA&nbsp;M0** boards can&nbsp;run **CircuitPython** &nbsp;— a different approach to programming compared to Arduino sketches. In fact, **CircuitPython comes&nbsp;factory pre-loaded on GEMMA&nbsp;M0**. If you’ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the [**Adafruit GEMMA&nbsp;M0 guide**](../../../../adafruit-gemma-m0/circuitpython-setup-1).

Info: 

Below is CircuitPython code that works&nbsp;similarly&nbsp;to&nbsp;the Arduino sketch shown on&nbsp;theprior page. To use this, plug the GEMMA M0 into USB…it should show up on your computer as a small **flash drive** …then edit the file “ **code.py** ” with your text editor of choice. Select and copy the code below and paste it into that file, **entirely replacing its contents** (don’t mix it in with lingering bits of old code). When you save the file, the code should **start running almost immediately** &nbsp;(if not, see notes at the bottom of this page).

**If GEMMA M0 doesn’t show up as a&nbsp;drive, follow the GEMMA M0 guide link above to prepare the board for CircuitPython.**

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Gemma/Gemma_3D_Printed_Tree_Topper/code.py

This code requires the **neopixel.py** library. A factory-fresh board will have this already installed. If you’ve just reloaded the board with CircuitPython, create the “lib” directory and then [download neopixel.py from Github](https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel).

# Gemma 3D Printed Tree Topper

## Model & Design

## Ideate
Most common tree toppers designs are in the shape of a star, but yours can be what ever shape you desire! We used our Adafruit logo for the base shape. Do a bit of googling to find images of tree toppers for inspiration, there are so many! For more homework, why not explore the thingiverse site for ideas that have been printed.  

## Create Artwork
We used illustrator to create the Adafruit logo, but you can any use any freeware open sourced vector art programs. It's best to use a solid shape and avoid complex patterns that might be too small to make on a 3D printer. Our Adafruit logo has five holes in the center that is simple enough to turn into an extruded shape.  
## Import SVG
After you have your base shape, merge the paths so they are manifold and save it out as an SVG. The dimensions of your vectors doesn't have to be exact, you will modify the size in the modeling app.   
  
In Autodesk 123D Design web app, import your SVG by selecting "Import" under the file menu (or command+shift+i). Your shape will load into the scene with the option to resize the dimensions. You must click on the grid layout to accept and load the shape.   
  

## Measure & Size
Once you click, you should see arrow handles appear on the shape. These allow you to move the object around in the grid. Use a measuring tool to determine the overall size of your tree topper. If you have a reference topper handy, measure the dimensions and compare it to the max build size of your 3D printer (make it as big as you can!). You can resize the shape at any time by selecting the object and changing the input values at the bottom of the UI. Use the "lock" icon to scale proportionately.   
![](https://cdn-learn.adafruit.com/assets/assets/000/012/722/medium800/gemma_Screen_Shot_2013-12-06_at_12.05.55_PM.png?1386358499)

## Save & Export
Once you have resized your shape to your desired measurements, save your project. With your design named and saved, goto the top right and click on your username. Select "My Projects" and then click on the "Models" link in the left sidebar. Locate your design and click on the thumbnail. Click the big blue Edit/Download button and select "Download 3D Models" from the drop down. Check the .smb file and select "Download Models" (you won't need the STL or recipe files).  
  

## 123D Desktop App
Withe the app downloaded, click open and select the "browse my computer" tab to navigate to your downloaded design (the .smb file). Select your design to open it. The desktop app is similar to the web app but different in terms of boolean operations (combining and subtracting shapes versus object types like solids and voids). We found the current web app to be a bit slower and unstable at times but feel free to test both of them out and see which one works for you.  
  
![](https://cdn-learn.adafruit.com/assets/assets/000/012/723/medium800/gemma_Screen_Shot_2013-12-06_at_2.37.15_PM.png?1386358666)

[Download 123D Design](http://123dapp.com/design#download)
## Extrude Object
Once you have the shape loaded and set to your desired measurements, you will need to make a duplicate of the shape and move it down and out of the way for now (don't delete this, you will need it for creating the cover) Extrude the shape so its thick enough to create a shell and hollow it out. To extrude, click on the shape to select it and then click once more on the top face. It should highlight blue. A gear icon will appear close to the object. Click on the gear icon and select the Press/Pull option. Enter the your desired distance for the height of the object. Test and see how thick you want your tree topper to be. Since you will be using NeoPixel strips inside the shape, it should be at least 12mm thick (Our tree topper is 20mm thick).  
## Shell Object
With your shape extruded to the desired thickness, click on the object to select it and then click on the top face to highlight it blue again. Click on the gear icon and choose the shell option. A new options menu will appear at the bottom of the screen. Put the value "1" in the input box of the Thickness Inside option. Click on an empty space in the grid to accept or hit enter to complete the shell function.  
  

## Remove Access
In our shape, we have undesired edges that were created during the shelling process. We can easily remove these sharp edges by subtracting with a few shapes. Simple cylinders can be added and subtracted to the shape by using the combine function. We used a total of 5 new cylinders to cut of our unwanted edges. This step is optional if your shape is simple and doesn't have any unwanted edges. Once you have your desired shell, now is a good time to save it!![](https://cdn-learn.adafruit.com/assets/assets/000/012/724/medium800/gemma_Screen_Shot_2013-12-06_at_2.42.17_PM.png?1386358966)

## Creating Cover
Move the duplicated base shape back to your work area. You will need to create 2 more duplicates (a total of 3 base shapes) to create a snap on cover. We need to make an inner edge on the cover so it can snap to the inside of the shell we created. To do this, we will create a shell out of one of the duplicates. Use a thickness of 1.3mm.  
  
In our shape, we had to fill in the five holes that are in the center of our shape because we were having issues removing the access edges. We moved simple cubes to the holes and merged them to the duplicates to create a solid shape. This step is optional if you have a simple shape with no cut outs.  
![](https://cdn-learn.adafruit.com/assets/assets/000/012/725/medium800/gemma_Screen_Shot_2013-12-06_at_2.45.01_PM.png?1386359224)

![](https://cdn-learn.adafruit.com/assets/assets/000/012/726/medium800/gemma_Screen_Shot_2013-12-06_at_2.45.35_PM.png?1386359280)

Once your cover is shelled, you should now have a frame. Align this new frame to the next duplicate shape and position it flush to the object. Click on the "Combine" icon in the top menu. Select the base shape that is inside of the shelled frame first, and then selected the the shelled frame. Now choose "Subtract" from the floating combine options menu. Click on an empty space in the grid to accept.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/727/medium800/gemma_Screen_Shot_2013-12-06_at_2.45.45_PM.png?1386359314)

With your newly cut base shape selected, click on the top and bottom faces to highlight them blue. Use the shell function found in the floating gear menu. Enter the value "1" into the thickness inside option and hit enter to accept the function. Now you have your inner frame that should snap tightly onto your shelled case. Move the frame onto the bottom of the last remaining duplicate base shape and combine them together to make one object.

## Creating Cone
Under the primitives shapes menu at the top, select a cone object. Move your mouse around in the grid and click to load a new cone shaped object. Our cone shape was 100mm in height with a radius of 15. We need to cut off 20mm from the top of the cone using a primitive cube shape.![](https://cdn-learn.adafruit.com/assets/assets/000/012/728/medium800/gemma_Screen_Shot_2013-12-06_at_2.50.09_PM.png?1386359474)

With your newly trimmed cone, create a duplicate. Reposition and rotate the duplicate cone shape to the bottom of your shell shape or desired location. We are going to use this duplicate to make a cutout so the shell can fit on top of the cone. Use the combine and subtract option to cut the cone from the shell. Now you should have a hole in your shell.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/731/medium800/gemma_Screen_Shot_2013-12-06_at_2.50.27_PM.png?1386359505)

Next, you will need to select the original cone. Select the top and bottom face of the cone to highlight it blue. Click on the gear icon and select shell. Use 1mm thickness.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/734/medium800/gemma_Screen_Shot_2013-12-06_at_2.53.22_PM.png?1386359634)

## Export STLs
Now you have your three pieces. The case, cover and cone. You will need to export each piece out individually as an STL. Use the top left menu (under the 123d logo) and select "Export STL". With your three stl's export, now its time to slice and 3d print them!# Gemma 3D Printed Tree Topper

## 3D Printing

Depending on your 3D Printer, you will need to use a slicing program that supports your hardware. We're using a Makerbot Replicator 2 and slicing with MakerWare. We recommend using transparent PLA material for the cover, shell and cone. Transparent PLA difuses and softens the lights from the NeoPixel LEDs.

Our three piece enclosure design will house the Gemma, a recharger battery and the slide switch. The cover is designed to mount a slide switch on top for easy powering access. The cover snaps onto the top of the case. The hanger can be attached to the back of the base. The hanger has a hole that fits on to a small branch or twig. The case design is slim and non-intrusive.

[Download Gemma Case](http://www.thingiverse.com/thing:195471)
# Printing Techniques
**Build Plate Preparations**  
There's a great [video tutorial](http://www.youtube.com/watch?v=VDnBXpFa7DY) by Dr. Henry Thomas who demonstrations a great technique for preparing acrylic build plates for awesome prints. Wipe down the plate with a paper towel lightly dabbed in acetone. Use another paper towel and apply a tiny dab of olive oil. Wipe down the plate so a small film of oil is applied, this will allow the parts to come off the plate easier.  
  
**Live Level**  
We recommend going raft-less for each piece because it will have the best quality result. Each piece will require a well leveled platform. We tend to "live level" our prints, meaning we adjust the build plates thumb screws while the print is laying down filament. This way we can make adjustments directly and improve the leveling by seeing how the extruders are laying down the first layer onto the build plate. We recommend watching the first layer so that you get a more successful print. If you see the layers aren't sticking or getting knocked off, you can always cancel print, peel it off and try again. Once your pieces are printed, test out to see if the cover tightly snaps onto the case. Check to see if the slide switch fit through the cutout on the cover. If its too tight, you can use an X-Acto knife to shave off the edges. If its too lose, you can secure it in place with adhesive. The hanger will be attached to the back of the case with doubled-sided foam tape. Set these pieces aside for now. It's time to prototype some circuits!

# Gemma 3D Printed Tree Topper

## Build

## Solder Connections

Once your have a working prototype, you will need to solder wires to the Gemma and NeoPixel strip for a solid connection. Start by measuring the length of wires you will need for the NeoPixel strip. We used the height of our cone as reference since it needs to reach to the end of the cone with some extra slack. You can use alligator clips to extend the topper and NeoPixel strip away from the Gemma and battery.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/771/medium800/gemma-solder.jpg?1386362808)

Start off by applying small blobs of solder to the pins on the Gemma. This will make it easier to solder three wires to the gemma. We color coded them so we could easily tell them apart. Red wire is the VBat positive connection. The blue wire is the digital input D1. The black wire is the GND ground pin.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/774/medium800/gemma_neopixel-solder.jpg?1386362857)

Add small blobs of solder to the pins of the strip where the arrows are pointing to the right. These will make it easier to solder wires to these pins. Solder three wires to these pins on the NeoPixel strip. Black wire goes to the GND ground pin. Blue wire goes to the DI digital in pin. Red wire goes to the +5V positive pin.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/784/medium800/gemma_switch-solder.jpg?1386364081)

![](https://cdn-learn.adafruit.com/assets/assets/000/012/776/medium800/gemma_switch-battery.jpg?1386362887)

Cut the red wire from the rechargeable battery in half. Expose some wire with wire strippers. We will need to solder a slide switch to these two ends. One in the middle, and the other to either the left or right. This will allow us to easily turn on and off the circuit.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/770/medium800/gemma-box.jpg?1386362791)

Place the Gemma first inside the enclosure. Use a piece of double-sided foam tape to secure it to the bottom of the case. Slide the wires of the Gemma through the slit. Lay the battery on top of the Gemma and push the slide switch through the cut of of the cover. Snap on the cover.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/772/medium800/gemma_neopixel-shape.jpg?1386362826)

Start by positioning the wires of the NeoPixel strip to the bottom hole cut out of the cone. NeoPixel Strips are friendly and can be cut to whatever size you want, just be sure to follow the cut indicator on the strip. Removing the protective gel allows you to bend it to the shape of your tree topper. Carefuly bend the strip to the inner lining of the shape.

![](https://cdn-learn.adafruit.com/assets/assets/000/012/769/medium800/gemma_treetopper.jpg?1386362773)

Snap the cover on and secure the cone by using some hot glue or your preferred adhesive. Now you can test out your circuit to see if it still works. If it's all good, time go place it on the tree!

**The battery will need occasional recharging. To do this, open the round case, disconnect the battery from the Gemma board and plug it into a LiPoly charger such as our [Micro Lipo](https://www.adafruit.com/product/1304). The switch we added needs to be in the “on” position or the battery won’t charge! A full charge from a depleted state should take about three hours.**


## Featured Products

### Adafruit GEMMA v2 - Miniature wearable electronic platform

[Adafruit GEMMA v2 - Miniature wearable electronic platform](https://www.adafruit.com/product/1222)
 **Deprecation Warning: The Gemma bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Gemma so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1222)
[Related Guides to the Product](https://learn.adafruit.com/products/1222/guides)
### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
### Adafruit NeoPixel Digital RGB LED Strip - White 60 LED

[Adafruit NeoPixel Digital RGB LED Strip - White 60 LED](https://www.adafruit.com/product/1138)
You thought it couldn't get better than [our world-famous 32-LED-per-meter Digital LED strip](http://adafruit.com/products/306) but we will prove you wrong! You wanted **twice the LEDs**? We got it (well, its 1.875 times as many but that's within a margin of...

In Stock
[Buy Now](https://www.adafruit.com/product/1138)
[Related Guides to the Product](https://learn.adafruit.com/products/1138/guides)
### Lithium Ion Polymer Battery - 3.7v 500mAh

[Lithium Ion Polymer Battery - 3.7v 500mAh](https://www.adafruit.com/product/1578)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 500mAh for a total of about 1.9 Wh. If you need a larger (or smaller!) battery, <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/1578)
[Related Guides to the Product](https://learn.adafruit.com/products/1578/guides)
### Adafruit Micro Lipo - USB LiIon/LiPoly charger

[Adafruit Micro Lipo - USB LiIon/LiPoly charger](https://www.adafruit.com/product/1304)
Oh so adorable, this is the tiniest little lipo charger, so handy you can keep it any project box! Its also easy to use. Simply plug in the gold plated contacts into any USB port and a 3.7V/4.2V lithium polymer or lithium ion rechargeable battery into the JST plug on the other end. There are...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1304)
[Related Guides to the Product](https://learn.adafruit.com/products/1304/guides)
### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

In Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
### Hakko Professional Quality 20-30 AWG Wire Strippers

[Hakko Professional Quality 20-30 AWG Wire Strippers](https://www.adafruit.com/product/527)
These are the finest wire strippers we have used, and if you have to do a lot of wiring, you will agree! They have soft rounded grips - very comfortable to use, and precision ground notches that do a perfect job every time. No more yanking or twisting to strip wires cleanly and quickly.<br...></br...>

In Stock
[Buy Now](https://www.adafruit.com/product/527)
[Related Guides to the Product](https://learn.adafruit.com/products/527/guides)
### Hook-up Wire Spool Set - 22AWG Solid Core - 6 x 25 ft

[Hook-up Wire Spool Set - 22AWG Solid Core - 6 x 25 ft](https://www.adafruit.com/product/1311)
Perfect for bread-boarding, free wiring, etc. This box contains 6 spools of solid-core wire. The wire is easy to solder to and when bent it keeps its shape pretty well. We like to have a few spools of this stuff around which is why this set is quite nice! We suggest picking up wire strippers...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1311)
[Related Guides to the Product](https://learn.adafruit.com/products/1311/guides)

## Related Guides

- [Chirping Plush Owl Toy](https://learn.adafruit.com/chirping-plush-owl-toy.md)
- [NeoPixel Ring Bangle Bracelet](https://learn.adafruit.com/neopixel-ring-bangle-bracelet.md)
- [VU Meter Baseball Hat](https://learn.adafruit.com/vu-meter-baseball-hat.md)
- [Using Servos With CircuitPython and Arduino](https://learn.adafruit.com/using-servos-with-circuitpython.md)
- [NeoPixel Flame Torch](https://learn.adafruit.com/neopixel-flame-torch.md)
- [LED Masquerade Masks](https://learn.adafruit.com/led-masquerade-masks.md)
- [Superhero Power Plant](https://learn.adafruit.com/superhero-power-plant.md)
- [3D Printed LED Buckle](https://learn.adafruit.com/3d-printed-led-buckle.md)
- [Disco Band Camp Jacket](https://learn.adafruit.com/disco-band-camp-jacket.md)
- [NeoPixel Fairy Crown](https://learn.adafruit.com/neopixel-fairy-crown.md)
- [Sewable NeoPixels](https://learn.adafruit.com/flora-rgb-smart-pixels.md)
- [CircuitPython Essentials](https://learn.adafruit.com/circuitpython-essentials.md)
- [Your Very First Circuit Sculpture](https://learn.adafruit.com/first-simple-circuit-sculpture.md)
- [Archimedes' Boat](https://learn.adafruit.com/archimedes-boat.md)
- [Glowing Beehive Hairdo Wig](https://learn.adafruit.com/glowing-beehive-hairdo-wig.md)
