Introduction: Analog Laser Guitar Hero
Being both an analog enthusiast and a lover of Guitar Hero, at times I wonder exactly how the game works and if I could build a standalone version myself. This Instructable shows how to build a Guitar Hero variant entirely out of analog circuits on breadboards. No game console or game software needed. Just build a laser "guitar."
The "guitar" is a series of lasers spaced out like guitar strings. There are eight lasers, one for each note in an octave. Simply input a music stream and the lasers light up synchronized to the notes in the music. Block the lit lasers with your hand to play the notes, which you hear through speakers.
See a demo here: http://www.youtube.com/watch?v=2jXdVuBmwm4. (In case you're wondering, the clapping sound in the video is someone clapping two chalkboard erasers together to release chalk dust into the box. The chalk dust illuminates the laser beam trails. There's also some background music playing all the time through the speakers.)
Step 1: Overall Design
Above is a block diagram of the overall design. Music from a computer is fed into the Note Detection block, which detects which notes are to be played at a given time. That information is sent to the eight lasers. If a note is to be played, the corresponding laser turns on. On the other side of the lasers are eight detectors that determine if you've played a note by blocking the corresponding laser. If you've played a note correctly, that note from the music is switched into a speaker so you can hear it. Otherwise you don't hear the note.
Step 2: Parts List
Below is a list of the parts you'll need. If you are a student, it's quite easy to obtain many of these components directly from their manufacturers for free. It also doesn't hurt to ask local schools or universities for parts. Otherwise, all components can be obtained from online part vendors.
-Breadboards (6.5" x 2.2") (13)
-Op amps: LF356N (26) or LM741 (26), LT1632 (8), LM358 (3)
-Multipliers: AD633 (7)
-Resistors: 5.6 (2), 30 (8), 31 (16), 680 (8), 1k (9), 3.6k (7), 3.9k (2), 6.8k (7), 10k (35), 12k (7), 13k (8), 13.5k (7), 16k (7), 17.5k (7), 20k (1), 22k (1), 24k (7), 30k (2), 36k (7), 100k (18), 110k (7), 150k (8), 200k (1), 300k (16), 1M (15), 2M (2)
-Capacitors: 0.1uF (55), 1uF (34)
-Diodes: 1N914 (13), 1N4001 (2)
-Transistors: 2N7000 (10), 2N2905 (1), 2N2219 (1)
-Lasers: VLM-650-03-LPA (8)
-Photodetectors: SFH310 (8)
-Voltage Regulators: LM78M05 (2)
-3.5mm Mono Plug (1)
-Lot of solid wire (~200ft, get different colors if you like color coding)
-Any set of speakers
Optional Components for Power Supply (see Step 12):
-Breadboard (6.5" x 2.2") (1)
-Capacitors: 1uF (4), 1000uF (8)
-Diodes: 1N4001 (4)
-Transformer: Triad F-354X, with attached outlet plug
-Switch: dual DPDT switch
-DC 15V power supply (don't need if you are building your own in Step 12)
Optional Components for Laser Box (see Step 13):
If you're not making a wood box:
-Cardboard box (2' x 1' x 1')
-Hot glue gun
If you are making a wood box:
-Wood (1"x10" stock or 1/2" plywood)
-Biscuit cutter or router
-Hot glue gun
If you are including dry ice:
-Dry ice (about 6 pounds)
-Cardboard or perfboard
-Small plastic bowls or plates
-Computer fans (2 or 3)
If you are including chalk dust:
Step 3: Creating the Music
Attached is a sample music file that you can use as input into the system. The song is Carol of the Bells. I've also attached a test file that plays basic notes and chords that you can use to test the system. To create your own music, you can use any available music composition software, as long as it outputs sine waves -- no instrument effects. Also, the notes in the music must mostly be within one octave above middle C; otherwise you won't hear the music! An example software is REAPER, which is a shareware program available online that lets you import MIDI files with your favorite songs (find them online) and output sine waves to the system. You can also transpose the music and change its tempo in the program.
Step 4: Note Detection Block
The next few steps focus on building the note detection block. Above is a diagram of the block. Let me first give an overview of the theory behind this block, but if you're not interested, skip to the next step to start building.
The music from the computer is just a combination of sine waves at different frequencies corresponding to the notes in the music. We use a technique called heterodyning to detect the notes. We start with oscillator circuits to produce seven different frequencies. Each frequency is independently multiplied (mixed) with the incoming music signal to produce seven separate signals out of seven multiplier circuits. An eighth output just contains the incoming music signal. Each of these eight channels is responsible for detecting one of the eight notes in the octave starting at middle C.
Here's the main idea: when a certain frequency of music is multiplied by another frequency, part of the output signal has a frequency that is the sum of the input frequencies. The oscillators and multipliers in the first seven channels are designed so that the frequency of each of the first seven notes in the octave, when added to the oscillator frequency in one of the channels, gives exactly 520 Hz. For example, consider the channel for detecting middle C, which has a frequency of 261 Hz. That channel contains a multiplier and an oscillator with frequency 259 Hz. When the inputs are multiplied together, the output is a signal with 520 Hz frequency. So if the note C is in the music at a given time, the output of that channel contains 520 Hz. Otherwise, the output does not contain 520 Hz. Similarly, each of the other first seven notes in the octave corresponds to a different channel that outputs 520 Hz if the note is in the music. The highest note in the octave is already at 520 Hz, so no multiplier or oscillator is needed in the eighth channel.
Next, these eight channels are fed into an array of eight bandpass filters, which determine if the channels contain 520 Hz. If a bandpass filter sees 520 Hz, it outputs a large signal; otherwise, it outputs nothing. So if a note is in the music, the corresponding channel will contain 520 Hz, and the output of the corresponding bandpass filter will be a large signal.
Finally, the eight channels are fed into a detection circuit that essentially determines if there is a large signal in each of the channels. The output of the detection circuit for each channel is hooked up to a laser for the corresponding note, so if the note is in the music at a given time, the detection circuit sees a large signal and turns on its laser.
In summary, there are eight channels in the note detection block corresponding to each of the eight notes in the octave and each of the eight corresponding lasers. If the music contains a note, that corresponding channel is active and its laser turns on. When the note finishes, the laser turns off.
Step 5: Breadboarding Techniques
All the circuits will be built on breadboards. Before we start, first a few quick notes on breadboarding techniques. Above is a picture of a breadboard. Note that there are two vertical columns on both sides and many horizontal columns in the middle. The holes in each of the vertical columns are electrically connected (for example, the holes in the green box above). The holes in each of the horizontal columns are connected (for example, those in the red box above).
Unless otherwise stated, we will use the vertical columns for the power rails shown above. These power rails will be hooked up to power supplies discussed in Step 12. When breadboarding across several breadboards, we need to connect the corresponding power rails with wire. Also, it is a good idea on each breadboard you work with to insert a 1uF decoupling capacitor between the 15V and GND rails and another between the -15V and GND rails.
Finally, we will be using many chips like the one shown above. The place they go on the breadboard is in between the horizontal holes, shown by the blue box on the breadboard. When placing chips, make sure that the round indentation in the corner of the chip is facing towards the top of the breadboard.
Step 6: Building the Oscillator Circuits
Above is the schematic of one oscillator circuit. In technical terms the oscillator is a Schmitt trigger relaxation oscillator. Above you'll also find a picture of the circuit layout on a breadboard. At the top of a breadboard, first place the LF356 chip as shown. Next, add the resistors, capacitors and wires. The letter labels of the components in the picture correspond to the letter labels of the components in the schematic.
When finished, repeat this process for the other six oscillator circuits, working your way down the breadboard. To make each oscillator circuit output a different frequency, you need to change the value of resistor A in each circuit. For the first circuit, use A = 12k. For the second, use A = 13.5k. For the third, use A = 16k. For the fourth, use A = 17.5k. For the fifth, use A = 24k. For the sixth, use A = 36k. Finally, for the seventh, use A = 110k. Try to place all the circuits on one breadboard.
At the end, the layout should look similar to the second picture above. Note that my layout for all seven oscillators is slightly different from yours because instead of resistor A I use a variable resistor in its place, called a potentiometer. For me, this is good for testing out the circuit, but for you, please lay out your circuit according to the first picture.
Step 7: Building the Multiplier Circuits
Above is a schematic and layout for one of the seven multiplier circuits. Starting from the top of a new breadboard, lay out the first multiplier and repeat the process for the other six, working your way down. You may need two breadboards to lay out everything. To use a second breadboard, connect the top of the second to the bottom of the first (the breadboards should have a way to secure them together), making sure to also connect the power rails.
When finished, the layout should be similar to the last picture above. Now, connect the left side of the top breadboard to the right side of the oscillator circuit breadboard (connect power rails too), and wire each oscillator output to a multiplier input as shown. In other words, the output of the first oscillator should go to the input of the first multiplier, the output of the second to the input of the second, etc. We will hook up the input music in a couple of steps.
Step 8: Building the Bandpass Filters
The schematic and layout of the bandpass filters are above. In technical terms, the bandpass filter in each of the eight channels is a four-pole multiple feedback active filter that takes the input signal and filters out any frequencies outside of 520 Hz within a 10 Hz bandwidth. So if there is a 520 Hz signal coming in, there is a 520 Hz signal coming out. Otherwise, the output is zero.
Starting at the top of a new breadboard, build the bandpass filters according to the schematic and layout picture. Work your way down to build seven more -- you will need two breadboards. For the last bandpass filter, use a 10k resistor for resistor A instead of a 3.6k one. (Technically, this is because the eighth channel does not include a multiplier, which attenuates the signal.)
When finished, connect the left sides of the two breadboards to the right sides of the two multiplier circuit breadboards, and wire the output of each multiplier across to the input of each bandpass filter as shown. Note that there is one more bandpass filter circuit than multiplier circuit -- the last bandpass filter input is wired to the input music. We will hook up the input music in the next step.
Again, the last picture above of the complete layout includes potentiometers that aren't in your layout.
Step 9: Hooking Up the Input Music
We need to connect the headphone jack on a computer to each of the eight channels on the breadboards and also the switch block. In some empty space on the breadboard you used to build the oscillator circuits, or on a new breadboard underneath the breadboard with the oscillator circuits, lay out some wires as shown above. The wires labeled #1 to #7 connect to the seven multiplier circuits we built and the wire labeled #8 connects to the eighth bandpass filter input. The wire labeled "To Switch" will connect to the Switch block that we will build later.
The wires labeled "Audio In" connect to the headphone jack of a computer. Use a 3.5mm mono plug that fits into your computer, and solder two wires to the signal (+) and ground (-) connections on the plug (see last picture).
Step 10: Building the Signal Detection Circuits
The signal detection circuits consist of two stages: a peak detect stage and a comparator stage. In technical terms, the peak detect stage in each channel rectifies the incoming 520 Hz and outputs the peak voltage of that signal, while the comparator stage contains an op-amp with hysteresis that determines if the peak voltage is high enough to turn on the laser.
Let's build the peak detect stage. Above is the schematic and layout. Again, start at the top of a new breadboard to build the first circuit and work your way down to a second breadboard to build the other seven. Be careful when placing the diode A in each circuit -- it is directional. You can tell the direction by noting the black band on one end.
When finished, connect these two boards to the right sides of the bandpass filter boards and wire outputs to inputs. Again, the last picture above of the complete layout contains potentiometers that won't in your layout.
Step 11: Building the Signal Detection Circuits (cont.)
Now let's build the comparator stage. Important: the breadboards used for these circuits have different power rails than the other breadboards. The first picture above shows what these rails are.
The first thing to do is to generate the 5V supply from the 15V supply. Do this with the first set of schematic and layout above. Choose a place on a new breadboard and lay out the circuit. Note that you only need to do this once.
In the empty space on that breadboard, lay out the actual comparator circuits according to the second set of schematic and layout above. Work your way down to a second breadboard to lay out all eight circuits. When finished, the layout should be similar to the second-to-last picture above.
Again, connect the left sides of these two breadboards to the right sides of the peak detect breadboards, wiring outputs to inputs. Be careful when connecting power rails between the two pairs of breadboards, however. Remember that they are different! Also, wire all of the nodes labeled Output 6 among all the eight circuits to each other. The Play Detection block will use Output 6 as one of its inputs.
We're done with the note detection block! I promise this was the hardest part... See the last picture above for a complete layout of all the circuits in the Note Detection block.
Step 12: Building a Power Supply
Before we move on to the laser block, we will first build a power supply for all of our circuits. In all our circuits we will need +15VDC and -15VDC. The easiest and recommended way to get these voltages is to buy a DC power supply that outputs +-15VDC. They may be easily found online. But in the spirit of building everything, we will build a power supply that uses a transformer and a dual bridge rectifier to convert the wall outlet voltage to +-15VDC. Warning: do NOT attempt to create this circuit if you have not had training in electrical safety. This is a potentially dangerous circuit!
Above is the schematic and layout of the power supply. Lay out the circuit on a separate breadboard. The breadboard uses the same standard power rails as in Step 5. A, B, and C in the picture are the three wires from the wired-up transformer. I highly recommend you carefully follow the instructions that come with the transformer to wire it up correctly. In particular, this transformer only works if your wall outlet voltage is around 120VAC. That is, if your wall outlet voltage is around 240VAC, you will need to use a transformer with double the primary side windings. Also, be sure to wire both primary coils of this transformer in series. If you have any doubts as to how to wire up the transformer, please do not create your own power supply. Be extra careful when placing the 1000uF electrolytic capacitors -- they are directional (indicated by the white stripe on one side) and must be placed in the direction shown in the picture!
When finished, connect the power rails to the power rails of a breadboard in the Note Detection block (all the breadboards in the Note Detection block should have their power rails connected together) and to the power rails of a breadboard in the Play Detection block after you build it (all the breadboards in the Play Detection block, Switch block, and Power Amplifier block should have their power rails connected together).
Step 13: Building the Laser "Guitar"
Now we will build the laser "guitar." All this is is an open-top box with eight lasers mounted on one side and eight photodetectors mounted on the opposite side. When each laser is on, it shines into one photodetector. You play the music by putting your hands in the box to block the lit lasers.
The easiest thing to do is to use a cardboard box and poke holes in two opposite sides to mount the lasers and photodetectors. Space them out so there's about half a hand's width of space between each laser or photodetector. Hot glue the photodetectors and then the lasers into place in the holes. To make sure each laser is properly aligned, follow the instructions in item 7 of the paragraph below.
The fancy thing to do is to build a wood box. Above is a drawing of the dimensions of one possible design. Here's what to do.
1. Cut either 1"x10" stock or 1/2" plywood into the following dimensions shown (tan, red, and blue boards colored in the drawing). The design is optimized for 1"x10", but feel free to change the dimensions to fit different stock. You should cut two 3/4" x 9 1/4" x 2.5' (tan) boards, two 3/4" x 9 1/4" x 1' 6 1/2" (red) boards, and two 3/4" x 3 1/2 "x 10 1/2" (blue) boards.
2. Drill holes in the red pieces for lasers and photodetectors (see first picture). Space them out so there's about half a hand's width of space between each laser or photodetector. Drill the holes by placing one board on top of the other and drilling through both boards at once (that way, the holes line up).
3. Glue the two tan pieces together along their edge as shown in the drawing.
4. Biscuit join the red pieces to the tan pieces (see second and third pictures). Clamp the boards together while the wood glue is still wet.
5. Screw the blue pieces into place (see fourth picture). Make sure you pre-drill holes where the screws will go (as your boards may split if you do not pre-drill).
6. Place the breadboards for the Note Detection block on the larger section of the tan boards jutting out from the box. The two breadboards with lasers attached to them go closest to the box. The breadboards for the Play Detection, Switch, and Power Amplifier blocks go on the tan boards on the other side of the box.
7. Hot glue the photodetectors and then the lasers into place in the holes. To make sure each laser is properly aligned, turn it on (plug the positive lead into the 5V rail and the negative lead into the GND rail on the comparator circuit breadboard from Step 11) while gluing in the laser, and make sure that the laser beam shines on the photodetector. For better performance, place a piece of tape over each of the photodetectors to diffuse the laser light slightly as it comes into the photodetector.
One enhancement to the laser box is some way to make the laser beam trails visible. There are two easy ways to do this. First is to use chalk dust. Simply rub some chalk onto two chalkboard erasers and clap them together to release chalk dust into the box, which will illuminate the laser trails. The second way is to make a compartment at the bottom of the box for some dry ice. The vapor from the dry ice, when it fills the space in the box, will illuminate the laser trails. The compartment uses the tan boards as its base and the vertical boards as its sides. For the top, use cardboard with holes poked into it or perfboard. Cut the top to fit between the two red boards and on top of the two blue boards (see fifth picture). Put the dry ice in a shallow bowl of hot water in the compartment. Optionally, you can also attach some computer fans onto the top of the compartment that blow the dry ice vapor up.
Step 14: Building the Play Detection Circuits
The Play Detection block consists of two parts: the photodetectors for sensing that a laser has been blocked and some control circuitry for determining that you've played the notes correctly. For both of these circuits, we will use breadboards with power rails that are the same as those for the comparator circuit breadboards in the Note Detection block (Step 11). Note also that the breadboards we will use for each of the steps from now on are not attached to the breadboards we used for the Note Detection block.
We will first build the photodetector circuitry. Before starting, we need to generate a 5V power rail from the 15V power rail. At the top of a new breadboard, build a 7805 circuit similar to the one we built for the comparator circuits (Step 11).
Above is the schematic and layout for the photodetector circuitry. Output 7 in the schematic will be a high or low voltage depending on whether or not the photodetector sees the laser. The control circuitry will use this information to determine if a player has played notes correctly. Continuing on the same breadboard below the 7805 circuit, lay out all eight photodetector circuits. The final result should look like the last picture above. Note that all the nodes labeled "Output 7" are connected together. This will be one of the inputs into the control circuitry that we will build next.
Step 15: Building the Play Detection Circuits (cont.)
Now let's build the control circuitry. Above is the schematic and layout. The control circuitry looks at the current drawn by both the lasers and the photodetectors (more precisely, the voltage dropped across resistors in series with the lasers and the photodetectors). If the lasers are drawing current, that means at least one of them is on. If the photodetectors are drawing current, that means at least one of them is seeing a laser (and thus at least one laser is not blocked). The only way in which the player can be playing the notes correctly is if at least one laser is on (the lasers are drawing current) and all the lasers are blocked (the photodetectors are not drawing current). The control circuitry looks for this condition and outputs a high voltage if this condition is met; otherwise it outputs a low voltage. This voltage is fed into the Switch block and controls whether or not the input music is switched to be played by the speaker.
On the same breadboard that you used to lay out the photodetector circuitry or on a new breadboard underneath the other one, lay out the control circuitry. Note that you only have to lay out one copy. Output 6 is the output from the comparator circuitry in the Note Detection block (Step 11) and plugs into the row on the breadboard shown. Output 7 is the output from the photodetector circuitry and is the green wire shown.
Step 16: Building the Switch
Above is the schematic and layout for the Switch block. The Switch block takes the signal (Output 8) from the Play Detection block and switches a note into the speaker if you've played it correctly. If Output 8 is a high voltage at any given time, meaning that you are currently playing the music correctly, the music is sent to the speaker. If Output 8 is a low voltage at any given time, meaning that you are currently playing the music incorrectly, the music is blocked from the speaker. In technical terms, the Switch block adjusts the bias of diode D1 to switch in and out the input music. Essentially the circuit adds the voltage of Output 8 to the input music, passes the result through diode D1, and then subtracts out Output 8. If Output 8 is high, the diode is on and the input music passes through. If Output 8 is low, the diode is off and the input music is blocked.
At the top of a new breadboard, build the Switch block circuitry as shown. Note that you only have to build one copy. For this breadboard, we will use the standard power rails shown in Step 5. Be careful when placing the diodes -- they are directional.
Step 17: Building the Power Amplifier
Above is the schematic and layout for the last block -- the Power Amplifier. This block takes in the output from the Switch block, which contains the input music if the player has played the notes correctly, and amplifies the signal so it can be heard out of a speaker. In technical terms, the block consists of a complementary push-pull stage with an op-amp feedback imposing a gain of 10.
Below the Switch block circuit, build the power amplifier as shown. You only have to build one copy. Be careful while placing the directional diodes. Note that the first picture above does not show the transistors 2N2219 and 2N2905. They each have three legs as shown in the last picture above. The first picture shows where to place each of these legs in the breadboard. When finished, connect the left side of this breadboard to the right side of the breadboard you used to build the control circuitry for the Play Detection block. Connect power rails as well, but remember that they are different between the two breadboards!
The output of the power amplifier goes to any speaker you might have. Solder a wire between your circuit output labeled "To Speaker" and the signal input on the speaker, and another wire between your circuit ground and the speaker ground.
Step 18: Final System
Above are some pictures of the final system. The first picture is a top view of the system. On the top left is the power supply and below that are the breadboards for the Note Detection block. The box is in the middle. On the right are the breadboards for the Play Detection, Switch, and Power Amplifier blocks. The second picture is a side view of the Note Detection block circuits. The third picture is a side view of the Play Detection, Switch, and Power Amplifier blocks (there are a couple of other circuits in the picture that aren't in your layout).
Turn on the power and feed in the sample test file from Step 3 into your system. The most common problem is that music is playing even when the lasers aren't blocked. That's most likely due to misalignment of your lasers. Figure out which notes are playing incorrectly and tweak the corresponding lasers. Another potential problem is that lasers turn on even when the notes aren't in the music, or they don't turn on when the notes are in the music. This is likely due to the volume setting on your computer being either too high or too low. Trying playing with the volume to fix the problem. After some debugging, hopefully you've got a functional Guitar Hero game! Good work.
We have a be nice policy.
Please be positive and constructive.