6.101 Final Project Theremin: Pedro Brito David Gomez Patrick Mccabe May 12, 2016
6.101 Final Project Theremin: Pedro Brito David Gomez Patrick Mccabe May 12, 2016
6.101 Final Project Theremin: Pedro Brito David Gomez Patrick Mccabe May 12, 2016
1
Abstract
The goal of this project is to create a theremin. A theremin is a musical in-
strument that is played without physical contact. This is achieved by using
two antennas, one controls the pitch and the other the volume, which are
capacitively coupled to the player’s hands. By moving their hands around
these antennas, the player can change the capacitance of the coupling. This
change in capacitance is then detected allowing a tone that varies in pitch
and volume based on distance from the antennas to be produced.
Playing a theremin, specifically producing a desired pitch, is difficult
because there is no physical reference point to know where a hand should
be moved. To aid in this, a pitch visualizer has also been included in this
project. This visualizer has several LED indicators that illuminate when
the theremin plays certain musical notes to give an easy reference to the
player.
2
Contents
1 Motivation 5
2 System Architecture 5
2.1 High Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Pitch Oscillators (David) . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.2 Theory - Sine Wave Oscillator . . . . . . . . . . . . . . . . . 6
2.2.3 Theory - Detecting Capacitance Change . . . . . . . . . . . 7
2.2.4 Circuit - Variable Pitch Oscillator . . . . . . . . . . . . . . . 9
2.2.5 Theory - Fixed Frequency Oscillator . . . . . . . . . . . . . 10
2.2.6 Circuit - Fixed Pitch Oscillator . . . . . . . . . . . . . . . . 11
2.3 Volume Oscillator (David) . . . . . . . . . . . . . . . . . . . . . . . 13
2.3.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3.2 Design - Volume Oscillator . . . . . . . . . . . . . . . . . . . 13
2.3.3 Circuit - Volume Oscillator . . . . . . . . . . . . . . . . . . . 13
2.4 Audio Generation (Patrick) . . . . . . . . . . . . . . . . . . . . . . 14
2.4.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4.2 Theory - Signal Mixing . . . . . . . . . . . . . . . . . . . . . 14
2.4.3 Circuit - Signal Mixing . . . . . . . . . . . . . . . . . . . . . 15
2.4.4 Theory - Frequency to DC Voltage Conversion . . . . . . . . 16
2.4.5 Circuit - Frequency to DC Voltage Conversion . . . . . . . . 16
2.4.6 Theory - Voltage Controlled Attenuator . . . . . . . . . . . 18
2.4.7 Circuit - Voltage Controlled Attenuator . . . . . . . . . . . . 18
2.5 Frequency Visualization (Pedro) . . . . . . . . . . . . . . . . . . . . 19
2.5.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.5.2 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.5.3 Circuit - Gain Stage . . . . . . . . . . . . . . . . . . . . . . 20
2.5.4 Circuit - Band-Pass Filtering Stage . . . . . . . . . . . . . . 21
2.5.5 Circuit - Amplitude Detection Stage . . . . . . . . . . . . . 22
2.5.6 Circuit - LED Visualization Stage . . . . . . . . . . . . . . . 23
2.5.7 Visualizer Circuit Schematic and PCB . . . . . . . . . . . . 23
3 Integration 26
4 Conclusion 30
List of Figures
1 High level block diagram . . . . . . . . . . . . . . . . . . . . . . . . 5
2 LC Sine Wave Oscillators . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Variable Pitch Oscillator . . . . . . . . . . . . . . . . . . . . . . . . 9
4 A Relaxation Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . 10
5 Fixed Pitch Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . 11
6 Tuning Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7 Volume Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3
8 Mixer Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
9 Frequency To DC 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
10 Frequency To DC 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
11 Voltage Controlled Attenuator . . . . . . . . . . . . . . . . . . . . . 19
12 Frequency Visualizer with Tuning Column. . . . . . . . . . . . . . . 20
13 Frequency Visualizer Block Diagram . . . . . . . . . . . . . . . . . 20
14 Gain Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
15 Band-Pass Filter Stage . . . . . . . . . . . . . . . . . . . . . . . . . 21
16 Band-pass filter Bode Plot . . . . . . . . . . . . . . . . . . . . . . . 22
17 Amplitude Detection Stage . . . . . . . . . . . . . . . . . . . . . . . 22
18 LED Visualization Stage . . . . . . . . . . . . . . . . . . . . . . . . 24
19 Frequency Visualizer PCB . . . . . . . . . . . . . . . . . . . . . . . 25
20 Completed Theremin . . . . . . . . . . . . . . . . . . . . . . . . . . 26
21 Antennas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
22 Assembled Circuit Boards . . . . . . . . . . . . . . . . . . . . . . . 28
23 Assembled Visualizer PCB . . . . . . . . . . . . . . . . . . . . . . . 29
4
1 Motivation
The theremin is a great project because it is an uncommon instrument that is
fun to watch and play. The theremin is also a completely analog device and gave
our team some great experience with oscillators, amplifiers, and signal processing.
Along with this general knowledge some of the specific operating principals used
in the theremin have applications in many different products. For instance, the
capacitive sensing techniques used to control the theremin are seen in many devices
such as cell phone touch screens and the heterodyne process used to get the pitch
frequency is used in many different signal transmitting and receiving systems.
2 System Architecture
2.1 High Level
The theremin has three main parts which were each designed independently by
one member of our team. A block diagram of these parts can be see in figure 1.
5
• Frequency Visualization Lights up LEDs accorinding to the frequency of
the audio signal being produced
With these three parts our team was able to achieve the goal of producing an
audio signal at line level that could vary in pitch from ∼100Hz - 3kHz and vary in
volume from loud to silent. We are also able to visualize a large range of musical
notes throughout this pitch range.
LC tank resonant tanks do not oscillate on their own though. In order to get the
tank to oscillate feedback must be applied. In figure 2, two representations of an
LC sine wave oscillator circuit can be seen, a circuit and system view. The
6
system view shown in figure 2b is particularly useful because it ensures that the
circuit will oscillate by satisfying the Barkhausen Stability Criterion which states
that a system will oscillate under two conditions:
R2 Ljω R2
β(jω) = H(jω) − = 2
−
R1 + R2 LC(jω) R3 + Ljω + R3 R1 + R2
p
R22 R32 (LCω 2 − 1)2 + R12 L2 ω 2 )
|β(jω)| = p
(R1 + R2 )2 R32 (1 − 2LCω 2 + L2 C 2 ω 4 ) + (R1 + R2 )2 L2 ω 2
R3
6 β(jω) = tan−1
Lω − LCω 2
When the circuit is operating at its resonant frequency, the equations simplify
and make it clear which values could lead to Barkhausen being satisfied:
R1 Lω0 R1
|β(jω)| = =
(R1 + R2 )Lω0 R + R2
! 1
R3
6 β(jω) = tan−1 q
L
C
−1
To satisfy the gain criterion of Barkhausen, the ratio of R1 and R2 must simply
be set to satisfy equation 1. Since A is not known exactly, a potentiometer can
be used to adjust the ratio of R1 and R2 . To satisfy the phase criterion R3 must
theoretically be set to zero; however, this does not consider the non-ideal
components of the circuit and that the opamp may introduce some phase in its
gain A that is not shown in the math. Because of this complexity, the simplest
thing to do is to make R3 a variable resistor.
7
create a change in capacitance of around 3pF which must be turned into a
frequency change of 3kHz to meet the pitch change requirements in our goals. As
will be shown in this section, meeting these requirements requires a careful
choice of values.
To begin, the resonant frequency of the oscillator made in section 2.2.2 is
given by:
1
F0 = √ (2)
2π LC
Rearranging this and taking the partial derivative of frequency with respect to
capacitance:
r
∂F −1 L
= √ =− F0 (3)
∂C 4π LC 3 2C
These equations make some important design decisions apparent. The derivative
shown in figure 3 is negative so frequency decreases as capacitance increases.
Since capacitance increases as the hand moves closer to the antenna, one might
think the resonant frequency of the LC tank could be set such that it is 3kHz
when no hands are near and then the additional 3pF from a hand would be
enough to get the necessary frequency drop. This is unfortunately not feasible.
The antenna’s normal capacitance is around 12pF, to get a resonant frequency of
3kHz an impractically huge inductor of a few hundred henry would be needed.
∂F
These values would also result in a ∂C of only tens of hertz per picofarad, not
nearly enough to met the goals set.
From equation 3, it can be can see that our sensitivity to capacitance
changes can be increased by increasing our resonant frequency or maximizing
inductance for a given resonant frequency. A resonant frequency of 264kHz with
∂F
a 3.3mH inductor and 110pF capacitor was chosen to give a theoretical ∂C of
kHz
1.2 pF and a range of 3.6kHz.
Of course, this strategy creates a new problem which is that the resonant
frequency is now out of the range of human hearing so it cannot be used directly
as the audio signal. This problem is solved by adding a second oscillator and
heterodyning them. This is discussed further in section 2.4.2; however, at a high
level, by adding a second oscillator at a fixed frequency the signals can be mixed
to create a new signal containing the difference between their frequencies. This is
very useful since another fixed oscillator that runs at the resonant frequency of
the variable oscillator connected to the antenna when no hands are near it can
be added. When a hand moves closer to the antenna, the variable oscillator’s
frequency decreases but the fixed oscillator holds its frequency resulting in an
increasing frequency difference between them. The frequency difference
theoretically will vary from 0Hz to the maximum the variable oscillator’s
frequency can decrease, in this case 3.6kHz, making it perfect to be directly used
as an audio signal.
8
2.2.4 Circuit - Variable Pitch Oscillator
Figure 3 shows the final schematic of the Variable Pitch Oscillator (VPO). This
oscillator uses the topology discussed in section 2.2.2. As stated in section 2.2.3,
the the values used in the resonant tank (L2 and C5 ) are 3.3mH and 110pF for a
theoretical resonant frequency of 264kHz. The antenna is also shown connected
through L1 . Since the antenna acts as a capacitor this gives us a series LC tank
connected to our parallel tank which is a commonly used technique in theremin
design to couple the antenna capacitance to the resonant tank. Unfortunately, it
was not simple to calculate the resonant frequency of the total system and L1
had to be determined experimentally but was initially sized to give a 264kHz
resonant frequency with the 12pF antenna capacitance to match the LC tank.
Upon connecting the tank LC to the antenna LC and soldering the circuit onto a
proto-board, a resonant frequency of about 225kHz was found. This was likely
caused by an inability to properly model the antenna LC and also parasitic
capacitance from connecting wires, which are likely on the order of pico farads
which is a problem when the tank capacitance and antenna capacitance are
110pF and 12pF respectively. While the resonant frequency fell short of what
what predicted, the range was within our expectations. In the playing area, a
3kHz frequency change was easily produced. The total frequency change was
even more, but involved placing a hand very close to the antenna. The area
directly near the antenna is unusable for playing since the capacitance change is
not nearly as linear as it is farther from the antenna.
The sine wave output is taken directly from the LC tank and buffered through
U2A before going through a voltage divider and buffer that drops the 24Vp−p
signal down to a 2.6Vp−p signal needed for the mixer input. LF356 opamps are
used exclusively because of their high speed and availability in the 6.101 lab.
9
There are also 0.1µF capacitors placed closely to the power pins of all the op
amps to help provide a clean power supply.
1. Must be highly stable - Since the audio frequency is the between the fixed
and variable oscillators, frequency drifts of even a few hundred hertz could
be noticeable. Since this oscillator operates in the 200kHz range this
necessitates high stability
3. Sine or Square wave output - The mixer accepts both of these waveforms
as shown in section 2.4.2
10
1
f= (4)
2ln(3)R3 C1
From equation 4 it is also evident that the frequency is only dependent on the
R3 C1 time constant which is highly convenient because frequency tunability can
be added be simply replacing R3 with a potentiometer. Since it does not affect
the frequency, we can also simply set R1 equal to R2 .
The LT1011A has an open collector output so connecting pin 1 to -12V and
adding a pullup resistor to +12V allows us to get rail to rail output. The pullup
11
resistor is actually three pullup resistors, R8 , R9 , and R10 , in parallel for a
combined 500Ω. All three of these resistors were 21 Watt and placing them in
parallel reduced the current seen by each one. This was done after finding that a
single 510Ω 18 Watt resistor got very hot and since heat could be a cause of
frequency instability we wanted to avoid this.
C10 was recommended to be placed between the balance pins by the data
sheet. Other capacitors by the power rails are for supply filtering.
The frequency of this oscillator was set to be around 225kHz which as seen
in section 2.2.4 is the frequency that could be realized for the VPO. In figure 5,
C8 and the resistor combination made by R5 , R6 , and R7 replace C1 and R3 from
equation 4 to determine the frequency of oscillation. C8 is set to be the low value
of 1.5nF as a low capacitance was found to help improve the quality of the
square wave. The purpose of the resistor combination is to maximize the tuning
sensitivity of the oscillator. It was shown in 2.2.5 that R3 from equation 4 could
be replaced with a potentiometer to provide tunability. The challenge with
tuning is that it must be highly sensitive because even slight variations of a few
hundred hertz create large change in the pitch. Early testing with a half turn
potentiometer was unsuccessful because it was difficult to turn the potentiometer
a small enough amount to get the desired frequency change. To get better
resolution, a 25 turn potentiometer was used instead so that the same amount of
turn produced less of a change in resistance and therefore less of a change in
frequency. This resolution can be improved even further by placing a resistor in
parallel with the potentiometer and taking advantage of the non-linearity of the
total resistance of resistors in parallel.
(a) Change in total resistance through po- (b) Change in frequency per turn of poten-
tentiometers full range tiometer
Figure 6a shows the change in the total resistance of the resistor combination as
given by the following equation:
R6 R7
Rtotal = R5 +
R6 + R7
When the potentiometer R6 is near its upper limit the change in total resistance
is small compared to the change in potentiometer resistance. By properly sizing
12
R5 and R7 , the frequency of 225kHz can be centered in this low slope area to
provide maximum tuning resolution. As shown in figure 6b, near 225kHz a
tuning resolution of around 1kHz per turn is achieved.
The only remaining components are R12 and R13 which were made identical
because as discussed in section 2.2.5 their value does not affect the frequency.
13
Figure 7: Volume Oscillator
14
a sinusoid of frequency fV P O − fF P O , which ranges from 0Hz-3KHz, the
multiplication also generates a signal with a frequency of fV P O + fF P O , which is
not the frequency we are interested in. However, this sum frequency is
approximately 500KHz, which means it can be easily filtered out since it is
significantly higher than the audible range.
It is worth noting that it is not necessary for both of the input signals of
the mixer to be sinusoids. In fact, our design uses a sinusoid for the variable
pitch oscillator and a square wave for the fixed pitch oscillator. The generated
output of the mixer is still a sinusoid with a frequency equal to the difference of
the two inputs. The reason this works can be seen in the fourier transform of a
square wave:
4 1 1
square(t) = sin(wo t) + sin(3wo t) + sin(5wo t) + . . . (5)
π 3 5
Due to the low-pass filtering on the mixer’s output only the sinusoid at the
square wave’s fundamental frequency is of importance.
This is a single transistor mixer topology. The mixer circuit gates the output of
the variable pitch oscillator by using a 2N3904 transistor and the output of the
fixed pitch oscillator as the control signal. When the fixed pitch oscillator’s
output is a square wave, as it is in our case, this has the effect of producing an
output that is the multiplication of the VPO’s output by the FPO’s output.
The output of this multiplication is fed into a first order low-pass RC filter.
This filter is used to remove any DC bias from the multiplication output. The
-3dB point of this filter is ∼ 2Hz. This was a selected to be a decade below the
lowest audible frequency, which is 20Hz. The output of this filter is buffered
before going into the next stage of the mixer.
The next stage of the mixer removes the high frequency sinusoids that are
produced in the multiplication operation. This is done using a Sallen-Key second
order low-pass filter. The cut-off frequency of this filter is 12,242Hz. This cut-off
15
frequency is not quite a decade above our highest producable frequency (3KHz).
This means the design sacrifices some attenuation of the higher frequencies for a
reduction in unwanted signals.
Lastly, there is a variable, non-inverting voltage amplifier stage on the
output of the mixer. The gain of this stage can be adjusted using a 10K
potentiometer. The voltage gain can range from 1 to 2. This stage sets the
maximum amplitude of the final line-level audio signal - thereby also setting the
maximum volume that can be generated. The magnitude of the resulting mixer
output signal can be adjusted from 680mVP P to 1.3VP P . The consumer grade
line-level standard for audio uses a maximum voltage of 890mVPP. So this
adjustable gain stage allows the instrument to be tuned to output a line-level
standard voltage. While this stage outputs a maximum volume signal, the
voltage controlled attenuator (the details of which are covered in a later section)
allows the musician to decrease the volume when playing the instrument.
16
Figure 9: Frequency To DC 1
17
by the volume oscillator.
The second block in figure 9 is a peak detector circuit. This circuit
converts the changing frequency/amplitude signal from the output of the
low-pass filter into a DC voltage. It does this by first rectifying the signal using a
1N914 diode and then low-passing that rectified signal. The output of this
detector circuit is buffered before being passed to the next block in the circuit.
The next block in the circuit can be seen in figure 10. This block, at the top left
of the figure, is an adder circuit. The transfer function for this block is:
R9
vout = − (v1 + v2 ) (6)
1000
R9 is a 1Meg potentiometer. So this stage has a voltage gain that ranges from 0
to 1000. This adder allows the instrument to be tuned such that the output
volume is silenced when there is no hand near the volume antenna. When there
is no hand near the volume antenna there is a non-zero DC voltage produced at
the output of the peak detector. This signal needs to be shifted down to 0V so
that it will produce silent audio when used to control the voltage controlled
attenuator.
So the output of the peak detector, v1 , is shifted down by the negative
voltage v2 . The voltage v2 is generated by the circuit block at the bottom of
figure 10. This block is a voltage follower that is following the output voltage of
an adjustable voltage divider. This adjustable voltage divider uses a 100K
potentiometer to adjust its output between -0.11V and -1.97V. This range was
experimentally selected.
As a part of the theremin’s tuning process, the gain of the adder is tuned
such that it outputs a voltage of -10V when the player’s hand is very close to the
volume antenna. This control voltage corresponds to no attenuation at the
voltage controlled attenuator and full volume at the audio output.
The last block of this stage is the circuit block on the right of figure 10.
This is a second order low-pass Sallen-Key filter meant to filter out 60Hz noise.
The cut-off frequency of this filter is set at 6Hz, or a decade below 60Hz. This
was added after it was clear that the high gain of the adder stage was also
amplifying 60Hz noise. The output of this stage is the DC voltage that is used to
control the voltage controlled attenuator.
18
Figure 11: Voltage Controlled Attenuator
19
Figure 12: Frequency Visualizer with Tuning Column.
2.5.2 Design
The visualizer has four main stages: a gain stage, a band-pass filter stage, an
amplitude detection stage, and a visualization stage. Figure 13 shows the
aforementioned stages in a block diagram.
20
Figure 14: Gain Stage
Figure 15: Band-pass filter with feedback and potentiometer for center frequency
adjustment.
Figure 16 shows a bode plot of the nine band-pass filters used for the project.
Each band-pass filter is centered at the frequency shown in the legend of figure
16. For each band-pass, the output voltage decays as the input deviates from the
center frequency.
21
Figure 16: Band-pass filter Bode Plot
22
2.5.6 Circuit - LED Visualization Stage
The LED visualization stage takes the voltage output of the rectifier (which can
range approximately from 0 to 10V) and turns on an array of LEDs
incrementally as the voltage goes up. There are two ways of doing this:
• Using a current controlled LED and diode ladder which turns LEDs on
incrementally as the current is increased.
The op-amp circuit has the advantage of turning respective LEDs on at precise
voltages; however, the need of one op-amp per LED increases cost and valuable
space in a PCB. On the other hand, the current controlled ladder shown in figure
18 is extremely compact and simple, with the added drawback of heat
dissipation in the current control circuitry and less control of the LED array.
In order to save space in the PCB and simplify the circuit, the current
controlled LEDs were deemed to be the best option. It consists of an N-FET
driven by the rectifier output. Its source is connected to a variable voltage
divider and its drain drives the current controlling PNP transistor. By adjusting
Pot3 the amount of current that goes through R4 at a specific rectifier voltage
can also be adjusted. This in turn changes the voltage of the PNP gate and how
much current goes through it. Pot3 is used when the rectifier (and band-pass
filter) output is at its maximum, setting how many LEDs turn on at the rectifiers
peak voltage and how sensitive the LEDs are to a rectifier voltage change.
23
Figure 18: Voltage controlled visualizer circuit with current control driven LED
array
24
Figure 19: Frequency Visualizer PCB
25
3 Integration
Once designed and built, the completed subsections of the theremin were all
placed together onto one wooden board as shown in figure 20. The frequency
visualizer boards were not attached the wooden board and were placed off to the
the side.
The oscillators and audio generation circuitry were powered off of the labkit
power supply. The frequency visualizer boards drew more power than the labkit
was able to supply so they had to be powered with separate bench supplies.
The antennas shown in figure 21 were also connected to the wood board.
The antennas were made out of 38 ” aluminum tube. The volume antenna was
bent into a U like shape which from research into theremin design is said to
increase sensitivity when the hand close. The antennas are perpendicular to each
other and spaced widely apart to minimize the interaction the pitch controlling
hand might have on the volume and vice versa.
26
(b) volume
(a) pitch
27
Figure 22: Assembled Circuit Boards - starting at the top going clockwise: FPO,
Audio Generation, VO, VPO
28
Figure 23: Assembled Visualizer PCB with a column of LEDs illuminated
29
4 Conclusion
Many theremin schematics are available online; however, since it is such an old
instrument, most detailed schematics are greatly outdated. With this project we
were able to achieve a modernized version of the theremin which utilizes higher
precision components and techniques, such as op-amp based oscillators. Another
distinction of our theremin is the addition of visualization. This allows the user
to easily tune the theremin and have a clear visualization of what frequency
range they are playing in. One of the greatest challenges of this project was
adapting to the properties of the constructed antennas. By having accessibility
to the antennas from an early phase we were able to design around these
properties and achieve our goal. The broad knowledge that was gained
throughout the course allowed us to successfully design, analyze, and build the
many circuits involved in the theremin’s operation.
30