Introduction: Sound Reactive RGB LED Piano Lights!

Hey everyone! It's Christmas, and lately I've been playing around with LEDs and my Arduino a lot. I got this awesome idea of lighting up my upright piano while tinkering with some RGB LED strips. The RGB LEDs emit light that gets reflected off the wall behind the piano, giving a stunning effect. The setup also includes a sound sensor circuit, with the help of which, the RGB LEDs change colour depending on how loud one plays notes on the piano!

Since no one has had such an idea and shared it on the net, I was on my own. Therefore I had a experiment quite a lot. However all my hard work has paid off well; my RGB LED lit piano looks great and compliments the Christmas tree very well indeed!

Here's a video showing how the piano lights look and how they change colour when I play the piano...

Step 1: Project Details...

Requirements:

  • Knowledge of electronics
  • Some experience with Arduino

Difficulty: Medium (installing the sound reactive RGB LED lights on a piano requires some skill)

Cost: For me, when converted it's about $7, because you'll get stuff cheap where I live.

Time: A weekend, 6 hours if you work nonstop.

Materials:

  • An Arduino Board - I used Mega, but you can use any other board. (SparkFun)
  • RGB LED strip (3m) - I got them cheap at a lighting store for $1 per meter. (SparkFun)
  • 2N2222 Transistors - 6 of them. (SparkFun)
  • Resistors - 220ohm (6 of them).
  • LM358 OR LM324 op-amp - I used an LM324 as it was what I had at the time. (SparkFun)
  • Electret Microphone - Also called Capacitive Microphone. (SparkFun)

Stuff You Can Learn From This Instructable:

  • Control RGB LED Strips With an Arduino.
  • Make An Arduino Measure Its Surrounding's Noise Level - with an electret mic amplifier circuit.
  • Make Sound Reactive RGB LEDs - Even if you DON'T have a piano, this Instructable will show you how to just make sound reactive RGB LED lights, which you can also implement in parties, discos, Christmas Trees etc.

Step 2: Make the Transistor Circuit...

Transistors amplify the current from the Arduino for the LED strip. I have used 2N2222 Transistors as they can handle upto 600mA. That's only good enough to run a 1m strip bright.
Hence for 2m, we need six transistors (3 for each strip - red, green and blue LEDs). See the above Fritzing diagram and my circuit to make the transistor circuit on a breadboard.

Step 3: Prepare the RGB LED Strip...

For this project you'll need two 1m RGB LED strips, totaling 2m. This way it is easier to mount on the piano. Start with a 1m strip. Solder wires, as shown in the first picture. Then cover it up with insulation tape. You can also put some insulation tape around the wires as shown in the last picture, so that it's easier to handle them when connecting to the breadboard.

Step 4: Prepare the Electret Microphone...

Determining Polarity:

This means figuring out which pon is + and which is "-". Using a continuity tester, find out which terminal of the mic is connected to the outer metal casing. This pin is Ground, and the other is "+".

Solder Wires to Mic:

Solder wires (about 6 inches long) to the mic as shown above. I've used green as ground and yellow as "+".

Step 5: Make the Microphone Amplifier Circuit...

The mic itself gives a very feeble signal, so I have used an op-amp to amplify the signal for the Arduino to read with its analog input.

I have used an LM324 quad opamp, which is an overkill, as we need only one. You can use an LM358 dual opamp - only the power pins are different, the rest of the circuit is the same. Sadly the 741 single opamp didn't work very well.

See the diagram and pictures for the circuit.

Step 6: Connect the Arduino...

You can buy male-to-male jumpers, but I made them myself, using male headers and some ordinary jumper wire. See the 2nd picture. See the above Fritzing diagram and pictures showing how to connect the Arduino to the breadboard circuit.

Step 7: Testing the RGB LED Strip...

Before going ahead, you'll have to first test if the RGB LED Strip and the driver circuit are working. Upload the below sketch to the Arduino.

Note: If you're using a Non-Mega Board (like the Uno), be sure to change the led output pins to PWM compatible pins on your board (Uno - pins 2, 3, 4 will work).


