6.101 Final Project Theremin: Pedro Brito David Gomez Patrick Mccabe May 12, 2016

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

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.

Figure 1: High level block diagram

• Pitch and Volume Oscillators A set of oscillators that vary in frequency


when the capacitance of the antennas change

• Audio Generation Transforms the changing frequency of the oscillators


into changes in the pitch and volume of the audio signal

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.

2.2 Pitch Oscillators (David)


2.2.1 Purpose
The pitch oscillator circuits are responsible for detecting the change in
capacitance from the pitch antenna (and therefore the change in hand position)
and translating it into a changing frequency to be fed into the audio generation
circuits to produce a tone.

2.2.2 Theory - Sine Wave Oscillator


A simple way which most theremins use to detect changing capacitance is
connecting the antenna to an LC resonant tank oscillator. When the capacitance
of the LC tank changes, the resonant frequency of the tank also changes
producing the capacitance dependent frequency needed. The sine wave produced
by such oscillators is also part of what gives theremins their distinctive sound.

(b) System Representation

(a) Circuit Representation

Figure 2: LC Sine Wave Oscillators

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:

• The open loop gain is unity in magnitude, |βA| = 1

• The phase shift shift is zero or a multiple of 2π, 6 βA = 2πn, n ∈ 0, 1, 2...

The open loop gain of this system is:


V0 V f V0
= = β(jω)A
Vi V i Vf
So to satisfy the gain criterion of Barkhausen:
1
|β(jω)| = (1)
A
Where A is the open loop gain of the Opamp and β(jω) is defined as the
combined transfer function of the rest of the circuit:

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.

2.2.3 Theory - Detecting Capacitance Change


Section 2.2.2, has shown how make an LC resonant tank oscillate; however, LC
values and through that, the resonant frequency must still be selected. This is a
challenging problem because a hand moving around the antenna was only able to

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.

Figure 3: Variable Pitch Oscillator

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.

2.2.5 Theory - Fixed Frequency Oscillator


As discussed in section 2.2.3, heterodyning a high frequency fixed and variable
oscillator allows us to sense the very small antenna capacitance change and
transform it into an audio signal. The design of this oscillator has three
important considerations.

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

2. Frequency Tunability - The fixed oscillator should be set to the resonant


frequency of the variable oscillator; however, because the ambient
capacitance and frequency drift of the oscillators can change that resonant
frequency, the fixed pitch oscillator must be tunable

3. Sine or Square wave output - The mixer accepts both of these waveforms
as shown in section 2.4.2

An oscillator topology that satisfies


all three of these constraints is the
relaxation oscillator, shown in figure
4. This oscillator uses a comparator
and a RC circuit to generate
a fixed frequency square wave
that switches between the positive
and negative voltage rails. When the
output voltage of the comparator is at
the positive supply rail, C1 is charged
through R3 producing an increasing
voltage on the inverting input of the
comparator while the non-inverting
input is held at a constant voltage
set by the R1 and R2 voltage divider.
After enough time, C1 will have Figure 4: A Relaxation Oscillator
charged to a greater voltage than the
constant voltage on the non-inverting
input at which point the comparator’s output will go to the negative supply rail.
After this, C1 will begin to discharge through R3 until it’s voltage reaches the
voltage at the non-inverting input of the comparator causing the output to go
high again at which point the whole cycle will repeat forever.
Since the comparator flips between high and low, a square wave output
with a frequency given by equation 4 is produced.

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 .

2.2.6 Circuit - Fixed Pitch Oscillator


Figure 5 shows the complete schematic of the Fixed Pitch Oscillator (FPO). The
first thing to note is the choice of the U1A as an LT1011A comparator for use in
the relaxation oscillator designed as in section 2.2.5. This was the fastest
comparator available in lab. The speed of the comparator actually ended up
being an issue since at ∼225kHz (the frequency required to match the VPO) the
sharp transition between the ±12V power rails was very difficult to generate
without seeing rounded edges on the square wave. Even the LT1011A was not
fast enough to generate good square waves at 225kHz but fortunately since the
mixer only required a 2Vp−p square wave the rounded square wave was able to be
clipped which left a very nice square waveform. The clipping circuitry was
composed of first a voltage divider with R11 and R14 which was needed because
LF356 U2A had issues accepting the full signal. After this divider, there is a
buffer and then a set of diodes. These diodes clip the output signal at 2V and
-2V because the Vf of the 1N914 is 1V and there are two in series in opposite
polarities relative to ground.

Figure 5: Fixed Pitch Oscillator

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 6: Tuning Sensitivity

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.

2.3 Volume Oscillator (David)


2.3.1 Purpose
Similar to the pitch oscillators, the volume oscillator (VO) is responsible for
detecting a capacitance change to produce a change in the audio output, in this
case the volume. However, instead of producing a variable frequency audio
signal, the VO only needs to produce a frequency changing sine wave which as
later seen in section 2.4.4 will be transformed into a changing DC value to
attenuate the volume of the audio signal.

