LED Matrix Glasses: First Prototype




Introduction: LED Matrix Glasses: First Prototype

About: I make things because its fun and I like the challenge.

UPDATE: https://www.instructables.com/id/Rave-Shades-The-Self-Assembly-LED-Glasses-Kit/

I came up with this idea after seeing similar videos on the internet. I however have improved on the design. What separates my glasses from the others out there, is that mine use an external matrix driver and battery. What this means is, for the cost of having a cable down your back when wearing the device, you get a greatly improved battery life. This also allows the device to use  ultra-bright 1210 LED's. Not only that, a full sized arduino can be used if you have one. This project uses cheap and easy to gain parts to allow you to create a one of a kind fancy dress party piece. These glasses do not obstruct your vision any more than the original shutter shades. Even with the glasses on turned on, no glare from the LEDs can be seen.

For me the most important thing about making these glasses has been, increasing my knowledge and attaining new skills. Here are some of the things I have learnt.

• Solder Surface mounted LEDs.
• Write my own C program and optimize it to store more visual effects.
• Using data arrays to store patterns and frames.
• Create an algorithm to shift out the data from a 3D array.
• Correctly control the chips of the driver circuit.
• Cascade shift registers.
• Use Microsoft Excel to my advantage to create many shortcuts whilst programming the on-screen visuals.
• Efficiently place components on vero board.

Step 1: Parts Bin:

To make this project you will need these parts:
* Can be found at most hardware shops or ebay.

Step 2: Tool Box:

To make a pair of these glasses you may need these tools:
  • Soldering Iron, preferable an adjustable one with a fine tip.
  • Hot melt glue gun
  • Side cutters
  • Wire strippers
  • Philips head screw driver
  • Tweezers
  • Scissors
  • Drill 
  • Selection of drill bits
  • Small rectangular file
  • Small round file
  • PC
  • Sewing needle or bobby pin
  • Pen

Step 3: Marking the Positions of the LED's:

The next four steps show you how to mark out the location of the LEDs on the glasses. All images are in chronological order and may have their own annotations to help you.
  1. Download the attached pdf file and print it out.
  2. Remove both arms from the glasses using a small Philips screw driver.
  3. Center the glasses on one of the grids. There are two grids just in case you get something wrong later on.
  4. Draw an outline of the glasses in pen. (Image 2)
  5. Cut along your markings. (Image 3)
  6. Cut down the middle line of the grid to seperate each side.
  7. Lay down some tape with the sticky side up and place one of the half grids face down on the tape. (Image 4)
  8. Try to position the cut-out grid on the corresponding side of the glasses, making sure the the the horizontal lines are in the center of the slats of the glasses. (Image 5&6)
  9. Repeat  steps 7 and 8 for the other side.
  10. When you are sure all is lined up, grab a sewing needle and press the tip on to each crossover of the grid, creating a small hole on the surface of the glasses at every point. (Image 8&9)

Step 4: Attaching the LEDs:

Now follow these steps:
  1. Use sticky tape to hold the glasses securely in place on, on your work surface.
  2. Drip some cooking oil onto a paper towel and wipe the prongs of your tweezers with a thin layer of oil. This will stop the LEDs from sticking to the tweezers when you carry out step 6.
  3. Clean the glasses with washing-up liquid and allow to dry. Do not touch the front of the glasses as grease from your hands will stop the superglue from working properly.
  4. Take an LED and locate the cathode, this can be determined by the recessed corner.
  5. Position several LEDs on your desk at a time with the recessed corner ie the cathode, away from you. Keep them close to the glasses to make transportation to the glasses quick and easy. 
  6. Pick up one LED at a time and carefully blob some superglue onto the base and then place it on one of the dots made earlier with the pin. 
  7. The superglue will not set immediately, so place the LED as quickly as possible and take the tweezers away. Then continue with the next one. The glue will start to set within a minute, so do not place another LED in a neighbouring spot for a couple of minutes so as not to disturb an unset LED.
  8. Repeat until LEDs cover every pin hole you made earlier.
  9. Allow the glue to cure for 24 hours in a dry, but ventilated area.
  10. Check that all LEDs are up the right way. The side with the recessed corner at the top of the glasses when worn* check the last photo of this segment.
