Sunteți pe pagina 1din 10

EE 300W Optical Theremin With Auto-Tune,

Auxiliary Playback,
and Audio Equalizer Capability

Team 6
Section 6
Zachary Falk, Yi Song, Matthew Rennekamp
Abstract:
An optical theremin is a device which produces an audible output of varying pitch and gain via touch-free
user interaction. We have created this device using two photodiodes, resistors, an op-amp, and the NI
myDAQ interfaced with LabVIEW. We accomplished this project through the design and implementation
of multiple LabVIEW subVIs, each performing unique operations on the input signal. These include
modulating the input signal into a sine wave, followed by controlling its amplitude and frequency via
dataflow manipulation. Furthermore, the user has the ability to sweep through an auto-tuned array of
pitches, control the output level of the audio signal, or play an auxiliary file via LabVIEW.

Introduction:
We proposed an optical theremin that has a user friendly interface supported by robust programming.
We placed less stress on analog circuitry and shifted the focus towards digital programming in LabVIEW.
Our analog circuit was fairly basic, consisting only of photodiodes, resistors, op-amp chip, LED and wires
and our digital program did signal processing via real-time dataflow programming. A series of subVIs help
complete the tasks of user-variable gain, auto-tune and equalizing. The LabVIEW interface was designed
so the user can see what the program is doing in real-time via the front panel. A series of controls allow
user to manipulate the input signal.

Rationale:
The project had two parts: the photodiode circuit that generated voltage from light and LabVIEW code that
processed the voltage and a music file from the computer. The mechanism of the optical theremin was
that change in light intensity emitted on the circuit causes the amplitude and frequency of the output audio
signal to vary. The system input was light and the output was an audio signal. In the photodiode circuit,
when a photodiode is placed in reverse bias, a photon strikes the p-n junction and creates an electron
pair called a photoelectric effect. The effect produces a leakage current which is linearly proportional to
the light intensity. In the LabVIEW code, the challenge was to make the program run in real-time because
we run a music file from the computer, process the signal in real-time and show the parameters on the
front panel.

The process of the project was as follows: First, light shining on the circuit was transformed into voltage.
Then, the voltage was passed into the myDAQ and the three signal processing functions in LabVIEW.
Lastly, there was a music file from the computer played as the program ran. We needed to process the
volume, bass, midtone and treble parameters in real-time and display them on the front panel.

Implementation:
The conversion of light energy to voltage was achieved using two OP906 photodiodes, two 10M
resistors, and two TL074CN operational amplifier configured as a current-to-voltage converter. When light
is incident upon a photodiode, a small leakage current is generated and transformed by the operational
amplifier and the resulting output is a voltage. In our circuit shown in Fig.2, our leakage current was 0.7uA
and because the input voltage was kept within 3-5V range, using Ohm's Law, we got the resistor value to
be 10M.

The signal voltages going into the myDAQ analog read port became inputs to the LabVIEW program. We
split one signal into two and applied filters to them as shown in the left section of Fig.4. Two subVIs were
used to convert voltages to amplitude and frequency (See Fig.7 and 9 for more detailed algorithms). We
then passed the signal to our auto-tune VI to match the frequency of the input signal to a particular pitch
in eight octaves of music notes as shown in Fig.11 and 12. We found out that the relation between the
first notes in consecutive music octaves were 16 times 2 to the power of that octave. In the auto-tune VI,
the input frequency signal was matched to its corresponding musical note and the audio signal was output
to the user.

In the equalizer circuit, we designed a boolean switch that controlled the processing of the theremin music
or a music file from the computer. We used three filter VIs from LabVIEW to determine the frequency
ranges (bass, midtone, treble) of input signal. Four knob controls were created on the front panel to
control the master volume and magnitude of the signal in each frequency range. After we output the audio
signal, we used tone measurement VIs to light up digital LEDs on the front panel if the signal fell into one
of the three ranges that the LED corresponded to. Finally, we wired three physical LEDs on the
breadboard to three digital I/O ports on the myDAQ. As shown on the right section of Fig.4, when the LED
on the front panel lights up, the corresponding LED on the breadboard is lit.

However, our team ran into issues when reading the music file. Our program opened, read, and played
the correct music file but we were unable to utilize the equalizer. The equalizer would manipulate the
song if it was stopped and restarted but did not update the file in real-time. While troubleshooting this
issue we changed the file read sampling rate. This allowed us to use the equalizer but would play only a 2
second loop of the file. After many failed attempts during troubleshooting the issue we discussed it with
the TA. We came to the conclusion that the read file and equalizer should both be in the case structure to
resolve our issue.

Value Statement:
The creation of an optical theremin proves beneficial to learn the design process. Implementing this lab
into the 300W coursework helps students develop their engineering practice through designing,
programming and troubleshooting. Teams work to create a project that satisfies specific requirements on
a deadline. This helps them practice teaming and creative problem solving in order to create a desired
final project. The critical design review helps recap project accomplishments, discusses steps to improve
the final project, and describes the recreation process.

Conclusion:
Our team successfully designed and implemented an optical theremin. SubVIs controlling amplitude
scale, frequency scale, and an auto-tune array all worked together to play eight full octaves of notes while
an equalizer controlled their pitch and volume. Although the program failed to play the music in real-time
we felt successful in our design because each of the individual parts completed their required tasks. Our
struggles pushed us to learn more which better prepares us for further engineering tasks and projects.
Appendices:
A) N-Level Block Diagram

Figure 1: N-Level Block Diagram of Optical Theremin

B) Design Schematics

Figure 2: NI MultiSim Schematic of Analog Circuit


Figure 3: Optical Theremin Front Panel (Main)
Figure 4: Optical Theremin Block Diagram (Main)

Figure 5: Optical Theremin .wav File True Block Diagram (Main)


Figure 6: Amplitude Scale Sub-VI Front Panel

Figure 7: Amplitude Scale Sub-VI Block Diagram


Figure 8: Frequency Scale Sub-VI Front Panel

Figure 9: Frequency Scale Sub-VI Block Diagram


Figure 10: Auto-Tune Front Panel

Figure 11: Auto-Tune Block Diagram (Default)


Figure 12: Auto-Tune Block Diagram (Nth Octave)

C) Bill of Materials

Item Quantity Cost Vendor

myDAQ 1 $200 Stockroom

TL074CN 1 $0.59 Jameco

OP906 2 $0.57 Digi-Key

10M Resistor 2 $0.10 Jameco

330 Resistor 3 $0.10 Jameco

LED 3 $0.13 Jameco

Breadboard 1 $15 Jameco

Jumper Wire Kit 1 $11 Jameco

Speakers 1 $0 PSU

Computer 1 $0 PSU

Total $228.62

S-ar putea să vă placă și