Optical Theremin Design Review Document

advertisement
Optical Theremin- Design Review Document
Nick Battista, Fred Chache, Jayme Wilt
drEEm tEEm- team 7
Lab 2
Dr. Timothy Wheeler
EE 300W
Abstract
This report provides a description of the design of the optical theremin. The theremin has been
designed to utilize a photodiode and its leakage current to determine the hand position of the
operator. This leakage current is generally very small on the order of tens of microamperes
(μA) this current source is not suitable for an analog input to the MyDAQ, as a result further
signal processing is needed. An op-amp in a transimpedance configuration with a 1 MΩ resistor
converts the current source into a voltage source ranging from 0 to 5V which is sufficient for the
MyDAQ to read. LabVIEW was used to program the theremin. The analog signals from the
photodiodes are processed so that they fall into a range from 0 to 10 and are then converted
from analog to digital signals using the threshold block. At this point the tone and volume
commands are then sent to a lookup table to determine the proper amplitudes and frequencies
for the signals respectively. The theremin has customizable features as well such as an option
to change the octave, this is accomplished by means of a for loop which multiplies the original
lookup table by 2 n where n is the desired octave. The sensitivity of both photodiodes can be
adjusted as well by means of the coercion block.
Introduction
A theremin is a musical instrument famous for the fact that the operator of the device does not
physically contact it in order to play it. During its operation the tone and volume can be adjusted
by changing the position of the operators hand. There are several methods for detecting the
hand position of the musician, including altering the capacitance of an antenna in a magnetic
field or a laser positioning sensor. These methods however are very costly and difficult to
realize, as such a suitable alternative had to be explored. This design requires that a sensor
detect a user's hand position without any physical contact with the user and produce different
frequencies and volumes based on these different hand positions. The device must also be
cheap to construct and reliable as well as provide the end user options to adjust the sensitivity
of the sensors. Due to the above requirements, an optical theremin was deemed to be the best
choice.
Rationale
Bill of Materials
● Breadboard
● Photo Diodes (2)
● TL04 Op Amp
● 5 MΩ Resistor (2)
● National Instruments my DAQ
● National Instruments labVIEW 2012
● Wires
Figure 1. N=2 Block Diagram for the project
The requirements to complete lab 2 are satisfied fully with the n=2 block diagram created. The
concept of creating a Theremin that has a user-controllable audio tone that varies volume and
pitch based off light intensity, is satisfied with the concept of using two light intensity detectors.
These detectors can be created using resistors, photodiodes, and a multiple op-amp chip. The
photodiodes detect light intensity and output a current, so with two transimpedence amplifier
circuits the user creates two varying voltages that are detected by the myDAQ as analog input
signals. The DAQ Assistant feature inputs the analog signals into the labVIEW software where
the signals are converted to digital signals using a Analog to Digital converter VI. The digital
signals allow the code to create varying frequency waveforms, through a Sine Waveform
Generator VI, and based off the changing light intensities, the frequency range can be controlled
by the user with front panel controls. The varying sine waveform outputs through the myDAQ’s
audio output port to create the varying audio tunes required for the Theremin.
The original two light detector circuits created were made with a transimpedence amplifier circuit
with Rfb=1 MΩ
Figure 2. Transimpedance configuration of an Op-Amp
The hardware circuit for the pitch/frequency control and volume control is made with two
photodiode circuits that are capable of detecting a change in light intensity. The circuits must be
able to output a varying voltage from 0-5V to meet the myDAQ analog input port requirements.
The development began by realizing the need for a Transimpedance Amplifier setup, which was
done by knowing the photodiodes give off current and not voltage. Using the transimpendence
formula of Vout=-IinR rf and the idea that the input voltage would be 15V and the photodiode
current would be 16µA-35µA, it was believed that a 1 MΩ resistor would obtain a necessary
1.6V-3.5V output.
The design theory behind the light intensity detector was correct but, after several tests the
original thought of the resistor was adjusted due to very low diode current. A change to a 5 MΩ
resistor gave good output of 0-2.5 V. With the hardware needing no more modifications, the
rest of the problems encountered during testing could be fixed within the software. The original
software block diagram before final modification were performed can be seen in Figure 3.
The block diagram required modifications and adjustments throughout development. A major
modification occurred when realization came to use a “Convert to Dynamic Data VI” instead of
an “Analog to Digital” measurement I/O to save conversion time. The dynamic data could then
be used with arrays which were modified several times.The frequency array used to indicate
what frequencies could be output was altered from a large frequency range to a small range of
frequencies. The range was limited to one full range of notes A-G since the team realized the
array could be input into a for loop and the user could set their prefered octave by using a
control indicator on the count terminal.
The auto-tune feature was modified to use a threshold VI on the frequency array to
automatically point to an the proper indexed frequency as this added zero time delay between
each note heard.The team also altered the volume control to use a threshold VI and and array
from 0-1 with increments of 1/10 so a user controllable volume dial could be used to limit the
volume between 0%-100%.
Furthermore, the input and output DAQ Assistant values were modified to find the best sample
rate that would perform fast and smooth sound quality (see Table 1). The input values used
were continuous samples with 10 samples to read at 1000 Hz and a range of -10 to 10 Volts.
The output values used were continuous samples with 500 samples to read at 1000 Hz and a
range of -2 to 2 Volts.
Software Design Visuals
Figure 3. Block Diagram Before Final Modifications
Figure 4. Final Front Panel
Figure 5. Final Virtual Circuit
The block diagram code reads analog voltage values through an input DAQ Assistant where the
values get changed to dynamic data and input into two “index array function” VI’s. The top half
of the VI becomes the data used to control the frequency/pitch of the tone and the lower is for
the volume control.
The frequency control scales the voltage values of the photodiode into a range of down so the
values can threshold to a 1-D array of values 0-10. The values output from the threshold VI
indicate an index of 1-D frequency/note array. The index then outputs a value in that array,
which contains frequencies of octave 1 of the notes A-G. The frequency range is than chosen
by the user by telling a for loop how many times to run, multiplying the frequency up the chosen
number of octaves. The chosen frequency is than generated into a sine wave through the “sine
wave VI” and output through the DAQ Assistant 2.
The volume control takes the indexed array and scales the values so they can be thresholded
into a 1-D array between 0-1 with increments of .1 to represent 0% and 100% volume. This
volume can be controlled by the user, who sets the volume percentage with two front panel
dials. Last, the value is used to create the amplitude of the sine wave that is output through the
DAQ Assistant 2.
Table 1. Final DAQ Assistant Parameters
Parameter
DAQ Assistant 1
DAQ Assistant 2
Sample Type
Continuous Samples
Continuous Samples
Samples to Read
10
500
Rate
1000 Hz
1000 Hz
Voltage Range
-10V – 10V
-2V – 2V
Value Statement
The theremin is an excellent use of the materials available and is a cost effective means to
create a truly unique musical instrument. The use of photodiodes makes the project very cheap
to design as it requires very few parts and yields a sensor with a high resolution of 16 bits and
with low noise ambient noise. the simple design is very reliable and lacks any expensive
replacement parts unlike other theremin designs. The system is highly customizable and can
be used in a variety of levels of ambient light.
Conclusion
The Theremin created is capable of performing all the requirements set forth by Lab 2. A
hardware circuit using photodiodes is capable of detecting varying light intensities. The software
is than capable of converting the various intensities into an auto-tuned frequency output that can
be adjusted volume level as well. The Theremin works in a fast and effective musical
instrument.
Appendice
Table 2. Deadlines for the Theremin Project
Figure .6 Gantt Chart of the Theremin Project
Figure 7. Pinout of the TL074
Download