I created a Laser piano using LDR and laser light diode. I used Arduino Leonardo Pro Micro connected to a speaker to generate sound. You can modify the tune of the piano by tweaking in the code and changing the frequency. I wanted to create something cool which can produce music and I ended up making this.
Making the base and structure of piano
The base is made up of lot of cardboard ad glue gun. I have given the details along with the dimension in the image. Also make sure you are choosing the right kind of cardboard for making it.
The base is made up of hard cardboard.
For this tutorial you will need the following components:
- Arduino Leonardo Pro Micro - 1
- 10 K resistor array - 1
- Laser diode - 8
- LDR - 8
- Speaker - 1
- Soldering Gun
- Nose Plier
- Wire Stripper
First Step : Marking, Cutting and Gluing base
In this step, we are going to cutout cardboard with the given dimension. we are using good quality cardboard to avoid any lose structure. Also make sure that you are ready with your glue gun.
After cutting the cardboard, it should approximately measure 20cm in height and 2.5 cm in width. I have already doubled the cardboard to make it strong and durable. Since we are going to put up LDR on the above side, I have made 8 holes. Each hole will occupy and LDR sensor for our Laser Piano DIY.
I have made the holes aligned to the same as holes on the above on the bottom. So my laser diodes are directly pointing the light on the LDR. If I place hand between them, it will send the input signal as LOW to arduino and the program will turn on the speaker depending upon which Light I obstructed.
Second Step : Inserting and attaching LDR and Laser diode in the cardboard
Making the Circuit
Finally make the circuit as per the given circuit diagram. Note that I have used a 10K resistor array instead of normal 10K resistor. If you don't have a resistor array, you can use normal resistor.
Our code is simple and uses 'delay' function to generate different sound. We are turning on speaker with frequency for certain time.
Github Link : https://github.com/vikkey321/Laser-Piano-DIY
I hope you enjoyed this tutorial. If you want to continue watching awesome tutorials for me then subscribe to my YouTube channel.
Full Step wise documentation available on hackster : https://www.hackster.io/vikkey321/laser-piano-diy-988e0b
My Social Profile Links: