Introduction: 2D Music Visualizer + LED Matrix

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.

Hi! Today we will be making this cute little battery powered 2D sound visualizer. It can display various animations that just looks mesmerizing, and the sound reactive feature is a cherry on the top. It is portable and the wood finish makes it look classy too. Because the firmware used in it is WLED, it can be easily controlled over Wi-Fi through browser or its own app. Let’s dive into the details of building it and I’ll show you the ups and downs I faced on the way. And before we do, let me tell you I have never changed my plans this much on any of my projects. At one point I even though t the project was over-ambitious and I was about to give up. More on that later.

Supplies

The star of this project is 8x8 WS2812B LED matrix. The brain of this project is ESP32. We cannot use ESP8266 because the WLED firmware supports 2D animations for ESP32 only. For audio sensing, we will use INMP441 sensor. It is a digital output sensor but is very different from those comparator-based ones. The microphone used in this is a MEMS device. It is a high-performance, low power, omnidirectional mic. Along with this mic, INMP441 has signal conditioning, an analog-to-digital converter, anti-aliasing filters, power management, and an industry-standard 24-bit I²S interface. I2S interface allows it to connect to the microcontroller directly which supports it, and as a matter of fact, ESP32 supports it. To learn more about this and to learn how to test it, you can check the links at the end of this instructable. I will leave some links that has all the information required. Overall, this is a pretty good audio sensor and I think I will be using it from now on all my projects if I can.


Please find the links of all the parts used below.

IN:

ESP32 - https://amzn.to/3v5yh5E

INMP441 - https://amzn.to/3rUj7PE

Li-Ion Battery - https://amzn.to/3vme38Q

IRF4905 (1 pcs) - https://amzn.to/3KYi5tO

IRF4905 (10 pcs) - https://amzn.to/3KVOuB2

1N5819 - https://amzn.to/3uPulqI

XL6009 - https://amzn.to/3khU5Gb

TP4056 (no protection) - https://cutt.ly/BGcbJIp

TP4056 (with protection) - https://amzn.to/36UTHKI

Protection module - https://amzn.to/3EVDi59


US:

ESP32 - https://amzn.to/3E1BBmu

INMP441 - https://amzn.to/3khriBz

Li-Ion Battery - https://amzn.to/3LkYXWX

IRF4905 - https://amzn.to/3EkBnHc

1N5819 - https://amzn.to/3vnqdgE

XL6009 - https://amzn.to/3Lo37xi

TP4056 (with protection) - https://amzn.to/37R4VQJ


UK:

ESP32 - https://amzn.to/3Jp9yyf

INMP441 - https://amzn.to/3vP70EO

IRF4905 - https://amzn.to/3rwWAZn

1N5819 - https://amzn.to/37TMESC

XL6009 - https://amzn.to/3LoZpTV

TP4056 (with protection) - https://amzn.to/36RZL6B

Step 1: Testing It Out

First we will have to upload the firmware on ESP32. Upload it the same way we did in my previous Sound Reactive Floor Lamp project just with one change, you will have to upload two firmware this time. One is the bootloader, and another is the actual firmware. All the steps can be found in the WLED webpage. After that I connected everything up in the breadboard to test it out. Connection diagram is attached in this step. Apply 5 volts and if the first 30 LEDs light up in orange, we are good to go. Follow the procedure to connect it to your home network and find its IP address. Go to the IP address and test it out. If you have connected everything correctly, it should work, no need to change any settings. Once you have tested it out, change the number of LEDs to 64 in the LED preferences setting.

I wanted to find out the maximum current this panel can draw which will be white color at full brightness. At 50% brightness it reached to drawing around 1.2 Amps which soon collapsed, the LEDs went back to orange, started acting randomly and ESP32 also stopped taking inputs. I though my power supply was not enough, which was weird as it was rated for 3 Amps. So, I connected another one with 10 Amps rating and the same thing happened. Then I had to change my setup, and was stable this time. Turns out my multimeter was faulty. At 25% brightness it draws around 1.25 Amps, 1.8 Amps at 50% brightness and 2.3 Amps at 100% brightness. Anyways this was just a test. It is strongly advised to never run this LED matrix on 100% brightness on any color. The panel gets heated up pretty fast and it can shorten the lifetime of the LEDs or even permanently destroy the panel.

For powering the whole thing I am using a Li-Ion battery with 2500mAh of capacity. For charging the battery I will be using TP4056 charger. You will notice that the charging module doesn’t have the protection circuit which we strongly need. I will be using a separate protection module for that.

Step 2: Making the Enclosure