Top tips before trying this are:
  • Have a good night sleep before attempting this.
  • Do not consume any caffeine that day. I cannot emphasize how much of a difference this made. 
  • Make sure you work in a well-lit area.

Step 5: Soldering the LEDs: Cathode Rows & Anode Columns

This step requires a lot of patience, concentration and a decent soldering iron tip. Follow these steps and use the related photos & diagrams to help you:

WARNING: Work in a well ventilated space with eye protection when soldering the LEDs as the superglue will emit a toxic vapour.

Cathode Rows:
  1. Strip some multi-strand wire to reveal the individual strands of wire. You will need 8 of these strands and they should be approximately 7 inches long.
  2. Starting on the top row with the LED furthest to your right as you look at them take an individual strand of wire and solder it to the cathode (recessed corner).
  3. Solder this wire along the cathodes of the LED’s in that particular row and leave any excess wire attached. (Image 1)
  4. Repeat this for the next 2 rows and you should be left with 5 more rows with a gap between for the wearer's nose.
  5. Repeat steps 2&3 for the next 5 rows but this time cut off the excess wire when you get to nose gap and keep for later.
  6. The 5 bottom rows require an electrical bridge to be made around the gap for your nose using insulated wire. I used IDE cable as the individual wires are insulated and flexible. When bridging the gap follow the shape of the nose cut out otherwise they can't be worn.
  7. Use the excess wire that you had previously cut off and put to one side, to continue connecting the cathodes of the LEDs on that particular row.
  8. Visually check connections for errors. (Image 2)

Now it is time to solder the anodes together to create 24 columns of anodes. Once again follow these steps and use the diagrams and photos to help you:
  1. Take some IDE cable, seperate out 24 wires, each 7 inches long.
  2. Strip ~1 inch off one end of all 24 wires. (image 3)
  3. Strip a further N pieces of insulation, where N is 1 less than the number of LEDs in that particular column. Each piece of insulation should be 0.25 inch long. Remember to keep them on the strand of wire. (image 4)
  4. Solder the wire on to the anode (the side opposite to the one with the recessed corner) of the bottom LED of that column. (image 5)
  5. To help you in the next step bend a stiff piece of wire to roughly match that shown in image 6.
  6. Use the tool you just made to bend the rest of the wire around the other LEDs, soldering each one as you go. (images 7,8,9)
  7. Visually check connections for errors. It should look like Image 10.

Step 6: Glasses Data Cable:

You should be at a stage where your glasses have 24 anode wires and 8 cathode wires. However they will not reach the driver as they are, so an extender cable is required. Follow the diagram (Image 6) now and you will be able to correctly connect up the cable later:
  1. Take your 40 way IDC cable and take off 8 wires to leave a 32 way cable leaving the red indicator strip on the cable. Note: I have used IDC cable as it has more than one strand of metal per wire. This will have an increased life over an IDE cable. That is why I have only used IDE cable where it doesn't need to be flexed
  2. Stick the cable onto the outside of the glasses using hot melt glue, being sure to leave around 7 inches of cable ahead of the joint and the other 6 foot arrears of it. (Image 1)
  3. Start with the rows and split the cable down to 8 separate wires all the way to the glue joint.
  4. Solder the wires to the corresponding row. Use hot melt glue to hold in in place. (Image 2,3,4 & 5) 
  5. TIP: lick your finger to shape the hot glue to a more streamline shape.  
  6. Strip the remaining 24 wires.
  7. Solder the wire to the correct LED column. (Image 6)
  8. Hold the wires in place with more, hot melt glue using the same technique mentioned above to create a durable frame.
  9. Bulk up the joint where the cable meets the glasses. (Image 7)

Step 7: Securing the Head Strap:

Follow the steps below to create a head strap:
  1. Remove the head strap from an old dust / voc mask but don't tear the elastic. I got mine from a 3M 4000 series mask
  2. Use some steel wire to attach the elastic to the side without the cable (Image 2 & 3)
  3. Bend the excess wire and hot glue it in place
  4. Put some wire around the elastic and then around the middle slat.
  5. Twist it tight but make sure you are not touching any LEDs wires or solder blobs (Image 4 & 5)
  6. Using duct tape or equivalent, bend and tape the data cable in a vertical position, to allow it down the back of your shirt when worn. (Image 7)

Step 8: Schematic Diagrams:

