myLaserHarp: Music with strings of light!
Lasers are awesome! Music is too! Using NI myRIO, I managed to combine the two to create myLaserHarp. When playing this novel electronic instrument, your fingers break parallel beams of light to create musical notes and scales. As if that wasn’t enough, using Solenoids and MIDI files, I also taught myLaserHarp to play itself!
Who am I?
My name is Adam Metcalf and I am currently a Mechanical Engineering student at the University of Leeds. Whilst on an Industrial placement at National Instruments I was given the opportunity to spend a week working on an intern project. The result of this is myLaserHarp.
Why did I choose this project? As a Mechanical Engineer I have limited experience with electronics, so I was keen to get to grips with the fundamentals. myLaserHarp uses a light detection circuit to determine when a laser beam has been broken (and thus the 'string' is 'plucked'). I also have no musical talent whatsoever, so it was important that I included a way for the instrument to play itself
myLaserHarp:
myLaserHarp has an array of 12 lasers set opposite an array of light dependant resistors which are part of a 'dark sensing' circuit. When the laser is blocked, the 'dark sensing' circuit sends a signal to the myRIO, which generates a square wave of a frequency corresponding to the correct note. This square wave is played through a speaker, which comes out as a note sounding delightfully 8-bit in nature. myLaserHarp can be played by simply intercepting the lasers with your fingers ('plucking the strings'), or you can upload a MIDI file to the myRIO. The myRIO will read the MIDI file and actuate solenoids, which pop-out and block the lasers, thus 'plucking the string'.
Figure 1 shows myLaserHarp after the build was completed:
myLaserHarp consists of a few independent systems which have been combined. In no particular order these are:
1. A laser circuit - This powers the 12 lasers which are the 'strings'
2. A light-sensing (or rather 'dark-sensing') circuit - This is to detect when the laser is intercepted (or the 'string' has been 'plucked') and send a signal to the myRIO.
3. Solenoids - These break the laser beam which a signal is received from the myRIO.
4. Relay boards - These are to provide power to the solenoids when a signal is received from the myRIO.
5. LabVIEW and a myRIO - Combined, these are the brains of the operation. The myRIO is responsible for detecting when the laser has been broken, generating the correct frequency to play the correct note, reading the MIDI file, determining when to actuate the solenoids and actuating the solenoids.
6. The frame - myLaserharp was built from copper pipes which were then suspended in a frame made from wood.
7. The speaker - The cheapest speaker that can be bought from Amazon Prime.
Hardware:
The solenoids are powered by relays which are controlled by the myRIO. This is because they would exceed power limitations if directly controlled from the myRIO. Figure 2 shows how the solenoids and the relays were configured:
The external 5V power was supplied by recycling a USB charger for a phone. Polystyrene balls were cut in half and glued to the solenoids using Araldite (known in the office as 'forever glue') to extend their reach. Figure 3 shows the setup when built into myLaserHarp:
In bright light, a LDR (Light Dependent Resistor) has a low resistance. This means that when there is a laser beam shining on the LDR, the LED is not lit and there is no signal sent to the myRIO. When the laser beam is broken, the LDR increases significantly in resistance, and so the LED will be illuminated and a signal will be sent to the myRIO. Figure 4 shows the circuit diagram of the 'dark sensing circuit':
Figure 5 shows the strip board being built:
Figure 6 shows myLaserHarp being built. The wires to connect the LEDs and the LDRs were fed through the copper pipes. On reflection, copper pipe was not a good idea for the since it is essentially an short circuit waiting to happen (and this occurred more than once):
figure 7 shows the lasers being connected. There was great difficulty in aligning the lasers with the LDRs, but this was overcome with copious amounts of Araldite (forever glue):
The wiring became a bit of an issue. this was not something that I planned or implemented particularly well, but I simplified the connections to the myRIO by creating some bodged wiring looms as shown by figure 8:
Software
The application was all programmed in LabVIEW 2016, and there are a number of separate parts.