Sei sulla pagina 1di 11

EE 300W Laboratory #2: Optical Theremin Critical Design Review

Team Square Waves: Dylan Lowanse and Keith Newman


Section: 006

Instructor: Timothy Wheeler


Teaching Assistant: Joshua Noble
Date: 21 October, 2016

1) Abstract
Using two photodiodes, a TL074 Op Amp, a speaker/headphones, three LEDs, and an
NI myDAQ with LabVIEW programming our team constructed an Optical Theremin. The first
photodiode detected changes in light intensity and allowed the user to control the pitch of the
audio output. The second photodiode detected changes in light intensity and allowed the user to
control the volume of the audio output. The TL074 Op Amp converted leakage current into
voltages that were read by the NI myDAQ as an input signal. The LabVIEW code modified this
input signal and generated a sine wave audio output. The audio output (output through the
speaker/headphones) could be controlled via user interaction with the photodiodes, through the
front panel of the main VI in our LabVIEW code, or importing a .wav file. The three LEDs lit up
according to the pitch range the user sets: Bass (Low), Mid-Tone (Middle), and Treble (High).
2) Introduction
An Optical Theremin is a musical instrument that has the ability to be played without
physical contact. It harnesses the light intensities detected by two photodiodes that control pitch
and volume respectively. A brief overview of this entire lab entails that the Optical Theremins
photodiodes will detect light intensities and product a leakage current that the TL074 Op Amp
converts to a voltage to be read into the NI myDAQ to generate a sine wave audio output and
auto-tune that output per a user interface.
There are two aspects to the lab: a physical circuit design and a computer-generated
code design through the LabVIEW program (see Figure A.1 under Appendices). The physical
circuit design includes two photodiodes, a TL074 Op Amp, three LEDs, and a
speaker/headphones connected to the NI myDAQ. The computer-generated code design
includes LabVIEW code that acquires voltage signals, converts the signals into frequency and
amplitude, generates a signal to the speakers/headphones, and sends a boolean (T/F) signal to
the designated LED.
This configuration also allowed the importation of a .wav file to output audio and the
correlating LEDs.
3) Rationale
The optical theremin allows the user to create a unique sound without physically
touching anything. The simplest way to achieve this was with a transimpedance amplifier and
photodiodes that, dependent on the given light intensity, produced a current proportional to said
light intensity. The transimpedance amplifier converts the current through the photodiode into a
voltage. Depending on the light intensities, different values are sent to the code, one controlling
the frequency and the other controlling the amplitude. The frequency and amplitude controls set
the frequency and amplitude of the sinusoidal audio signal. The audio signal can be auto-tuned
by finding the nearest note via fractional indexing of an array and outputting that instead. The
audio signal can also be equalized through the use of filters: low-pass filter for bass, bandpass
filter for midtones, and high-pass filter for treble. If a frequency is within the range of the filters, it
will pass through and light up the appropriate LED. The audio signal equalization supports the
audio signal generated via optical theremin or a .wav sound file.

