Music Reactive Desk Lamp

63,492

823

105

Introduction: Music Reactive Desk Lamp

About: We are a couple that loves creative projects, and retro gaming. We will be posting anything that we make related to it, with DIY videos, crafts, projects, retro gaming, build logs and showcases. Make sure to …

Hi! In this instructable we'll be building 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!

Step 1: Main Supplies

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.

Step 2: Powering the Components

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.

Step 3: Detector & Strips

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!

Step 4: Uploading the Code

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!

Step 5: Did Anyone Say Stuffing?

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!

Step 6: The Container Itself

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.

Step 7: Finishing Up!

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?

Step 8: Done!

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 reading through, hope it was worth your time.

Hansi

Arduino Contest 2016

Second Prize in the
Arduino Contest 2016

Make it Glow Contest 2016

Participated in the
Make it Glow Contest 2016

Epilog Contest 8

Participated in the
Epilog Contest 8

4 People Made This Project!

Recommendations

  • Battery Powered Contest

    Battery Powered Contest
  • Plywood Challenge

    Plywood Challenge
  • Plastic Contest

    Plastic Contest

105 Discussions

0
pul2007
pul2007

Question 4 months ago on Step 1

I bought A New arduino NANO........I have now plugged it in my laptop......What to do next..
I Need Step By Step Instructions

0
pul2007
pul2007

Question 4 months ago on Step 1

Can I use aux cable Or Usb Cable instead of stepdown or battery.......(because i want to connect directly to jbl speaker charge 4

1
manudmaker
manudmaker

7 months ago

cool project . I've done something like this. did u have any noise creeping into the circuit and causing random lights to light up , mine works fine with uno but not with the nano

0
JoelN50
JoelN50

Question 1 year ago

Does it work with APA102C strip? It has 4 pins. Voltage, Ground, Clock and Data. If it works, should I connect it to Clock or Data input?

0
DudotP
DudotP

Answer 1 year ago

Bro, did you found out already where to connect? If yes, where? I don't know too and i desperately need it because of our school exposition. Thanks in advance bro

0
eyjayrel
eyjayrel

3 years ago

can I use the 5V 1.5A smart phone charger to power all three components ( arduino, module and strip )? please reply

0
DaleBb
DaleBb

Reply 2 years ago

Definitely not. I tried it with a 72 LED strip and it made the lights flicker and turn on and off at random. I ended up buying a charger with two 2.1A USB outlets and used one to power the LEDs and the other for the sound sensor and Arduino. That worked fine. It's a bit bulky though.

2
EdurneE
EdurneE

Tip 2 years ago on Step 4

For the lamp to work, just include the code sound_reactive.ino?

0
EugeneC31
EugeneC31

2 years ago on Step 3

cool project, im new in arduino, can i place the code to arduino IDE?

0
BeulahG1
BeulahG1

2 years ago

can i get the abstract for the project?

0
Delta1Dan
Delta1Dan

3 years ago

Hey, I wanted to use this project but instead of having the audio sensor, could I just connect it straight to an audio source using a jack cable? Or would that require extra code?

0
Alan-brito
Alan-brito

3 years ago

Hello, I have a question. I would like to do this but I dont have the "Individually Addressable LED strips"

Can I do that whit an RGB Led Strip?

0
EdwardF2005
EdwardF2005

Reply 3 years ago

RGB strips with R G B and GND input wouldn't work. In the tech world these are called 'dumb' led strips. the WS281B LEDS that they were using are induvidually addressable and called smart LEDs

0
xilense
xilense

Reply 3 years ago

hi alan, i think it would not work with RGB Led Strip

0
AaronM255
AaronM255

3 years ago

Hello I have done what they said for the blinking, the problem is that it does not change my color, you are only in blue. What can I do?
Thank you and sorry for my bad english

0
igordon18
igordon18

3 years ago

Hey! A friend and I are building this together and everything seems to be working pretty well, however, the LEDs are not changing color. We have made a few edits to the code in the MIC_LOW and MIC_HIGH areas as suggested in the comments and have adjusted the low and max values, and nothing has worked. Any ideas?

0
JONATHANW177
JONATHANW177

3 years ago

I keep on getting the error of error: 'leds' was not declared in this scope

is there any way to fix it, I tired a couple of things but nothing is working

0
marks789
marks789

3 years ago

Hi im a newbe at code, i keep getting errors,like CRGB does not name a type.thats just one of the many error,is there any chance you could send me the finished code plz

0
17berhey
17berhey

3 years ago

Anyone use an alternative jar? It wont let me order the Ikea jar suggested.

0
RobertB26
RobertB26

3 years ago

Hi!
How many meters LED did you use?