Sound Reactive RGB LED Piano Lights!

by DangerousTim in Circuits > Arduino

32575 Views, 180 Favorites, 0 Comments

Sound Reactive RGB LED Piano Lights!

549c2d41c6ba5d34ba00003d.jpeg
25.12.14 piano trials 011.JPG

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...

Project Details...

549c138426ece2cba90000fd.jpeg

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.

Make the Transistor Circuit...

piano lights transostor.jpg
549aa21ec6ba5d5e9500006c.jpeg
549aa261c6ba5d419300001a.jpeg

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.

Prepare the RGB LED Strip...

22.12.14 piano pics 007.JPG
22.12.14 piano pics 019.JPG
22.12.14 piano pics 010.JPG

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.

Prepare the Electret Microphone...

22.12.14 piano pics 009.JPG

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 "+".

Make the Microphone Amplifier Circuit...

piano amp.jpg
piano christmas 004.JPG
piano christmas 013.JPG

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.

Connect the Arduino...

piano lights with arduino.jpg
22.12.14 piano pics 015.JPG
22.12.14 piano pics 016.JPG
22.12.14 piano pics 017.JPG

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.

Testing the RGB LED Strip...

22.12.14 piano pics 003.JPG

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).


Test and Calibrate the Mic Amplifier Circuit...

piano christmas 005.JPG
22.12.14 piano pics 005.JPG

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.

Downloads

Upload the Code to the Arduino Board...

arduino_logo.jpg

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

Downloads

Install the RGB LED Lights on the Piano...

22.12.14 piano pics 021.JPG
549c0982dbf3ec5530000036.jpeg

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...

Connect the LED Strip...

22.12.14 piano pics 026.JPG

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.

Finish!

25.12.14 piano trials 011.JPG
25.12.14 piano trials 002.JPG
22.12.14 piano pics 027.JPG

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!!!