Step 8: Test and Calibrate the Mic Amplifier Circuit...

Testing the amplifier circuit:

This is to see whether the mic amplifier circuit works or not. You can simply connect an LED to the output (pin1) of the opamp and see the change in brightness in response to the sound.

Using an Arduino to test: This is more accurate. Upload the AnalogReadSerial sketch to the Arduino.

(File > Examples > AnalogReadSerial)

Now open Processing and copy the code from below (graph_line.pde). Now run the Processing program. As the Arduino sends the values of the A0 pin via USB, the Processing program will plot those values on a analogvalue - time graph, from 0 to 1023.

When you clap or make some noise, the slope of the graph should correspondingly become higher.

Step 9: Upload the Code to the Arduino Board...

Copy the code from the file below to your Arduino IDE window. Before uploading, note that if you're using a non-mega board, change the led output pins to 2, 3, and 4.

  • Code updated: 27 Dec 2014

Step 10: Install the RGB LED Lights on the Piano...

Using Double tape and normal sticky tape, stick the 2 RGB led strips to the back of the piano, as shown in the pictures above. Don't worry, the tape won't damage the wood of the piano, and can be easily taken of later. However, do not put too much tape either. The wire connecters for each Strip should accessible from the top of the piano...

Step 11: Connect the LED Strip...

Connect each strip to the Transistor driver circuit on the breadboard, as shown above. You may use the Fritzing diagrams shown in the earlier steps. Basically each channel (R, G, and B) is connected to the collecter of each transistor.

Step 12: Finish!

Now connect the positive wire of the 12v power supply to the "+" wire (green in my case) of each RGB led strip, and also the "Vin" of your Arduino board. The ground wire is connected to the Arduino's ground. (Note: My Arduino's on onboard regulator doesn't work so I had to power it with a USB powerbank).

Now turn on your power supply, and you RGB LED Strip should light up wonderfully behind your piano! Playing anything will change the colour of the lights, depending on how loud you play.

This setup works great for parties, discos, clubs, and in my case, Christmas!!! Of course, you don't need a piano - you can mount these sound reactive LED strips anywhere; your house, table, sofa, bedroom, or your Christmas Tree!!!

Comments

author
kyokorn (author)2015-06-04

What is the value for the capacitor (in the Amp Op circuit) ?

author
Orleck (author)kyokorn2017-01-30

did you ever figure this out, i've been wondering this too

author
Orleck (author)2017-01-26

i ordered the few things i don't already have, this is awesome, I can't wait to set it up and play, then not say anything and wait until the wife plays and notices xD

author
aparry7 (author)2015-11-25

where do I get the processing application from?

author
liverdye (author)2015-06-30

Hey there! I am trying to a similar project but on a smaller scale. Anyways, I noticed that you claim that the lm324's VCC is pin 11 and the GND is pin 4 but in the datasheet it says the opposite.

Also, whenever I try to wire my op-amp your way my Arduino's LEDs start fading away and the op amp gets really hot.

I am just curious why you decided to wire your op-amp that way and would you have any idea why mine is freaking out? I can only think that I'm short circuiting my Arduino.

I have an UNO and the same LM324 op amp. Thanks!!!

author
kyokorn (author)2015-06-02

Hi, first, excellent work !, You have the electrical diagram circuit ?

author
DangerousTim (author)kyokorn2015-06-11

sorry for replying late... The diagram is there in the instructable

author
kannond (author)2015-02-28

That is awesome!! I love it.

author
Deslivres (author)2015-01-04

That is a great idea ! I can think of a few musicians here and there who would love it. I'll make sure to pass it around !

author
Bligoan (author)2014-12-27

Good idea and realization.

About This Instructable

25,417views

173favorites

License:

Bio: Linux n00b, hacker
More by DangerousTim:ESP8266 Desktop Clock (WiFi Synchronised!)Linkit ONE GPS TutorialLinkit ONE Setup Guide
Add instructable to: