Project showcase

3D Print a LED Matrix Display © GPL3+

The circuit was printed with the Electrifi conductive filament in 15 min. All 64 WS2812b SMD LEDs were attached to the circuits in 20 min.

  • 1,819 views
  • 2 comments
  • 5 respects

Components and supplies

About this project

Introduction

In this tutorial I'll go through how to make a 3D printed LED matrix display using Electrifi Filament and WS2812 LEDs, also called a 'Neopixel' by Adafruit. With one 17-meter-long spool of Electrifi Filament, you can print 14 of the smaller LED matrices, or 11 of the larger ones. To learn more about the WS2812, I refer you to the Neopixel Uberguide. Briefly, each one of these WS2812 LED chips are individually addressable via a data line that goes from chip to chip across the array. To make a matrix display, you only need three inputs - power, ground, and a data line. Adafruit and others have created Arduino libraries that allow you to easily control the chips, allowing you to scroll text or animations in 24 bit color.

Step 1: Make the LED Matrix in Inkscape

I made the LED matrix display circuit using the same software process as in the LED Art instructable. It took me about 7 iterations to get this circuit right, but since I could print out each iteration in about 20 minutes with the Electrifi filament, the optimization process was pretty quick. I used the 5050 LED package again, but I removed the two middle pads from the package since the WS2812 doesn't have those. Also, I made some screw-type terminals to make better contact between the wires and the Electrifi Filament. Above are pictures of the finished circuits and here is the software files. The matrix on the left is pretty close to the smallest (77 by 117 mm) that can be made reliably, while the matrix on the right is about the biggest (120 by 144 mm) I can make with our 3D printer.

Step 2: Place the components and wire up the matrix.

To assemble the matrix you will need the following items:

  • Nuts, bolts, and washers (we used size #6 for this project).

LEDs

Just like normal LEDs, the WS2812B RGB LED has to be wired up with the right polarity (connections to positive and ground) for it to work. See the picture of the WS2812B with its pins labeled. Unlike normal LEDs, you can't just apply power to the WS2812B and have it light up, you have to send a string of voltage pulses through the data pin in order to tell it the intensity and the color of light you want.

Now take a look at the picture of the completed neopixel matrix display. To place the LEDs, I used a solder reflow tool to heat up the pads before squishing the LEDs into the Electrifi Filament, just like in this LED nametag video. Note that for each column of LEDs, the direction of the ground alternates from top to bottom. You can see this in the image because the black microchip, which is on the ground side of the LED, switches which side of the LED its on from column to column. This is to allow the data line to snake in an S pattern back and forth across the circuit, allowing for the printing of an LED matrix display in a single layer. This data connection between the LEDs allows you to control their color individually with a microcontroller, but if one LED is placed the wrong way and the data line is cut, all the LEDs after that cut won't light up. So be careful!

Power

After placing the LEDs, I hooked the matrix up to a lithium polymer ion battery for power, and an Arduino nano as the microcontroller. For other power options, see the Neopixel Uberguide. The Arduino and matrix share the same connections to power and ground where they are sandwiched between two nuts around #6 bolts that I poked through the poster board. The washer on the front of the poster board ensures a low-resistance connection between the filament and the bolt. These bolts are a great way to connect the wires from a battery or external circuit to the printed circuit with a much lower resistance than is possible than just sticking the wire into a pad of filament, as demonstrated in our Electrifi FAQ. I highly recommend this connection method wherever its feasible, it works great with smaller bolts as well. Lastly, connect the output pin used from the Arduino to the data line of the matrix display in the same manner. Its not a big deal if you happen to make these connections in a different order.

Step 3: Showcase Your Display

Congradulations, you've made a rare 3D printed LED matrix display! Once you've got the display hooked up, you'll need some code to control it. There are many examples online of code to put text or animations on the neopixel display. Here is one example Arduino sketch that includes text and animation that we modified to our liking: Neopixel_matrix_sprite_arduino.zip. The animations are defined in the Shape.h file, and you can check them out in the video above. If you want to make your own animations, take a look at this online tool. Alternatively, watch this video by GreatScott! showing how to easily create Animations for your LED matrix. Enjoy!

Code

Definitions.hArduino
/* 
  Bunches of definitions for the WS2812 Breakout Board example code
  
*/ 

// These are for the cascade function
#define TOP_DOWN 0
#define DOWN_TOP 1

/* A world of colors to set your LED to
  Standard HTML Color Codes sorted by Hex Value
    to see the colors in action, check out:
   http://www.w3schools.com/html/html_colorvalues.asp */
   
#define BLACK			0x000000
#define NAVY			0x000080
#define DARKBLUE		0x00008B
#define MEDIUMBLUE		0x0000CD
#define BLUE			0x0000FF
#define DARKGREEN		0x006400
#define GREEN			0x008000
#define TEAL			0x008080
#define DARKCYAN		0x008B8B
#define DEEPSKYBLUE		0x00BFFF
#define DARKTURQUOISE		0x00CED1
#define MEDIUMSPRINGGREEN	0x00FA9A
#define LIME			0x00FF00
#define SPRINGGREEN		0x00FF7F
#define AQUA			0x00FFFF
#define CYAN			0x00FFFF
#define MIDNIGHTBLUE		0x191970
#define DODGERBLUE		0x1E90FF
#define LIGHTSEAGREEN		0x20B2AA
#define FORESTGREEN		0x228B22
#define SEAGREEN		0x2E8B57
#define DARKSLATEGRAY		0x2F4F4F
#define LIMEGREEN		0x32CD32
#define MEDIUMSEAGREEN		0x3CB371
#define TURQUOISE		0x40E0D0
#define ROYALBLUE		0x4169E1
#define STEELBLUE		0x4682B4
#define DARKSLATEBLUE		0x483D8B
#define MEDIUMTURQUOISE		0x48D1CC
#define INDIGO 			0x4B0082
#define DARKOLIVEGREEN		0x556B2F
#define CADETBLUE		0x5F9EA0
#define CORNFLOWERBLUE		0x6495ED
#define MEDIUMAQUAMARINE	0x66CDAA
#define DIMGRAY			0x696969
#define SLATEBLUE		0x6A5ACD
#define OLIVEDRAB		0x6B8E23
#define SLATEGRAY		0x708090
#define LIGHTSLATEGRAY		0x778899
#define MEDIUMSLATEBLUE		0x7B68EE
#define LAWNGREEN		0x7CFC00
#define CHARTREUSE		0x7FFF00
#define AQUAMARINE		0x7FFFD4
#define MAROON			0x800000
#define PURPLE			0x800080
#define OLIVE			0x808000
#define GRAY			0x808080
#define SKYBLUE			0x87CEEB
#define LIGHTSKYBLUE		0x87CEFA
#define BLUEVIOLET		0x8A2BE2
#define DARKRED			0x8B0000
#define DARKMAGENTA		0x8B008B
#define SADDLEBROWN		0x8B4513
#define DARKSEAGREEN		0x8FBC8F
#define LIGHTGREEN		0x90EE90
#define MEDIUMPURPLE		0x9370DB
#define DARKVIOLET		0x9400D3
#define PALEGREEN		0x98FB98
#define DARKORCHID		0x9932CC
#define YELLOWGREEN		0x9ACD32
#define SIENNA			0xA0522D
#define BROWN			0xA52A2A
#define DARKGRAY		0xA9A9A9
#define LIGHTBLUE		0xADD8E6
#define GREENYELLOW		0xADFF2F
#define PALETURQUOISE	        0xAFEEEE
#define LIGHTSTEELBLUE		0xB0C4DE
#define POWDERBLUE		0xB0E0E6
#define FIREBRICK		0xB22222
#define DARKGOLDENROD		0xB8860B
#define MEDIUMORCHID		0xBA55D3
#define ROSYBROWN		0xBC8F8F
#define DARKKHAKI		0xBDB76B
#define SILVER			0xC0C0C0
#define MEDIUMVIOLETRED	        0xC71585
#define INDIANRED 		0xCD5C5C
#define PERU			0xCD853F
#define CHOCOLATE		0xD2691E
#define TAN			0xD2B48C
#define LIGHTGRAY		0xD3D3D3
#define THISTLE			0xD8BFD8
#define ORCHID			0xDA70D6
#define GOLDENROD		0xDAA520
#define PALEVIOLETRED		0xDB7093
#define CRIMSON			0xDC143C
#define GAINSBORO		0xDCDCDC
#define PLUM			0xDDA0DD
#define BURLYWOOD		0xDEB887
#define LIGHTCYAN		0xE0FFFF
#define LAVENDER		0xE6E6FA
#define DARKSALMON		0xE9967A
#define VIOLET			0xEE82EE
#define PALEGOLDENROD		0xEEE8AA
#define LIGHTCORAL		0xF08080
#define KHAKI			0xF0E68C
#define ALICEBLUE		0xF0F8FF
#define HONEYDEW		0xF0FFF0
#define AZURE			0xF0FFFF
#define SANDYBROWN		0xF4A460
#define WHEAT			0xF5DEB3
#define BEIGE			0xF5F5DC
#define WHITESMOKE		0xF5F5F5
#define MINTCREAM		0xF5FFFA
#define GHOSTWHITE		0xF8F8FF
#define SALMON			0xFA8072
#define ANTIQUEWHITE		0xFAEBD7
#define LINEN			0xFAF0E6
#define LIGHTGOLDENRODYELLOW	0xFAFAD2
#define OLDLACE			0xFDF5E6
#define RED			0xFF0000
#define FUCHSIA			0xFF00FF
#define MAGENTA			0xFF00FF
#define DEEPPINK		0xFF1493
#define ORANGERED		0xFF4500
#define TOMATO			0xFF6347
#define HOTPINK			0xFF69B4
#define CORAL			0xFF7F50
#define DARKORANGE		0xFF8C00
#define LIGHTSALMON		0xFFA07A
#define ORANGE			0xFFA500
#define LIGHTPINK		0xFFB6C1
#define PINK			0xFFC0CB
#define GOLD			0xFFD700
#define PEACHPUFF		0xFFDAB9
#define NAVAJOWHITE		0xFFDEAD
#define MOCCASIN		0xFFE4B5
#define BISQUE			0xFFE4C4
#define MISTYROSE		0xFFE4E1
#define BLANCHEDALMOND		0xFFEBCD
#define PAPAYAWHIP		0xFFEFD5
#define LAVENDERBLUSH		0xFFF0F5
#define SEASHELL		0xFFF5EE
#define CORNSILK		0xFFF8DC
#define LEMONCHIFFON		0xFFFACD
#define FLORALWHITE		0xFFFAF0
#define SNOW			0xFFFAFA
#define YELLOW			0xFFFF00
#define LIGHTYELLOW		0xFFFFE0
#define IVORY			0xFFFFF0
#define WHITE			0xFFFFFF
NeoPixel_matrix_sprite_arduino.inoArduino
/***********************
 modified by Multi3D LLC from:
 NeoPixel Matrix Sprite
 February 2015
 Giovanni Gentile
 http://www.0lab.it
 Creative Common License
************************/

#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#ifndef PSTR
 #define PSTR // Make Arduino Due happy
#endif
#include "Definitions.h"
#include "Shape.h"

// Control PIN
#define PIN 10

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, PIN,
  NEO_MATRIX_BOTTOM     + NEO_MATRIX_LEFT +
  NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG,
  NEO_GRB            + NEO_KHZ800);