2.3.2 Design - Volume Oscillator


Since the VO only needs to produce a sine wave that changes frequency
depending on the capacitance of the antenna and hand, the oscillator topology
created in 2.2.2 can be used with only some minor modifications. No
heterodyning is required because the voltage attenuation circuitry is capable of
dealing with the signals on the order of 100kHz range necessary to give good
sensitivity to changing capacitance. A resonant frequency of 455kHz with a 1mH
inductor and 120pF capacitor in parallel with a 2-100pF variable capacitor was
∂F
selected. The higher frequency was chosen to give a higher theoretical ∂C of
kHz
1.87 pF . The variable capacitor was used because unlike in the pitch oscillators,
where tuning to the ambient capacitance could be done through the FPO, the
tuning for the VO must be done with the oscillator itself.

2.3.3 Circuit - Volume Oscillator


Figure 7 shows the complete schematic of the VO. The design is almost identical
to the VPO from section 2.2.4. L1 and L2 were also chosen experimentally as
they were with the VPO. The VO was able to achieve a resonant frequency of
450kHz and had a range of almost 12kHz.
The output of the LC tank is buffered and then scaled down just as with the
VPO; however, instead of a fixed voltage division we use potentiometer R2 to
allow the output scaling to be modified.

13
Figure 7: Volume Oscillator

2.4 Audio Generation (Patrick)


2.4.1 Purpose
The audio generation circuitry has two roles: creating the audible pitch and
controlling its volume. The pitch has to be extracted from the difference in
frequency of the fixed pitch oscillator and the variable pitch oscillator. The
volume has to be controlled using the variable frequency output of the volume
oscillator.
The audio generation circuitry can be broken into three modules: a signal
mixer, a frequency to DC voltage converter, and a voltage controlled attenuator.

2.4.2 Theory - Signal Mixing


The fixed pitch oscillator (FPO) is tuned such that its output frequency is equal
to the output of the variable pitch oscillator (VPO) when there is not a hand
near the pitch antenna. This means that the difference in frequency between
these two signals is ∼ 0Hz when the theremin is not being played. As the
musician moves their hand closer to the pitch antenna the variable pitch
oscillator’s output will increase in frequency. This causes the difference between
the VPO’s frequency and the FPO’s frequency to increase. This difference
reaches approximately 3KHz at its maximum. By building circuitry that can
generate a sinusoid at this frequency difference the theremin can generate a pitch
with range ∼0Hz-3KHz. Performing this operation is the job of the mixer circuit.
Given two sinusoids, y1 and y2 , with two different frequencies, f1 and f2 ,
the multiplication of y1 ∗ y2 will lead to the creation of two sinusoids. One of
these sinusoids will have frequency f1 − f2 and the other will have frequency
f1 + f2 . This is the principle of mixing two signals to generate a new signal of a
different frequency. This multiplication operation is what the mixing cicuitry
uses to generate a sinusoid with a frequency equal to the difference between the
VPO’s frequency, fV P O , and the FPO’s frequency, fF P O . Along with outputting

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.

2.4.3 Circuit - Signal Mixing


The signal mixing circuit can be seen in figure 8.

Figure 8: Mixer Circuit

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.

2.4.4 Theory - Frequency to DC Voltage Conversion


The musician can control the volume of the instrument’s audio signal by moving
their hand near the volume antenna. The volume oscillator outputs a sinusoid
which varies in frequency based off of the distance of the musician’s hand to the
volume antenna. This varying frequency signal needs to be converted into a DC
voltage so that it can be used to control the voltage controlled attenuator. It is
the voltage controlled attenuator that will adjust the volume of the audio.
The method used for converting a variable frequency signal to a variable
DC voltage signal can be broken down into two steps. The first step is to pass
the variable frequency signal through a low pass filter, with the goal of
attenuating the signal. The second step is to pass the output of the filter
through a peak detector circuit.
The first step of this process uses a low pass filter with a cut-off frequency
below that of the input signal’s frequency. The output of this filter will be an
attenuated version of the input signal. The magnitude of the attenuation will
depend on the input frequency. The higher the input frequency the more the
signal will be attenuated. So as the player moves their hand near the volume
antenna the frequency of the volume oscillator changes and the magnitude of the
filter’s output signal changes.
The next step of this process passes the output of the low-pass filter
through a peak detector. The peak detector detects the magnitude of the
attenuated signal and produces a corresponding DC voltage. So after this step
the variable frequency signal has been converted to a variable DC voltage signal.

2.4.5 Circuit - Frequency to DC Voltage Conversion