The first schematic is the matrix driver. This will allow the Arduino to control all 162 LEDs and with slight modification up to 192 LEDs. If you want to view the Schematic of the whole system download the PDF below, as the image here is a little pixelated.

Step 9: Assembling the Matrix Driver: Shift Registers

To make the driver, you should use the schematic instead of copying what you see in the next steps and images. This is because you could make a mistake that you may not understand. You should create the layout yourself as this is an excellent skill to have when all you have is a schematic diagram. I have tried to describe each step as best I can:
  1. Take your vero board and lay it, copper side down with the copper strips in a horizontal position.
  2. Solder in a 74HC595 Chip with the indicator notch facing up. (image 1)
  3. Solder in a current limiting resistor from pin 15. I put some solid core wire insulation over the leg from pin 15 to save hassle later on. (image 2)
  4. Solder in the rest of the resistors ensuring they all straddle one hole. (image 3)
  5. Solder in a 74HC595 chip in the same orientation as before but leave 6 holes between each chip. (image 4)
  6. Repeat steps 3&4 for chip 2. (image 5)
  7. Solder in a 74HC595 chip as you did for chip 2 (same orientation + 6 hole gap)
  8. Repeat steps 3&4 for chip 3. (image 6)

Step 10: Assembling the Matrix Driver: Shift Registers Continued...

Continue the assembly by following these steps:
  1. Connect pins 10 and 16 together on each chip. (image 1)
  2. Connect pins 8 and 13 together on each chip. (image 2)
  3. Connect pin 9 of chip 1 to pin 14 of chip 2.
  4. Connect pin 9 of chip 2 to pin 14 of chip 3. (image 3)
  5. Connect pin 11 of chips 1, 2 & 3 together. I did this on the back of the board.
  6. Connect pin 12 of chips 1, 2 & 3 together. I did this on the back of the board.
  7. Look at image 6, it shows 8 connecting wires taking the output from chip 2 over to an area close to the output of chip 1.
  8. Now look at image 7, it shows where the output of all 3 shift chips and transistors could be.
  9. Using a small drill bit make 3 vertical lines of breaks in the 8 copper tracks, this is to separate each output. They have to be at least two holes apart.
  10. Strip and solder 16 pieces of wire to each output from chips 2 and 3.
  11. Route each wire neatly on the board and then solder it to the corresponding location in the output region. See image 8 for details.
  12. You should be left with 2 sets of connecting cables, one is for chip 2 and the other is for chip 3.

Step 11: Assembling the Matrix Driver: Decade Counter

Continue the assembly by following these steps:
  1. Solder in the 4017 decade counter, in line with the other chips and with the notch facing up. However it only needs a 3 hole, gap between it and chip 3.
  2. Connect pins 8 and 13 together on the decade / chip 4.
  3. Connect pin 13 of chip 4, to pin 8 of chip 3. 

Step 12: Assembling the Matrix Driver: Decade Counter Continued......

I would recommend using the 8x BC337 NPN transistors. I used 19x 2n3904 as I had them spare, however I had to put them in parallel to handle the current. So just ignore how many there are.  
  1. Find space on the board to put all 8 BC337s in line with each other. You will need 3 adjacent copper tracks and should start by soldering transistors along them. All tracks should have a like pin type, ie all collectors, or all base's or all emitters. This can be achieved by maintaining the same orientation of all transistors. You will need to leave 2 sets of holes before inserting the next transistor. This is because one of the holes on each track is required to isolate each transistor and the other is to insert the wires and the resistors. Image 1 shows a top view however you can also see an x-ray of the tracks and any required breaks in the tracks.
  2. Using a drill bit break the copper track that the collector and bases run on, leaving one hole for any wires or resistors to be soldered to. DO NOT DRILL THE TRACK THAT THE EMITTERS ARE ON, as this will be used to ground the transistors in the next step. 
  3. Solder a wire from the track that the emitters are on, to pin 8 of any one of the chips. This will ground the transistors.
  4. Solder a 1K resistor into each of the 8 bases.
  5. Solder the other end of the resistor to an isolated section of track that has a minimum length of 2 holes. 
  6. Solder a wire into the other hole on the above mentioned section of track and route it to the corresponding output of the decade counter. DO NOT FORGET OUTPUT 0 IS BEFORE OUTPUT 1. (Image 2, where Q is the output)
  7. Solder a wire from the collector of each transistor, to the output area. (Image 3)