// --------------------------------------------  
// Set the color of animation (see Definitions.h)

uint16_t rand_color = matrix.Color(random(0,255), random(0,255), random(0,255));
const uint16_t colors[] = { matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255), matrix.Color(255, 255, 0), matrix.Color(0, 255, 255), matrix.Color(255, 0, 255), matrix.Color(255, 255, 255)};
// Set the brightness (max 50)
int brigh = 40;
// Delay between animation
int wait = 300;

// ---------------------------------------------

void setup() {
  matrix.begin();
  matrix.setTextWrap(false);
  matrix.setBrightness(brigh);
}

// Variable to print text
int x = matrix.width();
int pass = 0;
int color = 0;
int choice = 0;

void loop() {
// Set the color of text (see Definitions.h)
 
// Text change color
  //scriviColor("Ciao");

// Set the animation
  if(pass == 0) {
    animation();
  }
  pass++;
  scriviColor("Electrifi Filament");
}

void sprite(const uint8_t* x, unsigned long y, int w){
  byte red = (y & 0xFF0000) >> 16;
  byte green = ( y & 0x00FF00) >> 8;
  byte blue = (y & 0x0000FF);
  matrix.drawBitmap(0,0, x, 8, 8, matrix.Color(red, green, blue));
  matrix.show();
  delay(w);
  matrix.fillScreen(0);
}

void scrivi(String z, unsigned long y) {
  int len = z.length();
  matrix.fillScreen(0);
  matrix.setCursor(x, 0);
  byte red = (y & 0xFF0000) >> 16;
  byte green = ( y & 0x00FF00) >> 8;
  byte blue = (y & 0x0000FF);
  matrix.print(z);
  if(--x < -len*6) {
    x = matrix.width();
    pass = 0;
  }
  matrix.setTextColor(matrix.Color(red,green,blue));
  matrix.show();
  delay(100);
}