The frequency to DC voltage converter circuit can be seen in figure 9 and 10.
For visibility this circuit has been cut in two. The output of figure 9 flows into
the input of figure 10.
The first block in figure 9 is a third order Sallen-Key low-pass filter with a
cut-off frequency of 300KHz. This filter implements the low-pass filter stage

16
Figure 9: Frequency To DC 1

Figure 10: Frequency To DC 2

discussed in section 2.4.4. The third order filter provides a -60dB/dec


attenuation above the cut-off frequency. The cut-off frequency was selected to be
lower than the 450KHz volume oscillator signal, but not low enough to vastly
attenuate the signal. This filter was chosen to be a third order filter to produce a
large range of attenuation over the relatively small frequency change produced

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.

2.4.6 Theory - Voltage Controlled Attenuator


The voltage controlled attenuator uses the DC control voltage from the
frequency to DC converter to adjust the volume of the audio signal. The
attenuator provides a theoretical gain between 0 and 1. Since the amplitude of
the output from the mixer is set to be at full volume according to the line-level
specification, this attenuator is all that is need to provide a full range of volume.
This device can be constructed using a voltage divider where the bottom resistor
has a variable resistance based on the control voltage.

2.4.7 Circuit - Voltage Controlled Attenuator


The voltage controlled attenuator circuit can be seen in figure 11.

18
Figure 11: Voltage Controlled Attenuator

The circuit is a voltage divider where the output is of the form:


Rvar
vaudio = · vmixer out (7)
Rvar + R3
Rvar is the variable resistance due to the 2N5459 JFET. This JFET is used as a
variable resistor whose resistance is controlled by the control voltage produced
by the frequency to DC converter. A control voltage of 0V provides the smallest
JFET resistance thereby creating the most attenuation and producing a silent
audio signal. A control voltage of approximately −10V provides the largest
JFET resistance thereby creating no attenuation and producing a full volume
audio signal that has the max line-level signal. R1 and R2 couple a small
amount of the drain signal to the gate of the JFET. This allows the circuit to
handle a large input voltage swing and still provide a relatively linear response.
Lastly there is a buffer on the output of this stage. The output voltage produced
here is the final audio signal used to drive a battery powered speaker.

2.5 Frequency Visualization (Pedro)


2.5.1 Purpose
The Frequency Visualizer serves to give the player a visual representation of
where in the frequency spectrum he or she is playing. This is done by having an
array of LED columns sensitive to different frequency bands, as shown in figure
12. Each column then has a row of LEDs that lights up incrementally the closer
the Theremin output frequency gets to its center frequency. A calibrating row is
also added, which responds to a narrow frequency range around the standard
tuning frequency A440.

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.

Figure 13: Frequency Visualizer Block Diagram

2.5.3 Circuit - Gain Stage


The gain stage serves to amplify the audio input from line voltage to
approximately 22Vp−p (OpAmp output rail-to-rail voltage). It also gives the
added benefit of having a high input impedance into the visualizer circuit. The
gain stage was done by implementing a simple non-inverting op-amp circuit,
shown in figure 14, with a variable resistor in the feedback path. A variable gain
from 8 to 35 is recommended in order to support voltage inputs from 0.6V to
2.5V. The gain of this stage is 1 to PRG
ot1
.

20
Figure 14: Gain Stage

2.5.4 Circuit - Band-Pass Filtering Stage


In order to be able to visualize different frequency ranges they first have to be
detected from the audio input. This is done by having a band-pass filter for each
frequency range of interest. A band-pass filter is in essence a combination of
low-pass and high-pass filters set up such that only the frequencies of interest are
returned, as can be seen in figure 15. In the visualizers case, we want the
low-pass and high- pass filters to resonate at the same frequency in order to have
a recognizable change in the output of the filter as the frequency changes.

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

2.5.5 Circuit - Amplitude Detection Stage


The amplitude detection stage, shown in figure 17, is in essence a rectifier. As
the amplitude of the band-pass filter output decreases, so does the voltage
output of the rectifier. Appropriate resistor and capacitor values were chosen
such that the rectifier output was sensitive to any changes in the input.

Figure 17: Rectifier diode coupled to a RC circuit for proper detection

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 astable configured operational amplifiers which turn on respective


LEDs after certain thresholds.

• 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.

2.5.7 Visualizer Circuit Schematic and PCB


After deciding all of the critical design choices the whole circuit was laid out in a
schematic and tested on a breadboard. Testing on the breadboard was successful
after the first trial and a final schematic which was composed of all of the
previous subsections.
After successful testing it was decided that it would be ideal to construct
the whole visualizer on PCBs in order to attain a compact and elegant visualizer.
Each visualizer array took a whole breadboard, so nine would have been needed
for the whole circuit. With the PCBs, three visualizer arrays could be placed on
one board. Three PCBs were ordered for a total of nine arrays.

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.

Figure 20: Completed Theremin

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

Figure 21: Antennas

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

You might also like