Step 13: Assembling the Matrix Driver: Arduino Hook-Up

Continue the assembly by following these steps:
  1. Score a piece of board and snap it over an edge of a table.
  2. Insert the arduino.
  3. Solder the arduino in place. 
  4. Connect pin 14 of shift chip 1 to pin 11 on the arduino.
  5. Connect pin 12 of any shift register to pin 10 on the arduino.
  6. Connect pin 11 of any shift register to pin 13 on the arduino.
  7. Connect pin 14 of the decade counter to pin 9 on the arduino.
  8. Connect pin 15 of the decade counter to pin 8 on the arduino.

Step 14: Housing the Matrix Driver:

To protect and hold all the electronics together you should mount them in a project box. I used an aluminum box or aluminium box in the UK :
  1. Work out where you are going to install everything in the box.
  2. Place the driver circuit inside the housing and mark up the location of the arduino's USB port.
  3. Drill 2 small holes for the USB port and file them into a single rectangular hole.
  4. Mark up the location of the power switch.
  5. Drill a hole for your power switch. If you do not have a larger enough drill bit you will have to file it out with a round file.
  6. Mark up the location of where the glasses cable will enter the box.
  7. Chain Drill a line for your ribbon cable and then file it  out into a slit.
  8. Cut a length of PVC tube twice the length of the slit.
  9. Slice the tube down the middle and use it to make a grommet for the slit.
  10. If you have used ribbon cable for the glasses cable, spit the unused end into sections of 8. i.e. one for each chip.
  11. Thread it through the slit you made in the enclosure.
  12. Strip each of the 32 wires.
  13. Insert and solder one wire at a time into the correct section of the output region. (Image 15, the last one)
  14. Insert some plastic sheet if using a metal box and tack it and the driver in place with some hot melt glue. (Image 12&13)
  15. Glue the battery holder in place with hot melt glue
  16. Solder the black wire of the battery holder to GND on the arduino
  17. Insert the power switch.
  18. Solder a wire from the VIN on the arduino to the switch.
  19. Solder the red wire from the battery holder to the switch
  20. Insert some batteries and test to see if the arduino lights up. If the arduino has no lights review your wiring.
  21. Only hot glue wires in place after a test run with code.

Step 15: Upload the Code:

To test your glasses:
  1. Download the test code and open it.
  2. Paste the text into the arduino IDE 
  3. Upload the test code.
  4. A sparkling rain pattern will fall down the screen.
To create your own animations:
  1. Start by opening the arduino IDE and pasting the attached code below into it..
  2. Look for the grey section of code with: // e.g. unsigned char your_new_animation [][8][3] {
  3. Remove the // e.g. from it and it should turn black. 
  4. Right click on the Array Calculator v1 link below and select save link as.
  5. Open the downloaded file in Microsoft Excel.
  6. Copy the light blue box titled "on".
  7. Paste this where you would like a particular LED to be on, you can have any combination of LEDs just make sure you only paste inside the glasses silhouette.
  8. It does not work from color so you can't just fill the boxes with that color, you do have to copy either an on, or off box.
  9. When you have finished, copy the number below the glasses and paste it into the code below the "unsigned char [][8][3] {"  line you just modified.
  10. This is the first frame of your animation. Repeat steps 5 to 8 for your other frames.
  11. When you get to your last frame replace the comma, with };
  12. Scroll down to the bottom of the code and you will find a grey "//e.g. run_animation(8,your_new_animation,11,12);"
  13. Remove //e.g. and again it should turn black.
  14. Change the number 11 to the number of frame your animation has.
  15. Change the number 12 to the number of loops you want to do. 
  16. Decrease the number 8 to speed up your animation.
  17. You can rename your animation as long as you change it in the array at the top and down here. 
LED Contest with Elemental LED

Grand Prize in the
LED Contest with Elemental LED

Hurricane Lasers Contest

Finalist in the
Hurricane Lasers Contest

Halloween Props  Contest

Participated in the
Halloween Props Contest

4 People Made This Project!


  • Chocolate Challenge

    Chocolate Challenge
  • Digital Fabrication Student Design Challenge

    Digital Fabrication Student Design Challenge
  • Go Big Challenge

    Go Big Challenge