void scriviColor(String y) {
  int len = y.length();
  matrix.fillScreen(0);
  matrix.setCursor(x, 0); 
  matrix.print(y);
  //matrix.print(F("Scrivi"));
  if(--x < -len*6) {
    x = matrix.width();
    if(++color >= 7) color = 0;
    matrix.setTextColor(colors[color]);
    pass = 0;
  }
  matrix.show();
  delay(100);
}

 // ---Animation---
 void heart() {
   for(int i=0;i<3;i++){
   sprite(cuore1,RED,wait);
   sprite(cuore1,PINK,wait);
   sprite(cuore1,BLUE,wait);
   sprite(cuore1,MAGENTA,wait);
   }
 }
 void space() {
   unsigned long COLOR = RED;
   for(int i=0;i<2;i++){
   sprite(alienoa1,BLUE,wait);
   sprite(alienoa2,BLUE,wait);
   sprite(alienoa1,BLUE,wait);
   sprite(alienoa2,BLUE,wait);
   }
   for(int i=0;i<2;i++){
   sprite(alienob1,COLOR,wait);
   sprite(alienob2,COLOR,wait);
   sprite(alienob1,COLOR,wait);
   sprite(alienob2,COLOR,wait);
   }
   for(int i=0;i<2;i++){
   sprite(alienoc1,VIOLET,wait);
   sprite(alienoc2,VIOLET,wait);
   sprite(alienoc1,VIOLET,wait);
   sprite(alienoc2,VIOLET,wait);
   }
   for(int i=0;i<2;i++){
   sprite(navicella1,COLOR,wait);
   sprite(navicella2,COLOR,wait);
   sprite(navicella3,COLOR,wait);
   sprite(navicella4,COLOR,wait);
   }
 }
 void pacman() {
   sprite(pacman1,YELLOW,wait);
   sprite(pacman2,YELLOW,wait);
   sprite(pacman1,YELLOW,wait);
   sprite(pacman2,YELLOW,wait); 
   sprite(pacman3,YELLOW,wait);
   sprite(pacman4,YELLOW,wait); 
   sprite(pacman5,YELLOW,wait); 
   sprite(pacman1,YELLOW,wait); 
   sprite(pacman2,YELLOW,wait); 
   sprite(pacman1,YELLOW,wait);
   sprite(pacman3,YELLOW,wait);
   sprite(gost4,RED,wait);
   sprite(gost5,RED,wait);
   sprite(gost1,RED,wait);
   sprite(gost2,RED,wait);
   sprite(gost3,RED,wait);
   sprite(gost4,HOTPINK,wait);
   sprite(gost5,HOTPINK,wait); 
   sprite(gost1,HOTPINK,wait);
   sprite(gost2,HOTPINK,wait);
   sprite(gost3,HOTPINK,wait);
   sprite(gost4,ORANGE,wait);
   sprite(gost5,ORANGE,wait); 
   sprite(gost1,ORANGE,wait);
   sprite(gost2,ORANGE,wait);
   sprite(gost3,ORANGE,wait);
   sprite(gost4,AQUA,wait);
   sprite(gost5,AQUA,wait);
   sprite(gost1,AQUA,wait);
   sprite(gost2,AQUA,wait); 
   sprite(gost3,AQUA,wait);
   sprite(pacman1,YELLOW,wait);
   sprite(pacman2,YELLOW,wait);
   sprite(pacman1,YELLOW,wait);
   sprite(pacman2,YELLOW,wait); 
   sprite(pacman3,YELLOW,wait);
   sprite(pacman4,YELLOW,wait); 
   sprite(pacman5,YELLOW,wait); 
   sprite(pacman1,YELLOW,wait); 
   sprite(pacman2,YELLOW,wait); 
   sprite(pacman1,YELLOW,wait);
   sprite(pacman3,YELLOW,wait);
 }
 void battito() {
   for(int i=0;i<3;i++){
   sprite(cuore1,RED,400);
   sprite(cuore2,RED,200);
   sprite(cuore3,RED,100);
   sprite(cuore2,RED,200);
   sprite(cuore1,RED,400);   
   sprite(cuore2,RED,200);
   sprite(cuore3,RED,100);
   sprite(cuore2,RED,200);
   }
 }

 void animation() {
  if (choice == 0){
    battito();
    heart(); 
  }
  if (choice == 1){
    pacman();
  }
  if (choice == 2){
    space();
  }
  if(++choice >= 3) choice= 0;
 }
Shape.hArduino
// See http://blog.riyas.org/2013/12/online-led-matrix-font-generator-with.html

const unsigned char PROGMEM gost1[] =
{B00011100,
B00111110,
B01111111,
B01001001,
B01111111,
B01111111,
B01111111,
B01001001};

const unsigned char PROGMEM gost2[] =
{B00000111,
B00001111,
B00011111,
B00010010,
B00011111,
B00011111,
B00011111,
B00010010};

