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...
- 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.
- 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...
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 "+".
Step 5: Make the Microphone Amplifier 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!!!