HOW-TO: Music Reactive Desk Light



Hi! In this build we’ll make a good looking light that dances to all sounds and music, using simple components and some basic Arduino programming. It makes an awesome effect while standing on the desk when gaming, playing music, and anything else that makes sound really. Let’s get going!

(Click here to download schematic)



First things first: what kind of supplies do we need and what do they cost? Well, they are largely optional, and can be made with much improvisation. Even so, some key items are needed if you want to follow this guide:

Depending on the look you want, you might want to arrange the strips differently or diffuse the light in another way. This is where you can be creative. If you like my approach, I used the following items:

  • The tallest IKEA Droppar jar (IKEA Link)
  • A small length of PVC pipe.

All things considered I spent around 30$, where the LED strips were by far the most expensive part.



The star of the show is the sound detector module. This will provide an analog signal to the Arduino, which we can use to (hopefully) cleverly light the RGB lights. To be able to do this, we need to power both devices. Luckily they both require a 5 volt input. I am using a step down module to step down from 12 volts to 5 volts, but it would be easier to use a 5 volt power source directly. Wire the VIN on the Arduino and on the sound detector board to the positive input. Then wire the GND on the Arduino and the detector to the negative. Look at the black and the red wires on the attached schematic. We also need to hook the positive and negative input on the LED-strip to the power source.



After having connected all three parts to the power, we need to connect them to eachother.

The sound detector module will communicate with the Arduino over the analog input pins. I will be using pin number 0, but which one does not matter.

The LED strips need a digital pulse to be able to understand which LED we want to address. Hence we need to connect a digital output pin to the Arduino nano. I will using pin number 6.

Awesome, now we are mostly done with the electronics!



The most important part of this build will arguably be the code. It can change this build from pretty cool to insanely awesome. You can find the code i used here (github link). The main principle is to map the analog value we get from the sensor, to an amount of LEDs to show.

We can do this using the map function. This will let us display a certain amount of LEDs given an input, but nothing more than that. Doing only this might give you a jittery and flickering light. I decided to operate on the average of the llast X amount of readings to create a more sane and smooth transition. I also did some more advanced tracking of the song/sound intensity based on averages, to let the light change colors when the song enters a peak.

I will answer questions about the code if you have any, it’s far from done, and contributions are welcome!



With all the code and the components done, it is assembly time. The PVC is obviously hollow, and we will take advantage of that by stuffing the electronics on the inside. We’ll cut a slit in the PVC pipe to let us slide the strip out without obstructing the flush surface of the PVC hole. After that, we can glue the LED-strip to the PVC pipe. Some have asked me why I used hot glue, and not only the adhesive on the back of the strip. It’s simply because my experience with it is that it will hold fine on really clean and straight surfaces, but on a curvature like this it will most likely let go in a matter of days. Hence: hot glue!



First I thought the lid was made out of acrylic, so I tried to drill a hole in it. Turns out it was made out of glass, and it broke. Clever! So, that’s why I’m cutting out a sphere of acrylics with the same diameter as the lid, with a hole equal to the size of the PVC pipe in the middle. It turned out pretty cool, and I love the shine of new acrylic. Before putting on the frosted IKEA jar, we have to glue the stick of LEDs to the lid.



We can see by the hole, and the placement of the electronic components, we can reach both the Arduino USB interface and the power input from underneath. I took a little shortcut on the legs, and used some potentiometer knobs I had lying around. Ideally you want some nice wood or maybe some turned aluminum?



This was a great project, and I love it especially because it is so customizable and updatable in the future. I encourage you to look at the video in the top for the actual results. If you don’t want the instructions, you can skip to the end to see the action.

Thanks for watching/reading and remember to stay nerdy,
The Natural Nerds

32 thoughts on “HOW-TO: Music Reactive Desk Light

  1. hey,
    the led´s don´t react enough. How can i strength the analog signal in the code? They dont go up or down, only a little bit.

  2. Well, the easiest way should be to just increase the analog read signal (sensor_value = analogRead(ANALOG_READ); in line 158) by some factor (multiply by an integer), I think that should do the trick

    1. 1) I used 12 volt and stepped it down to 5 volt.
      2) Probably, but only for short LED strips to not draw too much power.
      3) The thing you circled is a power connector to easily attach power supplies.

  3. A lot of clap for this job.
    I would like to ask for some help because I don’t know how to use the code for Wemos D1 mini.

    Could you help me in that?
    Thank you in advance

  4. I’m dying trying to make it all happen for a little project at college..
    I am really having hard times here LOL
    I bought the cables, the Arduino, the sound detector but the LEDs are coming soon.
    Still didn’t understand very well about the step down module.
    I would love to start setting up everything even before the rest come from the mail service but I really can’t understand part of it. hahaha
    The video is not clear enough to me. I need details. I’m kinda new to this and I would love to be helped by someone like now. LOL.. thanks guys.

  5. Very nicely done!

    I have a few question though:
    How and what did you connect to your lm2596?

    Because his input range is (max) 40v, you cannot use 230v. And if I could use 230, how do I connect it nicely?


    Can I use a phone charger ~5v/3a output and put it in the Arduino nano? I am not sure if I connect the power to the arduino everything will work because the LED wil need around 2 amps.

  6. can i power LED strip via 12volt supply??? the RGB type used in video, because that will give more glow

  7. Hi great work. Thankyou for the code. Unfortunately the mic wired to the Arduino uno..which works nicely as the led on the unit lights up with beat after adjusting the threshold. Has no affect on the led even though the data is connected accordingly. Any advise would be greatly appreciated. Thanks Guy

    1. (do it on your own risk…..)

      i had the same problem and just linked the mic + with a wire with a rististor of 10k ohm,
      to one of my boxes (don’t do this without a resistor you can blow one of your channels )
      and this works for me ….

  8. Hi! Amazing project. I’m trying to build it, but unfortunately I purchased a WS2801 LED strip. It has 4 pins. 5V, Clock, Data, GND. Any idea if that would still work or how much changed needed to be made in the code?

    Thanks a lot!

  9. hello excellent project great, but unfortunately I have problems with the microphone is as if it lacked sensitivity, hit with a direct finger and if it detects but sounds of normal speech does not dectecta
    If someone helps me, I’d be grateful.

  10. Thank you so much for this project I love music, maker things and colourful lights! Just a quick question, I will do this project with a power supply, but is not clear for me if you need one 5v power supply but for both things, or one for the Arduino and one for the LEDs? I usually read that is better to power up strips with a different power supply than the one use by the Arduino

  11. Can you define what do you mean by the analog pi which reads the value from 0-1023, is it a specific type of pin or simply a jumper wire or an header pin can be used to dobthe trick??

Leave a Reply

Your email address will not be published.