const unsigned char PROGMEM gost3[] =
{B00000000,
B00000001,
B00000011,
B00000010,
B00000011,
B00000011,
B00000011,
B00000010};

const unsigned char PROGMEM gost4[] =
{B10000000,
B11000000,
B11100000,
B00100000,
B11100000,
B11100000,
B11100000,
B00100000};

const unsigned char PROGMEM gost5[] =
{B11100000,
B11110000,
B11111000,
B01001000,
B11111000,
B11111000,
B11111000,
B01001000};

const unsigned char PROGMEM pacman1[] =
{B00000000,
B00011100,
B00111110,
B01111000,
B01110000,
B01111000,
B00111110,
B00011100};

const unsigned char PROGMEM pacman2[] =
{B00000000,
B00011100,
B00111110,
B01111110,
B01110000,
B01111110,
B00111110,
B00011100};

const unsigned char PROGMEM pacman3[] =
{B00000000,
B00000111,
B00001111,
B00011111,
B00011100,
B00011111,
B00001111,
B00000111};

const unsigned char PROGMEM pacman4[] =
{B00000000,
B10000000,
B11000000,
B10000000,
B00000000,
B10000000,
B11000000,
B10000000};

const unsigned char PROGMEM pacman5[] =
{B00000000,
B11100000,
B11110000,
B11100000,
B10000000,
B11100000,
B11110000,
B11100000};

const unsigned char PROGMEM cuore1[] =
{B00000000,
B01100110,
B11111111,
B11111111,
B11111111,
B01111110,
B00111100,
B00011000};

const unsigned char PROGMEM cuore2[] =
{B00000000,
B00000000,
B00000000,
B00100100,
B01111110,
B00111100,
B00011000,
B00000000};

const unsigned char PROGMEM cuore3[] =
{B00000000,
B00000000,
B00000000,
B00000000,
B00111100,
B00011000,
B00000000,
B00000000};

const unsigned char PROGMEM alienoa1[] =
{B01000010,
B00100100,
B01111110,
B11011011,
B11111111,
B01000010,
B01100110,
B00000000};

const unsigned char PROGMEM alienoa2[] =
{B01000010,
B00100100,
B10111101,
B11011011,
B01111110,
B01000010,
B11000011,
B00000000};

const unsigned char PROGMEM alienob1[] =
{B00011000,
B01111110,
B11111111,
B11111111,
B10011001,
B11111111,
B01100110,
B11011011};

const unsigned char PROGMEM alienob2[] =
{B00011000,
B01111110,
B11111111,
B11111111,
B10011001,
B11111111,
B01100110,
B01101101};

const unsigned char PROGMEM alienoc1[] =
{B00011000,
B00111100,
B01111110,
B11111111,
B11011011,
B01111110,
B00100100,
B01011010};

const unsigned char PROGMEM alienoc2[] =
{B00011000,
B00111100,
B01111110,
B11111111,
B11011011,
B01111110,
B01011010,
B10100101};

const unsigned char PROGMEM navicella1[] =
{B00000000,
B00000000,
B00000000,
B00000000,
B01000000,
B00000000,
B01000000,
B11100000};

const unsigned char PROGMEM navicella2[] =
{B00000000,
B00000000,
B00000000,
B01000000,
B00010000,
B00000000,
B00010000,
B00111000};

const unsigned char PROGMEM navicella3[] =
{B00000000,
B00000000,
B01000000,
B00010000,
B00000010,
B00000000,
B00000010,
B00000111};

const unsigned char PROGMEM navicella4[] =
{B00000000,
B01000000,
B00010000,
B00000010,
B00000000,
B00000000,
B00001000,
B00011100};

const unsigned char PROGMEM navicella5[] =
{B01000000,
B00010000,
B00000010,
B00000000,
B00000000,
B00000000,
B00010000,
B00111000};

Comments

Similar projects you might like

Arduino 32x8 LED Matrix Info Display

Project showcase by ericBcreator

  • 23,281 views
  • 34 comments
  • 40 respects

Otto DIY+ Arduino Bluetooth Robot Easy to 3D Print

Project tutorial by Team Otto builders

  • 48,193 views
  • 117 comments
  • 162 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 17,304 views
  • 4 comments
  • 34 respects

Arduino LED Matrix Game of Life

Project showcase by aerodynamics

  • 2,391 views
  • 0 comments
  • 15 respects

MAX72XX LED matrix display asteroids game

Project tutorial by kreck2003

  • 1,967 views
  • 2 comments
  • 14 respects

16x16 LED Matrix Display

Project showcase by Treebug842

  • 3,122 views
  • 2 comments
  • 11 respects
Add projectSign up / Login