9 years ago on Introduction

Hey everyone!

As some of you may remember, I brought up the possibility of using program memory to store animations a while back.  Well, now I've completed my LED glasses and they're working, I've been able to work on this modification, and am happy to say I have it working now!

Currently, the frames are stored in static RAM, which is only 1024 bytes on the Arduino Nano. This modified code uses FLASH memory instead (with a much larger capacity of up to 32768 bytes, minus code space) using the PROGMEM command. This increases the animation frames you can store from about 40 frames (using SRAM) to a whopping 1000 frames (which is what I estimate you should be able to get using this FLASH program memory technique).

I've modified the original code provided by eXtreme Something and here it is.  I've also added a little animation I put together.

Just copy and paste this code into the Arduino application developer, Verify it, and then Upload it to your Arduino and it should work.

Here it is:

// LED Glasses code by Lok H. Wong
// ===============================
// Written 11/18/2012, based on code originally obtained from www.instructables.com.
// Code has been modified to take advantage of the PROGMEM command, which allows animations
// to be stored in program memory, instead of static Random Access Memory (SRAM).  SRAM is
// limited to only 1024 bytes on Arduino Nano.  Program memory, on the other hand, has up to
// a roomy 32768 bytes, minus the space your code takes, allowing for many more animation
// frames.

int DataPin = 11; //shift input
int LatchPin = 10; //rstclk on shift
int ClockPin = 13; //srclk on shift
int clock = 9; //decade clk
int Reset = 8; //reset

unsigned char rain_P [][8][3] PROGMEM = {                              //In this example the animation is called rain,
{{0,2,4},{32,0,0},{1,0,16},{0,0,0},{0,0,64},{2,0,0},{0,0,4},{8,0,0}},  //Paste the array values you got from excel here
};  //When you get to the last frame of your animation, you need to replace the comma with };

