ūüí° RGB LED Piano Light

Recently, I experimented a bit with LEDs and my Arduino controller. And I got a great idea - to make the backlight of the RGB LED tapes for the piano. RGB LEDs emit light that reflects off the walls at the piano, creating a stunning light effect. The device also includes a circuit with an acoustic sensor, under which the RGB LEDs change color depending on the volume of the music produced by the piano!

Since so far no one has implemented such an idea and has not posted it on the Internet, I will demonstrate my own. In this regard, I needed to experiment a little. But all my labors were richly rewarded; my RGB LED backlit piano looks great and perfectly complements the Christmas tree!

 Above is a video that demonstrates how the piano looks and how the colors change when I play the piano.

Step 1: Project Components

 

Requirements:

  • Knowledge of electronics
  • Little experience with Arduino controller

Difficulty: Medium (an installation that reacts to the sound of an RGB LED piano requires some experience).

Price: For me, the device costs about $ 7, because where I live, everything is very cheap.

Project Lead Time: A week or about 6 hours of continuous work.

Materials:

  • Arduino board
  • RGB LED strip (3m)
  • Transistors 2N2222 - 6 pieces.
  • Resistors - 220 ohms (6 pieces).
  • Operational amplifier LM358 or LM324 - I used the LM324 because it was just at my fingertips
  • Electret Microphone - Also Called Capacitive Microphone

Experience you receive from this project:

  • Control RGB LED strips through an Arduino controller.
  • The ability to learn through the Arduino controller to measure the level of ambient noise - using an electret microphone with an operational amplifier.
  • Make the RGB LEDs respond to sound - even if you do not have a piano. This project will demonstrate how to make RGB LEDs change color depending on the sound, and the experience can be used at parties, discos, for Christmas trees, etc.

 

Step 2: Creating a Transistor Circuit

 

 

 Transistors are designed to amplify the current from the Arduino controller for an LED strip. I used 2N2222 transistors, as they are designed for currents up to 600mA. This is quite enough to ensure the brightness of the LED strip with a length of 1 meter.
Therefore, for a 2m long ribbon, we need six transistors (3 for each ribbon - from red, green and blue LEDs). See the above Fritzing diagram and my diagram to assemble the transistor circuit on the breadboard.

Step 3: Preparing RGB LED Strip

 

 

 

 For this project, you need two RGB LED strips with a length of 1m, that is, a tape with a total length of 2 meters. Start with 1-meter tape. Solder the wires as shown in the first image. Then insulate the soldering spot with insulating tape. You can also insulate the wires as shown in the last image; this will help facilitate their connection to the breadboard.

Step 4: Preparing the Electret Microphone

 Polarity detection:
First, it is necessary to determine which of the conclusions is positive "+", and which of them is negative "-". Using the device to monitor the integrity of the circuits, determine which of the microphone leads is connected to the external metal casing. This conclusion - the land, and the second "+".
Soldering wires to the microphone:
Solder the wires (about 15 cm long) to the microphone as shown above. I used the green wire as the ground pin and the yellow one as the positive "+" pin.
Step 5: Create a microphone gain circuit

 

 

The microphone itself transmits a very weak signal, so I used an operational amplifier to amplify the signal for the Arduino to read information from its analog input.
I used the LM324 four-channel operational amplifier, but this is certainly overkilled since we only need one channel. You can also use the LM358 dual-channel operational amplifier ‚ÄĒ only the power pins are different in it, the rest of the circuit is similar. By the way, the single-channel operational amplifier 741 works very poorly.
See the diagram and images for this circuit.
Step 6: Connect to the Arduino

You can buy dad-like jumpers, but I made them myself using a pin connector and a few ordinary jumpers. See the 2nd image. Refer to the Fritzing schematic and images that demonstrate how to connect an Arduino controller to a prototype circuit board.

Step 7: Testing RGB LED Strip

Before proceeding, you must first check the operation of the RGB LED strip and driver circuit. Load the following sketch into the Arduino.

Note: If you use a non-Mega board (like Uno), do not forget to change the output pins for the LED on the PWM compatible pins on your board (for Uno pins 2, 3 and 4 will be used).

Step 8: Test and calibrate the microphone gain circuit

Amplification circuit testing:

This procedure is designed to test the performance of the microphone amplification circuit. Simply connect the LED to the output (pin 1) of the op-amp and see how its brightness changes depending on the sound level.

Using Arduino for testing: This is a more accurate test method. Load the AnalogReadSerial sketch into the Arduino.

(File> Examples> AnalogReadSerial) - (File> Examples> AnalogReadSerial)

Now open Processing and copy the code below (graph_line.pde). Then run the Processing program. As soon as the Arduino sends the A0 output values ‚Äč‚Äčvia USB, the processing program will determine these values ‚Äč‚Äčin the "analog values ‚Äč‚Äč- time" diagram in the range from 0 to 1023.

When you clap your hands or make some noise, the slope of the signal in the diagram will be correspondingly higher.

Step 9: Load the code into the Arduino controller

Copy the code from the file below to the IDE Arduino development environment. Before loading, note that if you use a non-mega board, change the output pins of the LED to 2, 3, and 4.

 piano_new_way.ino

Step 10: Install RGB LED Ribbons on the Piano

Using double-sided and regular adhesive tape, glue two RGB LED strips to the back of the piano, as shown in the image above. Do not worry, the tape will not damage the wooden surface of the piano, and it can be easily removed later. However, do not use too much adhesive tape. Wired connectors for each ribbon must be accessible from the top of the piano.

Step 11: Connecting the LED Strip

Connect the positive 12V power supply wire to the ‚Äú+‚ÄĚ wire of each RGB LED strip, and also the ‚ÄúVin‚ÄĚ of your Arduino board. The ground wire connects to the Arduino ground.

Well, now you can apply power, and your RGB LED strip will light up beautifully behind your piano! Playing the piano will change the color of the lights depending on the volume of your game.

This project is perfect for parties, discos, clubs and in my case for Christmas !!! Of course, you do not need to play the piano - you can place these LED strips that react to the sound level, anywhere: on a wall, table, sofa, in the bedroom or on your Christmas tree !!!

  • Jun 16, 2019
  • Category: Arduino
  • Comments: 0
Leave a comment

Please note, comments must be approved before they are published

Shopping Cart
0
No products in the cart.