Introduction: RGB Matrix + Spectrum Analyzer

About: Make your life more lazy and awesome by the touch of electronics. Check out awesome projects and learn how to build them easily and cheaply.

Love LEDs?
Me too!

That's why, in this Instructable, I'll show you how to make an awesome RGB LED Matrix, that can easily turn into a Spectrum Analyzer with the click of a button.

After reading, if you think this Instructable has earned it, please vote for it in the LED contest.

And without any further ado, let's get started.

Step 1: Watch the Video

The video demonstrates each and every step in detail and will help you in a proper understanding of the project. So, watch it before moving on to the next step.

Step 2: Get Your Parts.

Step 3: Prototyping.

Download and add these Arduino Libraries:
FastLED - https://github.com/FastLED/FastLED
Aadafruit NeoPixel Library - https://github.com/adafruit/Adafruit_NeoPixel

Test the WS2812B LED Strip using the FirstLight sketch from examples of FastLED library. Edit the data pin and number of LEDs and after uploading the LEDs should light up white one after another showing that the LEDs are working fine.

Now build the test circuit using the circuit diagram attached in this step without IR Receiver. Upload the sketch, also attached in this step. You will need 21 LEDs. The MSGEQ7 divided audio spectrum into 7 frequency bands. So, keeping that in mind, the sketch divides 21 LEDs in to 7 sets, each set having 3 LEDs, first LED will be always off and the rest two LEDs will light up according to the intensity of audio in that particular frequency band. Look out for analog values of all the seven bands in the Serial Monitor for debugging and making sure everything looks good. When this is working fine, finalize the prototyping by adding the IR Receiver.

Now add the Infrared receiver and upload the second attached I have attached which will light up 2 sets having 7 LEDs each according to the intensity of audio signal from any two band which you can edit in the sketch. I will suggest you to choose bands 3 and 4.
Now determine the hex code of any of the button in IR remote you are using.
To know how to do that, click here: https://www.instructables.com/id/Control-AC-Applia..
Edit that hex code in the sketch and upload it. Now when you press the button, the LEDs will show animation and when you press the same button again, it will switch back to spectrum analyzer mode.

And the prototyping is complete.

Step 4: Soldering.

Get all the electronics components required for the project.

Also get a narrow perfboard in which we will solder the spectrum analyzer components so that we can make something like an Arduino shield, which will save us from the wiring mess. Refer videos and pictures for a clear perception.

I am using Arduino Uno so that I can easily upload new programs in the future if required, but you can also use Arduino Nano.

Then, take a 3.5 mm plug and solder two wires, one to ground and one to any one of the channel and the other end of the two wire goes to the MSGEQ7 shield. After this is done, connect the IC to its base, solder power wires and test the shield using Arduino Uno serial monitor like I did earlier.

Step 5: Make the LED Board.

Now, take a 3 mm thick MDF and make a square of size 25.2x25.2 cm and cut it using a hack saw. Then draw 49 squares of size 3.6x3.6 cm on it. Cut 7 pieces of LED strips, each containing 7 leds as we will be making a matrix of 7x7 i.e. 49 leds. After cutting, peel off the tape in its back and stick it to the MDF piece. I had to make holes at two places on the MDF using a drill so that the wires can pass through, otherwise I would have to remove the heat shrink and desolder the wires, which I didn’t want.

Keep in mind that all the data flow direction arrows on the strip must follow the same direction, i.e. left to right.

Then using a smaller drill bit, like 2 mm, I made three holes next to Vcc, GND and data pins on either end of each of the 7 led strips. I tinned the solder pads on the strip on both the ends. Then using a 0.75 sq. mm wire, short the Vcc and GND of the strips in all the seven rows. Also, short the Vcc and GND from last row to first row (dual feeding).

Connect the data out from first row to data in of second row, data out of second tot data in of third and so on until the last row is reached. I used a solid 0.5 sq mm wire for this purpose. Be sure not to short these wires to Vcc or GND.

When this is done, check for continuity and using the FirstLight sketch check the connection.

Step 6: Make the Enclosure.

To make the enclosure I used a 12 mm MDF.

I made the dimensions attached in this step. Using bevel cut feature on my jigsaw, I firstly made two beveled cuts on either end of the markings. Both the cuts must be inside for making an enclosure. After this, I made the remaining straight cuts.

I used wood glue to join all the pieces together and to hold them in place, I used a small wood nail. You can use any other technique you like, I have very little experience with wood working, so any suggestions are really welcome.

Leave the glue to dry overnight.

Step 7: Finish the LED Board.

Check if the LED board we made earlier, fits in the enclosure or not. If it doesn't, bring it to shape using a file or emery paper or both.

From a 10 mm white thermocol sheet, cut 6 pieces of length equal to that of LED board and width 2.4 cm. Glue them on the horizontal line we made on the MDF.

After it dries, put it inside the enclosure, mark spots for DC barrel connector and USB cable for Arduino and then drill it. Bring them to shape using a file.

Completed some remaining connections like adding wire for data in, adding power wires to the barrel connector which powers our whole circuit, adding the IR receiver and finally hot gluing all of them in place. Connect wires to the fourth row Vcc and ground wires which goes to Vin and ground pin of Arduino and powers it.

Use hot glue for making all the connections secure and also to fix barrel connector at its place.

Step 8: Finish the Top.

Take the thermocol sheet again and start cutting it in sizes equal to the gap between previously fixed thermocols. Measure only one for each row and then cut the remaining required using that piece. It's not necessary to use glue as it will remain in place on their own, but if required you can use a little amount of glue.

After this is done, measure the box, bring the acrylic sheet, mark the measured dimension using a marker and cut it using a hack saw. To cut it, make several cuts using a box cutter, and then after keeping it at the corner of a table, apply force downwards and it will get cut in a perfectly straight line.

To attach the acrylic sheet to the top, I used a 2 mm bolt as I didn't have a fitting screw, but you should use a screw.

Make markings on the acrylic sheet and drill them using a 2.5 mm drill bit. Using that sheet, make markings on the enclosure and drill them using a 2 mm drill bit. Then finally, attach the sheet on the top using the screws.

Step 9: Final Touch.

The sketch I have attached in step 2 will lag a bit while working as a spectrum analzyer. The reason is the algorithm. There are way much calculations done for calculating number of LEDs, color of LEDs, actually showing it which slows it a bit.

That's why I created a whole new algorithm for the Spectrum Analyzer and it is working fine now, sketch is attached in this step.

For those who want to know what kind of algorithm, look for a "while" loop in the sketch.

Step 10: Done.

That's all. Enjoy your creation, and if there is any question, fell free to ask in the comment section.

If you think, I have earned it, please vote for this instructable in the LED Contest, and also subscribe to our YouTube channel. It will be really helpful.

Thanks for reading :).

LED Contest 2017

Participated in the
LED Contest 2017