unsigned char rotatebox_P [][8][3] PROGMEM = {

// unsigned char your_new_animation [][8][3] PROGMEM = {
//};  //When you get to the last frame of your animation, you need to replace the comma with };

//You can only have a limited amount of frames even if they are in different animations.
//If you have too many frames, the code won't start on the arduino, so you will have to reduce the amount of frames.
//An animation can be played an unlimited amount of times.

void setup()
  pinMode(DataPin,OUTPUT);   //Basic setup of pins etc
  digitalWrite(Reset,HIGH); //Reseting the decade to 0 as it can be at a random stage on start up

void run_animation_P (unsigned char frame_time,unsigned char frames[][8][3],unsigned char num_frames,unsigned char num_loops)
{  //My function called run_animation_P - this has been modified to use PROGMEM data
  int i, x, y, z;
  byte datasegment;

  //The display algorithm shifts out the 3 numbers in the array to display row 1 and then drops down a line....
  //and continues to output the data for that line. It drops down through each of the 8 rows then resets. It then does the next frame.

  for(i=0; i < num_loops; i++){              //number of times to play full animation
    for(x=0; x < num_frames; x++){           //number of frames in the animation
      for(z=0; z < frame_time; z++){         //times to display each frame (why do we need this?)
        for(y=0; y < 8; y++){                //cycle through each layer (controlled by the decade counter)

          //write the LED row data to the shift registers for the current layer
          digitalWrite(LatchPin, 0);
          datasegment = pgm_read_byte(&(frames[x][y][2]));
          shiftOut(DataPin, ClockPin, LSBFIRST, datasegment);  
          datasegment = pgm_read_byte(&(frames[x][y][1]));
          shiftOut(DataPin, ClockPin, LSBFIRST, datasegment);
          datasegment = pgm_read_byte(&(frames[x][y][0]));
          shiftOut(DataPin, ClockPin, LSBFIRST, datasegment);
          digitalWrite(LatchPin, 1);

          delayMicroseconds(700);    //wait

          //zero out the shift registers
          digitalWrite(LatchPin, 0);
          shiftOut(DataPin, ClockPin, MSBFIRST, 0);
          shiftOut(DataPin, ClockPin, MSBFIRST, 0);
          shiftOut(DataPin, ClockPin, MSBFIRST, 0);
          digitalWrite(LatchPin, 1);

          //reset decade counter
          digitalWrite(clock, 1);
          digitalWrite(clock, 0);

        digitalWrite(Reset, 1);
        digitalWrite(Reset, 0);

void loop()
  //Fill in this to call each of your animations:  run_animation(frame time, animation title, number of frames in the animation, number of loops);
  //e.g. run_animation_P(8, your_new_animation, 11, 12);

  run_animation_P(12, rotatebox_P, 4, 30);

  run_animation_P(4, rain_P, 11, 150);



Reply 6 years ago

sorry... i have built this fantastic project but with the command PROGMEM in arduino is not working... I have pasted in arduino the entire program... but not work.

The program is running if I delete the command PROGMEM. May be is it necessary to put a new library in arduino program?... May you help me pls?





Reply 9 years ago on Introduction

Fantastic, I would test it but I sold them :D I am making another pair though


9 years ago on Introduction

i tried making something similar to this but have problems with mine. i had uploaded the test code thinking that even though it is a 12*9 matrix it would still work with the copied test code. however when i plug it in some LED's turn on quickly but then it shut's off and no animation comes up. I've recorded a video so you could see what is happening every time i plug it into the computer. i would like to have some help on what the problem is.

Reply 9 years ago on Introduction

The test code will only work if your wiring is the same as mine, ie. by using the schematic. Unfortunately its not a universal code and won't work with a 12x9. Send me schematic diagram of your exact circuit and i might be able to help.


Reply 8 years ago on Introduction

hey man after 8 months later until today i finally got around to fixing my problem. i ended up making a new led matrix board and a new board for the decade counter, transistors and shift registers. The problem i had at first was that i connected the wires to the wrong pins on the arduino, but when i fixed that problem i encontered another problem which was atleast 4 or 5 rows wouldn't turn on. so i gave up on it. a couple of days ago i ended up figuring out that the reason to why those rows wouldn't turn on was because my dumb self wired the transistors all wrong. instead of connecting each row of l.e.d's to the connector node i ended up connecting it to the emitter node. -_- Anyhow thanks for a superb tutorial and trying to help me!


9 years ago on Introduction

Just another question, will this code work on an arduino uno as wel?
Thank you


9 years ago on Introduction

Hey nice work:)
I'm currently making this but there is one thing on the schematic that's a too little pixelated to read :( Just to be sure, row 1 is the top layer of the glasses and row 8 is the bottom layer of the glasses???
Cheers :)


9 years ago on Introduction

How difficult would this be for someone who has little experience in electronics? I've done basic wiring and soldering before but thats about it.

Scale from 1 to 10 with 1 being easy and 10 being extremely difficult.


Reply 9 years ago on Introduction

Its a little hard and really fiddly but I've done the electronics for you, so all you have to do is glue and solder it. Give it a try, whats the worst that can happen? so I would say 4


9 years ago on Introduction

Excellent tutorial! I'm in the process of soldering the leds now. Are there any tips on testing the soldered connections during the process? I'm concerned about my bridged connections over the nose (and the cathode rows)! Thank you!


Reply 9 years ago on Introduction

Try checking it with a continuity tester or resistance meter against the schematic diagram.

Hi, I am so excited to make my own pair! I am just wondering what gauge the solid core wire must be? Thank you for making this awesome tutorial and sparking my interest in Electrical Engineering :)


Reply 9 years ago on Introduction

That's great to here! The solid core wire is 0.6 mm standard breadboard wire. Thank you for your interest and good luck !!!


9 years ago on Introduction

How would i be able to expand the matrix driver to control a 40x8 led matrix?


Reply 9 years ago on Introduction

Using more powerful transistors, so 40* 20mA is 800mA so they should be able to handle 800mA. You would have to have 5 shift registers and cascade them like be for, it pin 9 on chip 1 goes to pin 14 on chip 2 and you would need a different code. Also it will have a frame rate that is slower than my one. And you won't be able to store as many programs. Are you making a message board or a daft punk helmet or something because there are different ways of doing a matrix: http://www.youtube.com/watch?v=wTQM6VPTsQo , http://www.youtube.com/watch?v=mDXlQFcbWhA


Reply 9 years ago on Introduction

im interested in doing a daft punk helmet and thanks


9 years ago on Introduction

Hy please I'm from Argentina and I want to buy some of them, contact me