Laser Piano
A laser-based piano I built as my final physics project. The project uses an Arudino Leonardo, lasers and light sensors to detect when the laser beams are interrupted and turn those interactions into piano notes.
Components
Hardware
- Arduino Leonardo (I used a generic one)
- ALS-PT19 Light Sensors
- 5mW , 510nm Lasers
- 10kΩ resistors
- Breadboards and Jumper Wires
- Smoke machine (for visualizing the laser beams)
Software
- Ardunio IDE
- Dot Piano
How it works
Laser --> Light Sensors --> Arduino --> USB MIDI --> Computer --> Dot Piano
The laser shines onto a light sensor. The sensor detects the amount of light and produces a voltage based on the light intensity.
The Ardunio reads this signal as a number and compares it to a threshold. When the laser beam is interrupted, the Ardunio detects the change and sends a MIDI message.
The Arudnio does not send the actual audio. MIDI sends a signal to computer to play the note. The computer then uses a synthesizer to produce the sound. For this project, I used Dot Piano to play the corresponding notes.
Building Process
I started with a simple prototype using a button and an LED. When the button was pressed, the LED would turn on. This helped me understand the basic idea of taking an input and using it to create an output.

I then replace the button with the laser and light sensor system. The light sensor allowed the Ardunio to detect changes in light. The Ardunio reads the sensor's signal and converts it into a number. I tested the sensor readings and used a threshold to determine when a lase bame is being detected or has been interrupted.
When the lase beam is interrupted, the Arduino detects the change and sends a MIDI message. I assigned each laser to a different MIDI note so that breaking each lase beam could trigger a different note. Code can be found on my Github.
Final Product
The photo is a bit blurry because of the smoke.
This is the video of me demostrating my laser paino.
https://youtube.com/shorts/vk3LccugjRM?feature=share
ps: Since the lasers were laboratory equiment, I had to return them after the final presentation. So, I don't have a permanent setup.
Thank you for your time👍👍