Intro: IcosaLEDron: a Multi LED Smart Ball
What is an IcosaLEDron? It's a programmable, rechargeable 20 sided "ball" with a RGB LED on each face. Inside is a custom PCB equipped with the Atmega328p that is Arduino compatible allowing for easy programming of different effects. With twenty WS2812B LEDs (also known as Neopixels) positioned equally around, and a 3-axis accelerometer, the IcosaLEDron is a spherical platform for creating light effects based on accelerations applied to the ball. After doing custom MEMS inertial sensor development we decided to do a project using off the shelf MEMS accelerometers. This is our first project using 3D printing and Arduino.
The base program senses Up on the ball and will illuminate the top LED accordingly, no matter how you rotate it. When the accelerometer senses freefall, the ball lights all LEDs in a rainbow pattern creating a vibrant show of light and color. When no motion is measured, the electronics will go to sleep, doing away with a power switch. Designed to be open source and easily programmable, we invite people to consider the possibilities of this platform. Imagine using the IcosaLEDron as a die that when rolled will light a random number of faces, or a Simon Says like memory game where you rotate the ball to match a pattern set by the device.
With the IcosaLEDron, we hope to excite makers and programmers to build there own, create and share custom codes, and help build a community of happy owners.
Step 1: Development
From the beginning of our work on a LED “smart” ball, 3D printing of parts has allowed for ideas to develop easily. We were able to produce several concepts, modify, and iterate designs that same day in most situations. Throughout the design process, the basic concept behind the IcosaLEDron remained the same -- a geometric plastic frame housing electronics to power and control a number of LEDs positioned evenly around a rubber spherical shell.
A few designs were tested before our focus shifted to a shape that could be unfolded and wired up easily. This was an icosahedron, which could be printed flat, assembled, and folded up. It has been designed to allow for a frustration free assembly despite its small size; about that of a baseball. With interlocking pegs and fasteners that have developed over several iterations, the IcosaLEDron is quite sturdy when complete.
Step 2: 3D Printing of Mechanical Parts
Download and print the files found here: Thingiverse -- IcosaLEDron
This includes rigid plastic pieces printed in ABS or PLA, and the rubber outer which we print with NinjaFlex Water (semi-transparent) thermoplastic elastomer (TPE) filament. These two pieces will later be super glued together.
All parts are printable flat side down and without supports. NinjaFlex may be difficult to use on some printers. To address this we have been experimenting with casting the piece in transparent rubber.
For rapid prototyping, 3D printing is becoming more and more accessible. Anyone with some modeling and CAD skills can bring virtual objects, intricate and precise, to reality in plastic. One of the greatest things about 3D printing is the progressively active sharing of quality models online. Sites like Thingiverse, YouMagine, etc. provide a venue for sharing user submitted models free to download ranging from the sculptural to the useful.
Step 3: Circuit Design
Circuit design is the first step for building the electronics. There are a number of free or low cost schematic and layout tools available.
- Eagle– Eagle CAD is very common (you can directly upload Eagle board files to OSHpark), low cost and relatively easy to use. Tutorials are available here, here, and here.
- KiCAD – An open source free tool that is also popular.
- Fritzing – Fritzing is another open source tool.
If you’ve created a breadboard version of an Arduino compatible board then you have a good idea what the circuit schematic should look like. If not, begin by looking at some open source examples of microcontroller boards. All of the Arduino boards are open source and have a schematic available. Also, examine the datasheet for the Atmel processor and other components going on the board. The integrated circuit vendors often have helpful information in the data sheets and application notes. Component selection must also be considered during the design process. Don’t be afraid to use SMT devices – they can easily be soldered to the board by a number of DIY methods (fine pitch BGAs are a bit scarier though). Ideally, when the schematic is complete, you will have all the components correctly selected. This means you have identified the type of package each component has as well as a vendor for every part (Octopart can really help here). For the example project, we’re making a board with an Atmega328p and a MMA8652 3 axis accelerometer on board as can be seen in the schematic. This PCB also has a built in charger for a LiPo battery and a six pin connection for programming via an AVR type connection.
Step 4: Board Layout
After the schematic design is complete it’s time to move to layout. In this step you are locating where each component will go on the board and routing the electrical connections. Important parameters such as board size, number of board layers, and minimum space and trace width must be determined first. In general cost increases as the number of layers increases and the minimum space and trace width decreases. For a beginner project two layer boards are inexpensive and general sufficient for simple Arduino boards.
More advanced tools have auto placement and routing that makes this process go quickly. The Eagle auto router works fairly well but I still place components manually. Given that these circuits are relatively low frequency, component placement is not extremely critical (after all a breadboard version usually works). But, for manual component placing, it’s best to keep associated components together on the board. For example, most Atmel microcontrollers can use a crystal oscillator. Placing the crystal near the associated pins on the microcontroller is good. This minimizes the number of vias and trace length required to connect the crystal to the microcontroller.
After placing and routing, perform a design rule check. At minimum, this step checks that all independent electrical signals are separated by the minimum space that can be etched on the board. Design rule files can be created or downloaded from the fabrication vendor.
Step 5: Board Fabrication
If the board has passed design rule check then it’s time to submit the files to the fabrication vendor. Many vendors are available now. Getting a board made is easier and cheaper than ever. A few I have used are listed below.
I use OSHpark most often. They are not the cheapest but it’s easy to use and relatively fast. Their website accepts Eagle board files. Directly uploaded Eagle board files are converted and preview images are created. Other sites generally accept gerber files. Eagle will generate gerber files – you’ll have to use the CAM processor and associated .cam files. These files can typically be downloaded from the fabrication vendor or you can create one. For making gerber files for a specific vendor follow their instructions and advice. gerbv is an open source gerber viewer that's easy to use. Checking your newly created gerber files is a good idea.
Step 6: Board Assembly
Board assembly requires the following:
- all the electronic components
- Solder paste
- Stencil mask or other solder paste application implement
- Reflow tool
Manual assembly of the components onto the board is the best way to go when making a few prototypes. To do this assembly place solder paste by hand or using a stencil. Sparkfun has a nice stenciling tutorial. Another option is to use a sharp probe to place solder paste individually on each pad on the PCB. This is slower than the stencil approach but it is good enough when doing one board at a time. Then, using tweezers place each component on the board. Having an optical microscope helps but the work can still be done without a microscope.
After placing all components reflow the solder. The simplest method is to use and electric skillet or a hot plate. A number of DIY reflow oven projects have been done that work as well. The skillet method is probably the easiest to start with. This board was reflowed on a Oster electric skillet from Target. Place your board on the skillet. Turn the temperature setting to about 400 degrees F. Wait about 5 minutes. Turn off the skillet. Let the board cool a few minutes before removing it from the skillet. This method should produce the approximate temperature profile required for surface mount soldering of most components.
At this point you should have a fabricated board that is ready to be programmed.
Step 7: Programming the Micro Controller
The micro controller is an Atmega328p so it can be programmed using the Arduino IDE. The method discussed here uses an Arduino Mega 1280 as an ISP. First, connect the Arduino Mega to a six pin ISP connector. This example uses a pogo pin adapter from Sparkfun. Six connections must be made to the Arduino Mega from the pogo pin adapter. Reset connects to pin 53. MOSI connects to 51. MISO connects to 50. SCK connects to 52. Vcc connects to +5 and ground connects to ground on the Arduino board. The ArduinoISP example sketch comes preloaded with version 1.06 of the Arduino IDE. The comments of this sketch also list these connections. After connecting the Mega to the pogo pin adapter the pins are pressed onto the board. To use the Arduino Mega as an ISP in the IDE select the “Arduino as ISP” programmer under “Tools/Programmer.” From this point you can directly upload you code with the “Upload using programmer” under “File.” Control-shift-u performs the same command. Another option is to load an Arduino bootloader. The PCB for this project runs at 8MHz and 3.3V so choosing the “Arduino Pro or Pro Mini (3.3V, 8MHz) w/Atmega328” board under the “Tools/Board” menu will select the correct bootloader. To burn the bootloader use “Burn bootloader” in the “Tools” menu.
Step 8: Assembly Parts List
Gather the parts required to assemble the IcosaLEDron. This will include the 3D printed parts and assembled circuit board from previous steps, as well as hardware and glue.
3D printed parts
- Icosahedron net: 3D printed in ABS or PLA
- Flexible, transparent outer icosahedron: 3D transparent NinjaFlex, or experimental cast rubber
- Chassis for PCB and battery: 3D printed in ABS or PLA
- 2x Fastening caps: 3D printed in ABS or PLA
- Super Glue
- 2x M2 washers
- 4x M2 Hex nuts
- 2x 16 mm long M2 screws
- 6x 4 mm long M2 screws
- 1x 6 mm long M2 screws
- 1x Micro controller board
- 20x WS2812B RGB LEDs
- Wire: Stranded 28 or 30 gauge
- 1x LiPo Battery 400 to 500 mAh capacity
- Right angle header
- Soldering Iron and Solder
- Wire cutter/stripper
- Phillips screwdriver
Step 9: Final Assembly Part One: Gluing
Some parts will need to be glued together to ensure durability and to keep pieces from breaking free inside the ball. Super glue is recommended; it's inexpensive and fuses plastics together well. It is messy so avoid using on any nice furniture.
1. The flexible outer icosahedron needs to be adhered to the hard plastic icosahedron net, laminating the two pieces together. Place hard plastic net smooth side up on sturdy flat surface. Apply glue in a continuous bead tracing the triangles. Align soft shell net over frame and press onto glued surface. Excess glue will probably seep out and should be removed. Putting something like a book or box on top of the pieces across the top evenly for several minutes helps ensure it stays together.
2. After the glue has set from the previous step, flip the piece over. Glue the LEDs in place - notice wiring direction arrows on back of each LED chip. The arrows need to be pointing Up one side and Down the other, beginning with the triangle marked as number one and moving up. Apply glue in drops at top and bottom of each square cut out. Press LED boards into cut outs, light emitting side facing outward towards outer shell. Let set for several minutes before soldering wires on.
3. Press one M2 Hex nut into the slot located in the middle of the first stand off at edge of icosahedron net. This is what the final closing screw will thread into.
Step 10: Final Assembly Part Two: Wiring
In this step the micro controller board, battery, and LEDs will be connected. This will require the two piece frame with LEDs assembled in the previous step, the 3D printed chassis for the board and battery, complete micro controller board, and LiPo battery. Six pin header, solder, and some hardware will also be used at this point.
- Attach board and battery to chassis and connect battery.
- Begin by soldering the right angle six pen header to the designated through holes on the board, making sure it is angled up and away from components on surface of micro controller.
- Screw board to 3D printed chassis. First press two M2 hex nuts into hex shaped indentations on one side of chassis. Set micro controller board, components up, header pins facing toward indicator, on flat surface of chassis. Align the two screw holes on board with those on chassis and affix using 4mm M2 screws, through hex nuts on the opposite side.
- Slide battery into holder on underside of carriage, careful not to scrape against any screw heads that may be exposed. Using the designated screw lengths should prevent any obstruction. The battery will fit tightly.
- Connect battery to board. Although a plug is possible and exists in later versions of this device, the battery will be soldered directly to the board here. For this the plug attached to the battery leads will be removed. Cut each wire individually so as not to be shocked or damage the battery. Solder the positive lead, red wire, to hole labeled V+ and the black wire to GND on board where the two holes exist. Be careful not to touch the exposed wire ends together or to other parts of the board.
Wire all LEDs together in the direction designated by arrows on back of each. You will need cuts of wire in two different lengths here -- about half an inch for the short distances (14 instances), and two inches for the longer stretches (5 instances). It is helpful to applying a small amount of solder to the LED connections and wire ends first. Using tweezers to hold the wires is helpful. Beginning with the first LED, solder short wires up to the third LED in the column. Use the longer cuts of wire to bridge over to adjacent LED with arrows pointing down. Continue wiring the columns of LEDs together Up one side Down the other with short wires, and from one row to the next with the longer ones. Note that between the 10th and 11th LED the longer cuts of wire need to be used to avoid the upright where the board and battery chassis will be attached to.
Prepare to connect LEDs to board. A third length of wire, about three inches will be used here. While the IcosaLEDron is still unfolded, solder these wires to the first LED. It is helpful to indicate on each wire with a black marker which corresponds to 5v, GND, and DIN. Wait to solder to micro controller.
Attach board and battery carriage to IcosaLEDron net. Notice the two wedge shaped uprights designed for attaching chassis assembly to frame. First screw back of chassis, side opposite header pins, to the center upright using two 4mm screws. Fold the net so that the front of the chassis assembly's screw holes correspond to those on the upright at edge of net, and affix with two more 4mm screws. Half of the IcosaLEDron takes shape, board on top and battery down and inwards.
Connect wires attached to the first LED from step 3 above to micro controller board. With the IcosaLEDron half folded up, solder the corresponding wires from LED one to the three contacts on board; 5v on LED to +V on board, Din on LED to DATA on board, and gnd to GND. At this point, the IcosaLEDron will be lighting up and responding to motion.
Step 11: Final Assembly Part Three: Fold Up
Now you can see the IcosaLEDron taking shape, all that remains are the end caps holding the corners together from inside. Prepare the caps first by pressing a nut into the hex shaped indention on both, put a washer on a 16 mm screw and thread through the inside of each cap only a little. Fold tightly into a ball and you will notice the four internal pegs at either end come together. You will also notice a front flap results which you can access the board and end caps. Hold the shape together and slide end cap and screw combination into place, snapping over the internal pegs. Tighten screw to securely hold the corners together, but be cautious to not puncture the battery. The washer should go past the flexible outer layer and rest on the corners of the rigid plastic, keeping the head of the screw from sticking out past the shell. Repeat for the other side. The front flap can now be closed and secured with a 6 mm screw from the outside.
Charging and Programming
The circuit board has a LiPo charging circuit built into it. Use a FTDI cable that converts USB to serial to charge and program the device. The six pin plug connects to the header on the circuit board. The black wire on the FTDI cable should be on the closest to the pin labeled GND on the header. With this FTDI cable, you can talk to the board using the Arduino IDE.
Congratulations, you have successfully assembled the IcosaLEDron! We appreciate all feedback and look forward to hearing what people are doing with there own multi-LED smart ball.