Professional Documents
Culture Documents
Optical Theramin
Optical Theramin
2: Optical Theremin
EE300W Section 3
Team Globo Gym
Pawan Murthy, Kevin Minton, Jake Deffibaugh
Abstract
Lab 2 focused on developing an Optical Theremin using photodiodes and LabVIEW code. The
theremin had to be controllable by the user. The circuit design was the easy part; however, the
coding for LabVIEW proved to be a challenging obstacle. The circuit consisted of two
photodiodes connected to an op-amp functioning as a current-voltage converter. The circuit
outputted two signals that are read by the MyDAQ. Once the signals are read, the LabVIEW
code would modify the signal. In order for it to work correctly, the input signals had to be broken
down into frequency and amplitude controls to create a sine wave. Overall, the user will be able
to control the frequency range, the volume and the gain of the diodes. However, the more
features we add, the more complicated the code, so it was wise to be kept as simple as possible.
Introduction
In this project, the main goal is to create an Optical Theremin through LabVIEW and
photodiodes. A normal theremin is a musical instrument whose volume and pitch can be
controlled by moving an object closer to/further away from the photodiodes. It requires no
physical contact. The Theremin this lab asks to create will measure the current produced by the
photodiodes and use this with LabVIEW to process the signals to create a sinusoidal audio wave,
which is outputted by the MyDAQ. By controlling the amount of light entering the photodiodes,
the pitch and volume and can be controlled. One of the other requirements is to allow the user to
see the amplitude and frequency ranges seen by each diode. Also visible to the user is the range
of audio tunes generated.
The design requirements for this project are to generate a sinusoidal audio signal from the
MyDAQ and design the ability to adjust the amplitude and frequency ranges of the audio signal
using LabVIEWs front panel. Since sub VIs are being used, there will be additional front panels
for auto tune, amplitude, and frequency; however, all these will be incorporated in the main VI,
and thus appear on the front panel of the main VI. Some of the defined requirements include
having an adjustable maximum and minimum light intensity for each diode, a front panel wave
graph that displays the normalized pitch as a function of time, and a normalized amplitude
(volume) wave graph that also displays as a function of time. Another graph to display the light
intensity should also be included on the front panel.
For the next part of the lab, an auto tune feature is to be created for the Optical Theremin. The
point of this feature is that it will tune a specific pitch to a tone in the same tempered scale. This
feature can be toggled on or off by the user on the LabVIEW front panel.
Implementation
Bill of Materials
Based on the prices from the Penn State University Bookstore website and newark.com, the cost
of the materials is $272.58. For more information on the cost of materials, labor, fringe, and
overhead, refer to the financial page in Appendix B.
The total price is expected price for one unit of the Optical Theremin. The bill of materials does
not include any audio devices (speakers, head phones, audio cable, etc.), as we expect the user to
have such materials. The average starting salaries per hour for a Penn State Electrical
Engineering graduate determined the manual labor costs.
A way to decrease the total cost would be to buy parts in bulk and reuse the Optical Theremin
design. When buying in bulk, the price per part decreases. If you are working on projects that
require these parts, it would be wise to buy in bulk to decrease the cost of parts. By duplicating
the design, no design phase is necessary, cutting down on the cost of labor.
The solution to building the Optical Theremin started simple: what should be input and what
should to be output. As time progressed, we continued to discover how to design the system,
what ideas needed to be kept simple, and what ideas needed to be expanded.
Hardware/Realization
The op-amp controlling frequency outputs to AI1+ on the MyDAQ. The op-amp controlling
amplitude outputs to AI0+. Both op-amps are configured as a current-voltage converter with a 1M resistance in the feedback loop. The photodiode outputs a current, which the op-amp
converts to a voltage so the MyDAQ can read the input. A basic circuit diagram built in Multisim
can be seen in Figure 2.
The user controls the input by limiting the amount of light into the photodiodes. The system
reads the current from the light source, turns it into a voltage, and outputs the signals into the
MyDAQ. This is then used as the input signal in the LabVIEW code. The completed circuit can
be seen in Figure 3.
LabVIEW VI Analysis
The user can use a few functions on the Main VI front panel. They can change the minimum and
maximum frequency presets to whatever they want, they can view the inputs and outputs, they
can turn the auto tune feature on and off, and they can choose what key the auto tune is in.
Figure 4: LabVIEW Main VI Front Panel
The LabVIEW code consists of a Main VI and four sub VIs. The Main VI block diagram
represents the data translation from the N=2 level of the high-level block diagram. The DAQ
assistant reads the voltage signal being inputted. We learned that if the DAQ parameters are not
set correctly, the interface will not work. For example, the frequency must be at least twice as
much as the bandwidth due to Nyquist Sampling. We realized that if the user changes the
MyDAQ used, the parameters must be reset.
Figure 5: Main VI Block Diagram
After the signals are read from the MyDAQ, the signals are split into amplitude and frequency.
Both of those signals then move into frequency VI and amplitude VIs.
Figure 6: Frequency VI Block Diagram
Figure 7: Amplitude VI Block Diagram
The pitch maker creates an array of frequency values that will be used for the auto tune. In the
pitch maker, the user can also control the number of octaves (starting from the lowest) that the
auto-tuner will use. We chose to do this outside of the while loop in the Main VI so that we do
not generate new pitches in the loop for each iteration.
Figure 8: Pitch Maker VI Block Diagram
The auto tune takes the frequency signal and measures what octave it is in. It then thresholds the
incoming frequency and rounds it to the nearest note within a major scale. This gives users the
opportunity to personalize their auto-tuning to whatever key signature they want. The auto tune
is set to recognize tonal qualities within frequency. The changed frequency then gets sent back to
the main VI, where the new signals are output into a speaker.
Value Statement
The objective of this lab is to attempt to construct a Theremin using Labview working together
as a team. This lab also tested how well we could work together as a team and how each of us
contributed something to make the team function. This project really showed how teams function
and how each of us can use our full potential to accomplish a common goal.
Conclusion
We successfully constructed an Optical Theremin using LabVIEW code and a circuit design.
This was a team effort, with all group members contributing to different parts of the project. We
created the Optical Theremin by using photodiodes that depended on the amount of light they
received. The current from the light was converted to a voltage, which was then input to the
LabVIEW code through the MyDAQ to process the amplitude and frequency of the wave. This
wave was finally converted to an audio signal, which was outputted by our speakers.
Cost of Materials
MyDAQ
$233.35
Breadboard
$36.80
Photodiodes
$1.14
1 M Resistors
$0.80
TL074CN Op Amp
$0.49
TOTAL
COST OF LABOR
Est. Labor: Engineering rate: $35/hr.
(3 Engineers, 13 hours each)
Fringe
15% of Est. Labor
Overhead
40% of (Labor + Fringe)
Total Labor Estimation
OTHER COSTS
Contingency
10% of (Total Cost + Total Labor)
Grand Total
$272.58
$ 1365.00
$ 204.75
$ 627.90
$ 2187.65
$ 246.02
$2706.25