I marked length of two 93mm and two 65mm on the wood block. I used a very fine curve cutting blade to get precise cuts and cut them out. Always keep 2-3mm of room for errors. You can always reduce the extra wood, but you cannot increase it. Be double sure of the dimensions, otherwise all our hard work can go to waste in no time. I will be using two of these 90-degree clamps to hold two wood pieces together. Then to further attach the wood pieces to each other I will use glue. The height at which these clamps will be attached is equal to height of the LED panel so that when the clamps are attached the LED panel can sit on top of it. Also, we will have to make cut-out for the battery charger on the 65 mm wood piece. But before doing all that make sure the wood surfaces are flat, mine were not so I will file them first. Using a wood file, I made the wood pieces exactly equal in length. To hold the clamps, screws will be used. Make sure the length of screws doesn’t cross the depth of the wood pieces. Also, the clamp should be exactly 90 degrees, if not take measures to make it 90 degrees. Use the LED panel as template to mark the place for screws. Using a masking tape as guide, drill holes on the marked places just enough to accommodate the screws. After one hole is drilled, fix the clamp there and make marking for second screw. This ensures that there is no chance for error. Mark the spot for charging module. Using a mix of tools like, hack saw, wood file, fine file etc. make the cut-out. Be patient as it can take time. It took me a total of 2 hours just to get this charger cut-out right. As it is battery powered, we will need a switch to turn the whole circuit on and off. I made markings and cut it out using combination of drill, jig saw with curve cutting blade, a file, and some patience. Now, as the depth of wood is a bit much, a small hole cannot guarantee that the sound will reach the sensor efficiently. We will need to bring the sensor closer to the environment. For that we need another cut-out. Make a pilot hole first, it will help in guiding the bigger drill bit. I tested if the sensor fits in 16mm hole, and it does. I tried to fit it in 12mm hole as well, but it didn’t fit there. So, 16mm it is. I made the hole on the original wood piece after this. A quick tip, save the wood powder as it can be used to fill small holes and gaps later. Last thing we need is hole for a blue LED that will tell us the battery is full. A 3mm blue LED does the job perfectly and the blue light seems to travel through the hole as well, so no need to take it any closer.

You know what time it issss, it’s time for sanding. I started sanding all the 4 pieces with a 180-grit sandpaper. The idea of sanding is to remove the residues that might have been settled on the wood over time, like these paint spots, so that the wood can absorb the polish we are about to do after this. Use something like a newspaper or a plastic sheet to collect the sanded away wood particles. You can clearly see the difference before and after sanding. It removed even the marker spots that I made. Once all the 4 pieces are sanded, we can start polishing them with this beeswax and a lint-free cloth. Take a generous amount on the cloth and start rubbing it on all the 6 side of the pieces. Take your time with this. The more patiently you’ll do it, the better it will look. After first coat I waited half an hour and applied second coat and then let it dry overnight. They look like this after they are dry. This is the first time I am polishing a wood, and this is not the best finish I have ever seen, but still it looks better than before. Should have applied an oil finish first though. Use a mixture of wood glue and wood powder that we saved to fill unwanted holes and gaps. Fix the switch with some super glue.

Step 3: Assembling

Moving on. I just realized I made a mistake; the hole for clamp on one of the 65mm piece should be in the back. I will drill it through for now and we can cover it up later. Ok so from here on, I will be forced to change my plan for I don’t know how many times. Let’s see. I attached the clamps and tried to fit the LED panel. There is a slight dimension mismatch, which is making the enclosure protrude longer on one side. I had accounted for the dimension of the battery with its holder, thinking it could possibly fit diagonally, and if not, I can shorten the holder to fit it diagonally. But fate has it that after doing so, we won’t have enough space for all the electronics. I desoldered the blue LED and soldered red and black wires for anode and cathode of the LED on the charging module. Test it out on an LED by disconnecting the battery from charging module and applying power to it. Using super glue, I fixed the charging module. Just make sure that it is flat, otherwise we can have trouble while completing the enclosure. Change of plans, I dropped the idea of using clamps to save space and used super glue instead to attach all the 4 wood pieces together. Use the LED panel as a template and apply a drop of glue to every place you can. Fix the panel temporarily using some drops of hot glue.

Change of plans again. I had to drop the battery holder to make space for other electronics and since I don’t have a spot welder, I had to use an old salvaged 2200mAh battery with attached nickel strips. I soldered the protection circuit to the nickel strips. The positive output from protection circuit is intercepted by the switch and connects to XL6009 boost converter to convert battery voltage to 5V. As it must handle a lot of amps it will get very hot. I will use a small heat sink to dissipate the heat. The LED strip connects to ESP32 using headers. I have also soldered headers to the microphone module, but the ESP32 will not fit in its place if we keep the microphone module in the hole we made. So instead, change of plans, we will have to put it in the back. I also added power sharing circuit below the ESP32 to be able to use it while charging also. The power connecter will connect to output of boost converter and purple wire will be connected to 5V input for the load sharing circuit. The ESP32 can fit in snuggly besides the battery. As the 5V input is directly connected to the load sharing circuit, whenever we are charging the battery, the whole circuit will turn on. We can prevent it by intercepting the 5V input using the same switch as it is a DPDT switch. Now circuit will only turn on when the switch is on even while battery is charging. As the 5V input pin is hidden, I utilized the pin 4 of TP4056 IC which is connected to 5V input to connect anode of LED and load sharing input pin. Once done everything can fit into its place like a puzzle piece. This project made me think if it was over-ambitious, but then again, I was somehow able to do it. So, I guess there is no thing called over-ambitious, it’s just a limit set by people’s mind, which ambitious people try to overcome. Enjoy the show.

I couldn’t decide on what to use for the front and back panel. I was thinking to use this milky white acrylic sheet for the front. Help me decide in the comments section below.

Step 4: Watch the Video!

It is easy to understand things visually. Take a look at my YouTube video on the same topic to understand the project deeply.

Step 5: Done!

I hope you liked this project. Don’t forget to like and subscribe. Till next time.

Supporting Links:

WLED website: https://kno.wled.ge/basics/getting-started/

SR-WLED website: https://github.com/atuline/WLED/wiki

How to install esptool: https://cyberblogspot.com/how-to-install-esptool-on-windows-10/

I2S Basics: https://www.youtube.com/watch?v=qNLvoSQCx60

INMP441 Datasheet: https://invensense.tdk.com/wp-content/uploads/2015/02/INMP441.pdf