Critical Design Review

advertisement
Critical Design Review
ROSHAN PAUL
PRIYA MITTAL
JOSHUA NOBLE
EMILY NG
Abstract
To build a cost-effective theremin, an optical theremin prototype was designed built. This involved the
use of 2 photodiodes with operational amplifier and the MyDAQ to generate audio tones. The optical
theremin responds to the user changing light intensity over the photodiodes, resulting in the frequency
and amplitude of the audio tones to change. A MyDAQ was programmed in LabVIEW to receive signal
inputs of the amplified voltages across each of the diodes and use these values to generate
corresponding audio signals. The cost of making this optical theremin was less than $1000USD, thus
stayed within the cost-effective price range.
Introduction
The theremin is a musical instrument that generates audio signals by contactless movement by the user
over the instrument. A traditional theremin works by using 2 metal antennas that detect the position of
the user's hands as they move above them. One antenna is used to control the amplitude of the audio
signal and one antenna is used to control the frequency of the audio signal. Building a traditional
theremin requires complex hardware design and can have a high cost. There is a need for a simplified,
cost-effective theremin to perform the same functions as a traditional theremin.
Rationale
An alternative to antennas is to use light level changes to detect the positioning of the user's hands.
These changes can be monitored by the use of photodiodes to detect the light level changes as the user
moves their hands closer and further away from the photodiodes. It is necessary to change the intensity
of two signals (one for frequency and another for amplitude), achieved by the use of two photodiodes.
The photodiodes are critical to this project because they allow a current proportional to the amount of
light they receive. In this way, they are the opposite of an LED. Ohms law also states that V=IR. This
means a current can be directly mapped into a voltage by passing the current through a resistor. In the
design, a readable voltage is produced by passing a very small current through a 5MΩ resistor. Once a
measurable voltage is produced, it is then passed through a MyDAQ. The signal can then be easily
processed by LabVIEW.
One tradeoff in our design is the sampling capability of the MyDAQ. Our audio signal was sampled at a
rate of 100 kHz and the audio output was choppy. This could be due to the MyDAQ not being able to
sample the signal fast enough. Also, the design could be improved by using photodiodes that are more
sensitive to light, but this would increase the final cost.
Initial Block Diagram
Optical Controls
Signal Processing
Audio Signal
Circuit
MyDAQ
LabVIEW
MyDAQ
Implementation
To implement the optical Theremin, we used LabVIEW software to process a voltage signal from two
photodiodes. The final design consists of three primary components: an operational amplifier circuit
with two photodiodes, a LabVIEW VI to process the signal from the circuit, and a MyDAQ that connects
the circuit to the computer.
Our circuit uses one photodiode to control the amplitude and another photodiode to control the
frequency. The current that passes through a photodiode is proportional to the amount of incident
light. This current is converted to a voltage signal by using an operational amplifier and a 5MΩ resistor.
The two analog inputs on the MyDAQ connect the output voltages from the operational amplifier to a
computer where they are processed by LabVIEW.
Our LabVIEW VI processes the two voltage signals from the circuit into a single audio signal with variable
amplitude and frequency. When the signal is received from the MyDAQ, it must be averaged and
normalized. Two graphs on the front panel record the normalized values for the amplitude and
frequency and two numeric indicators display the intensity of the light that is incident on each
photodiode. The front panel also displays two knobs that the user can adjust independently to use the
circuit in a variety of lighting conditions. It also allows the user to set minimum and maximum values for
the frequency of the audio tone. The final amplitude and frequency of the signal is also plotted on the
front panel. The amplitude and frequency signals are then mixed together and sent out to the MyDAQ
as a continuous audio signal. Connecting an audio output device into the audio output of the MyDAQ
confirms that the theremin is working as intended.
In the second part of the lab, an auto tune feature was added to the LabVIEW VI. This auto tune
function was created as a Sub VI within a case structure which allows the user to turn the auto tune
feature off and on by clicking a button on the front panel. When the auto tune feature is enabled, the
frequency signal is passed into the Sub VI. The threshold function is combined with another set of case
structures to force the frequency to a predefined note. This is achieved by the threshold function being
processed to determine the index value, corresponding to which octave the frequency is in. This is
calculated by passing the frequency into a threshold function, with an array of the note C in 10 octaves.
This index value can be a decimal number, so this output is rounded to a whole number. The output
frequency is then “corrected” by passing the index value and the frequency into another threshold
function, containing an array of frequencies corresponding to the notes (C, C#, D, D#, E, F, F#, G, G#, A,
A#, B) in that octave using the scientific pitch notation in Figure 5. The amplitude and auto tuned
frequency are then merged and fed back into the MyDAQ. A set of headphones connected to the
MyDAQ confirms this result as the amplitude and frequency can be adjusted by changing the light
intensity on each of the photodiodes. The graphs produced on the front panel for the user also confirm
the results.
Design Modifications






Changed resistor values to suit operational amplifier gain
Switched operational amplifier as it was not giving correct gains
Changed voltage range to +15V and -15V to suit the operational amplifier and photodiodes
Changed from dynamic values in LabVIEW to an array of values
Changed the frequency and amplitude maximum, minimum and offset values
Switched MyDAQ as it was faulty, as random signals were being picked up
DAQ Assistant
The following are screenshots from LabVIEW showing the MyDAQ assist configuration:
Figure 1: DAQ 1
Figure 2: DAQ 2
LABView Virtual Circuit
Figure 3: Virtual Instrumentation
Figure 4: Auto tuning SubVI
Front Panel
Front panel for the user interface:
Figure 5: Front Panel
Block Diagram Analysis
Photodiode 1
Photodiode 2
Frequency Min
Amplitude Intensity
Frequency Intensity
Normalized Frequency
Frequency Max
Normalized Amplitude
Output Frequency
Autotuned Frequency
Audio Signal
After creating our initial block diagram, changes were made to the inputs and processes:




More inputs were added to allow further functionality and control by the user.
The input readings from the photodiodes were normalized to allow a frequency with amplitude
to be generated within the range specified by the user relative to the input light levels on the
diodes
The formula used to calculate the output frequency is:
𝑋𝑖 − 𝑋𝑚𝑖𝑛
𝑓0 = 𝑓𝑚𝑖𝑛 + (𝑓𝑚𝑎𝑥 − 𝑓𝑚𝑖𝑛 ) [𝑋𝑖,0−1 =
]
𝑋𝑚𝑎𝑥 − 𝑋𝑚𝑖𝑛
The output frequency was auto tuned using the scientific pitch notation:
Figure 6: Scientific Pitch Notation
Value Statement
The theremin can be played by users of a broad range of backgrounds. Users do not need to have
musical knowledge to be able to play it. This project helped EE 300W students to gain experience in
designing and developing circuitry and coding in LABVIEW. By including monetary constraints, it allowed
Group 5 to consider the how to divert resources in higher priority tasks and manage time effectively.
Conclusion
The optical theremin consists of two separate elements, a circuit using photodiodes and LabVIEW code
to process the signal from the circuit into an audio signal. By varying the intensity of the light on two
photodiodes, we can control the frequency and amplitude of an audio signal. This provides the same
functionality as a traditional theremin. The resources used to develop the optical theremin were limited
by the cost of materials. Group 5 stayed below the $1000 budget to produce a working optical theremin.
Appendices
Financial Statement
Cost of Parts (Quantity)
Operational Amplifier (OpAmp) (1) TL074CN
0.30
Photodiodes (2) OP906
1.10
Resistors 5MΩ (2)
0.60
Bread Board (1)
20.00
Power supply (1)
55.00
MyDaq and LABVIEW (1)
175.00
Misc. electronic Parts
66.95
Other parts (Headphones)
25.00
Total Parts Est. ($)
343.95
Cost of Labor
Est. Labor ($) Engineering rate: $25/hr (12 hours)
300.00
Fringe ($) 15% of Est. Labor
45.00
Overhead ($) 40% of (Labor + Fringe)
138.00
Total Labor Est. ($)
Contingency ($) 10% of (Adjusted Parts + Total Labor):
Grand Total ($)
483.00
82.69
909.64
Gantt Chart
Download