4) Implementation
The optical theremin is realized through LabVIEW code, a myDAQ, two OP906
photodiodes, two TL074 op amps, three LEDs, and resistors. The op amp connects to the
photodiode, along with a feedback resistor, to create a transimpedance amplifier. The
photodiode serves as a current source for the transimpedance amplifier. We used the Reverse
Light Current value found in the photodiode datasheet in Figure A.2 to chose a 2.2M feedback
resistor so that the voltage output was at an appropriate level to be measured by the myDAQ.
The light intensity observed by the photodiode controls the current through the diode and
through the transimpedance amplifier. The myDAQ measures the output voltages of the two op
amp transimpedance amplifiers. One of the output voltages is used by the LabVIEW code to
determine the frequency of the output audio signal, and the other is used to determine the
amplitude. The myDAQ has three digital outputs each connected to an LED and a 330 limiting
resistor. These LEDs are controlled by the EQ subVI in the LabVIEW code.
The Optical Theremin VI, seen in Figure A.5 and Figure A.6, is the main VI of the project.
The LabVIEW code receives the voltages as dynamic data type though the DAQ Assistant. This
data is split into two separate channels, converted to numeric, and normalized. The two
channels are sent through separate Max Min VIs (Figure A.7). The purpose of this VI is to find
the all time highest intensity, all time lowest intensity, and the present intensitys percentage
within that range. This is done through the use of feedback nodes and comparison nodes. For
example, when a value is input that is higher than the previous highest value it will update to
that value. The user is able to adjust the allowable frequency range through the front panel as
well as the maximum amplitude level. The Notes subVI (Figure A.8) creates an array of values
that represent the frequencies of the all the notes for 11 octaves. The Autotune subVI (Figure
A.9 & A.10) takes this array and compares it to the present frequency value. The subVI finds the
two array elements that the value is in between and returns the fractional index. This fractional
index is rounded to the nearest integer and then used to find the array value that belongs to that
index. This array value is sent to the Simulate Signal rather than the actual value only if the
Autotune button is pressed on the Front Panel. The frequency value and amplitude value are
input to the Simulate Signal to create a sinusoidal signal with the given characteristics. The
signal is sent to the EQ subVI (Figure A.11 & A.12). The EQ subVI allows the user the option to
input a .wav file or the Optical Theremin signal to be equalized with a bass control, mid-tone
control, and treble control. The equalizer uses three filters: a low-pass filter (bass), a bandpass
filter (midtone), and a high-pass filter (treble). These filters connect to boolean indicators to
indicate when a frequency within that range is present. When a boolean indicator is lit, the
corresponding LED will be lit through a DAQ Assistant. The EQ subVI outputs an audio signal
which is sent to the audio output on the myDAQ via DAQ Assistant, where it can be connected
to headphones or a speaker.

5) Value Statement
Bill of Materials:

Most (if not all) of these items are available in the EE stockroom for purchase or just to borrow.
This itself is a convenience of both time and money since the EE stockroom is right down the
hall from EE West 301 (the room our lab is held in) and, as previously stated, the fact that the
majority of these items are available to borrow from the EE stockroom.
6) Conclusion
Our team successfully built an Optical Theremin that allowed the user to control the
frequency and amplitude by controlling the light intensity each of the photodiodes was exposed
to. Our team successfully converted the current through the photodiodes into a voltage signal
(via the TL074 Op Amp) that was processed through our LabVIEW code (via the myDAQ) and
converted into an audio output capable of being heard through a speaker/headphones. This
LabVIEW code contained user interface options and controls that allowed them to activate an
auto-tune function, adjust Bass, Mid-Tone, Treble, and Volume controls, specify desired
minimum and maximum frequencies, and audibly hear an imported .wav file. In constructing this
Optical Theremin, all design requirements were met with the exception of the .wav file incapable
of being adjusted by the Volume control.

7) Appendices

Figure A.1 - Block Diagram of the Physical and Computer-Generated aspects of this lab

Figure A.2 - Electrical Specifications portion of the OP906 Photodiode datasheet


(*where we obtained the Reverse Light Current in order to solve for our resistor values*)

Figure A.3 - Pin Layout portion of the TL074 Op Amp datasheet

Figure A.4 - Maximum Ratings portion of the TL074 Op Amp datasheet


(*Reassurance that the 15 volt outputs on the NI myDAQ were within the limit [See NOTE 1]*)

Figure A.5 Optical Theremin Block Diagram

Figure A.6 Optical Theremin Front Panel

Figure A.7 Max Min subVI

Figure A.8 Notes subVI

Figure A.9 Autotune subVI - True case

Figure A.10 Autotune subVI - False case

Figure A.11 EQ subVI - True case

Figure A.12 EQ subVI - False case

References:
Bill of Material - https://www.amazon.com/
- http://www.digikey.com/
OP906 Photodiode datasheet - http://optekinc.com/datasheets/op905.pdf
TL074 Op Amp datasheet - http://www.datasheets360.com/

Potrebbero piacerti anche