Let's Design and Build a (simple) Analog Theremin!

Posted: 4/10/2023 7:50:13 PM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

Mixer and voltage controller amplifier. OTA approach.

After playing with OTA (operational transconductance amplifier) as theremin output buffer with current sensing (see this post in wallin oscillator thread),
I've designed not very simple, but high quality analog mixer (multiplier) for analog theremin.

LTSpice model: github link


For two pure sine 1 Vpp input signals near 1MHz with 1KHz difference, output signal 1 Vpp has low harmonics level for both low frequency (2,3,4 KHz) and high frequency (1,2,3... MHz) are about 57dB.
Differential amplifier with current output on Q1..Q6 which amplifies input signal IN1 is controlled by voltage to current converter on Q7, R9 - by voltage from input IN2.
Output current is being filtered (integrated) by C1 to get rid of RF frequencies in output.

This mixer is powered from 3.3V
To work from different voltages, some tuning may be required (R9, C1).
Input voltage ranges may be changed from 1 Vpp (up to 1.5Vpp for IN1 and 2.5Vpp for IN2) or lower values, but may require changing of bias points using R3-R8.
Output voltage range is tuned to be 1V p-p, centered at VCC/2 (1.65V), but it can be changed by R1, R2, C1.
Supports input frequencies in a wide range: works fine with 10Mhz and 100KHz (but on lower frequencies, RF LP filter passes more high frequency to output.)

Inputs: 1Vpp 1Mhz and 1.001MHz

Output: 1001KHz - 1000KHz = 1KHz


Of course, pure sine output is not the best waveform for theremin, but it may be turned into non-sine by changing of one of or both inputs from sine to some more interesting sounding wave.
As well, some distortion / shaping stage may be added after mixer input.

Similar approach with additional OTA stage can be used to add VCA for volume control.
Moreover, this schematic may be used as is to work as VCA - with output of mixer fed to IN1, and volume control voltage - on IN2 input.

Let's try...

LTSpice model: github link


Volume control is logscale below 1.4V and almost linear for higher voltages. By choosing of voltage control working input range, it's possible to change linearity.

This schematic can be tuned for different waveforms - between pure sine and almost square by changing of diff cascade overload.

I think, waveform shaping can be made adjustable - by placing pot somewhere.


Second stage amplifier filters out RF even more, giving clean signal.


This schematic is big enough (14 BJTs). But transistors are cheap now, so it should be inexpensive.
As well, we can try to use OTA ICs (e.g. LM13700 NE5517 OPA615 OPA860 OPA861), but all of them cannot be driven by 3.3V instead of discrete BJTs, and they are more expensive.

TBD:
- design "mixer" to generate volume control voltage from volume fixed and variable oscillator signals. Can it be done on OTA?
- design good OTA based current sensing oscillator for theremin (VFO)
- design good and stable "fixed" frequency oscillator which can be slightly adjusted with a pot (can it be done w/o varistors?)
- design some waveform shaper with pots control to make sound more interesting
- combine all listed above togeher to make an analog theremin

P.S: Is pitch antenna linearity a real problem?


Posted: 4/14/2023 12:58:10 PM
JPascal

From: Berlin Germany

Joined: 4/27/2016

Thank you, Buggins, for sharing the schematics and simulation files! Hard to believe how clean the sine wave voltage is after the mixer. For me, the volume control is also a very good suggestion to rebuild and vary.

Posted: 4/15/2023 11:29:53 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I've designed not very simple, but high quality analog mixer (multiplier) for analog theremin."  - Buggins

I think a bits and pieces approach like this is generally the way to go.  Surface mount transistors and passives don't cost much and will likely never disappear, and the build can be easily automated so complexity isn't a real issue.

"P.S: Is pitch antenna linearity a real problem?"

I would say yes.  Hand C really dominates in the near field, swamping body C, so you have much finer control there.  But if the near field is non-linear it tragically tends to get avoided.  Accidentally touching the non-insulated antenna and having it squeal like a pig is another danger to be found in the analog near field.

Posted: 4/15/2023 11:41:45 PM
Buggins

From: Porto, Portugal

Joined: 3/16/2017


Hard to believe how clean the sine wave voltage is after the mixer. For me, the volume control is also a very good suggestion to rebuild and vary.

It might be a problem actually. Pure sine sounds bad.
I've tried to produce non-sine signal from this mixer by distorting of one of inputs - but it still gives sine wave on output.
Even if one of inputs is square - there is still sine on output.
It looks like both mixer inputs should be non-sine to have non-sine output.

Fortunately, OTA has "overdrive" mode which uses wider, non-ninear range of atan() shaped transfer characteristic.
Varying of working range of OTA allows to sweep between pure sine and almost square.
Interesting how does this squarish waveform sound like... I'm going to export waveform from LTSpice to WAV file to check...

I think a bits and pieces approach like this is generally the way to go.  Surface mount transistors and passives don't cost much and will likely never disappear, and the build can be easily automated so complexity isn't a real issue.

Makes sense. 6-BJT OTA looks like nice building block. Below, see 12-BJT current sensing oscillator model.
Main part of analog theremin 4 oscillators + 2 mixers would already require 74 transistors (12 OTAs)...

I would say yes.  Hand C really dominates in the near field, swamping body C, so you have much finer control there.  But if the near field is non-linear it tragically tends to get avoided.  Accidentally touching the non-insulated antenna and having it squeal like a pig is another danger to be found in the analog near field.

Etherwave gives almost the same pitch when hand is very close to the antenna and if I touch the antenna.
Is it due to its linearization coils trick?
Are other analog theremins, w/o linearization coils, unplayable in near hand range?


Played a lot with LTSpice simulations of transconductance amplifiers.
Finally I've figured out how to make good current sensing oscillator on OTAs.
Extremely low phase error is achievable - 1 ns delay between LC tank current and drive signal voltage.

Two transconductance amplifier needed - one working as voltage follower and one as current sensing and drive signal shaping.
First OTA based voltage follower is loaded on LC tank.
Second OTA should have bigger gain - for compression of output range. It's loaded on resistive load.
Achieved bigger gain using extending of input voltage with additional resistor on voltage follower output.
Tried alternative - reducing of voltage follower gain with resistors on emitters in diff cascade, but it seems to be worse.

LTSpice model to play with is available on github.

Component values selected for minimizing of phase error and maximizing antenna voltage swing.
Draws 35 mA from power supply.
It's possible to tune for more sine like signal and less power consumption, in price of less voltage swing and probably bigger phase error.


On inductor with 120 Ohm serial resistance, from 3.3V power supply, it gives 4mA 1.45Vpp drive signal with nice symmetric almost sine waveform producing 160Vpp on antenna.

LC tank current and drive voltage:


Voltage swing on antenna:

The same schematic can be used as a current sensing analog front end for digital theremin.

In this case, SENSE output should be disconnected from positive inputs of OTAs, external drive input signal will be used instead.
Output buffers should be added for REF (first OTA output) and SENSE (second OTA output) for analog front end.
I'm expecing that when drive and LC tank current are in phase, difference between two outputs is close to zero (less than one nanosecond).
It can be used even in D-Lev next-gen analog front end.
Square drive output of FPGA may be converted to sine with acceptable voltage swing using some simple RLC filter.
Zero phase shift for resonant frequency is not a problem for FPGA PLL.


UPD:

How to deal with hand positions close to antenna and hand touching antenna?
1) add serial capacitance between drive and LC tank. If hand is modelled as shorted to ground, effectively this serial capacitance becomes the only C in LC.
Serial 220pF cap reduces (C_ant+C_hand) sensitivity by 4%. 100pF - by 9%, 47pF - by 17% (actually, frequency change range reduces by sqrt() of C sensitivity).
When hand touching antenna is modelled by C_hand and R_body connected serially, it's harder to keep the cirquit oscillating for R_body 10K..330K.
2) increase R3 to 100-200 Ohm to increase second OTA gain. Additionally, one more resistor can be added before R3 - once side to Q2,Q4 collectors OTA current output, another side to Q2 base and R3.
I'm not sure what is a proper model for hand touch and hand very close to antenna, but I believe it's possible to tune double OTA for suitable behavior in these cases.
Good behavior for oscillator while hand is touching or close to antenna: keep oscillation, without big frequency drop.
Can such workaround work as linearizing cirquit? Like linearizing serial C instead of serial inductors?

Posted: 8/17/2023 10:01:39 AM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

Several current sensing oscillator LTSpice models are available here on github

Recent one: built using 15 BJTs.
Automatic gain control allows to keep oscillation when hand touches antenna.

Uses fast voltage follower (0.5ns propagation delay).
Power supply: 4.5V 45mA
Inductor: L=2mH R_serial=20 Ohm
Phase error: 12ns
Drive: 2.2Vpp 24mA smooth square
Antenna voltage swing: 800 Vpp
May be tuned to be closer to sine (20-40dB harmonic) but with smaller antenna swing.


Posted: 3/28/2025 5:27:35 PM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

I'm trying to design extremely sensitive and stable variable frequency oscillator for analog theremin.

It's Wallin (current sensing) oscillator with analog PLL.

* Drive signal is almost pure sine wave (-45dB biggest harmonic)
* Connects to LC tank inductor from one side (isolated by inductor from any noise from antenna)
* Measures drive current phase and compares it with drive voltage - on resonance phase shift between voltage and current is 0
* Uses more than 100 BJTs and a few opamps, but I hope that assembly service like JLCPCB may be used instead of hand soldering
* Uses integrator to get an additional 90 degrees phase shift (because it's impossible to implement good phase detector which locks on 0 degrees)
* Uses analog multiplier as a phase detector (to lock on 90 degrees shift)
* Implements analog PLL to lock on resonant frequency
* Drive signal frequency is kept pretty close to the resonance
* PLL frequency range is selected by 2 resistors (makes sense to limit the range to avoid locking on harmonics)
* With 120 Ohm series resistance inductor, expected to have 240Vpp voltage swing on antenna (with 8 mA drive current)
* With lower resistance (higher Q inductor), can pump up to 500-1000 Vpp swing (30-50mA drive), but sense resistor nominal should be decreased.


LTSpice model is available on GitHub.

Schematic:

Control voltage:

Inductor current:

Antenna voltage:

Inductor current and drive voltage when PLL is locked:

This oscillator can be used for analog or digital theremins.

For digital theremin, it should be enough to measure output frequency - which can be done with MCU, without FPGA.


Posted: 3/28/2025 7:48:12 PM
markallie

From: Madison, WI

Joined: 5/19/2016

Buggins thanks for sharing. I love the direction of this work. I don't have anything to offer at the 3.3V level. 

I wanted to tell you that we use a gilbert cell, MC1496, for one of the mixers. It is similar to one of the mixers you presented above. 

We also use an OTA, the LM13700, for another. We have 15V so that is not a problem. The OTA also yields a good volume control and signal smasher. Like Moog did in the Etherwave. As you mentioned sine waves don't sound good so signal smashing is IMO a good thing. 

Your designs are certainly low component cost. Not really board space cost. Sometimes that matters for us. Us and we are the students and myself in one particular analog electronics lab at UW Madison. When some of these IC's become unobtainable the transistor only versions will be great to have. I have already made a discrete version of the gilbert cell, and OTA for this reason. We just don't have to use them yet. We use BCM857 and BCM847 matched pairs in some of the circuits. These may help your specs in some of the circuits. Nexperia has LTSpice models for them. Please keep it up. I love discrete designs.

I missed the part where you went to Porto Portugal. Can you tell us why you made the move?

Posted: 3/31/2025 12:15:46 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"* Uses more than 100 BJTs and a few opamps..."  - Buggins

Vadim, you constantly amaze me with your mad analog circuit skillz!

"* Uses integrator to get an additional 90 degrees phase shift (because it's impossible to implement good phase detector which locks on 0 degrees)"

I'm reading "Phase-Locked Loops: System Perspectives and Circuit Design Aspects" by Woogeun Rhee and Zhiping Yu (2024) and they show a set / reset flip-flop type phase detector that works at 0 or 180 degrees.  It is edge rather than level sensitive, and because of that might also be duty cycle sensitive in this application, though that could likely be mitigated by inverting the inputs to a second set / reset flip-flop and combing the outputs algebraically.  I'll post something on it soon.

Posted: 3/31/2025 3:45:34 PM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

[markallie] Buggins thanks for sharing. I love the direction of this work. I don't have anything to offer at the 3.3V level.

I'm trying to design an oscillator which is easy to interface with MCUs.

5V power supply is not a problem in such case - linear regulator may give clean 4.5V and 3.3V from 5V.

Of course, it's possible to use some DC-DC converter, but I'm trying to avoid using such components.


[markallie] I wanted to tell you that we use a gilbert cell, MC1496, for one of the mixers. It is similar to one of the mixers you presented above.

Analog multiplier is an easy to replace part. Only a few BJTs. By limiting of input and output ranges, the number of BJTs may be reduced, achieving better performance.

[markallie] We also use an OTA, the LM13700, for another. We have 15V so that is not a problem. The OTA also yields a good volume control and signal smasher. Like Moog did in the Etherwave. As you mentioned sine waves don't sound good so signal smashing is IMO a good thing.

LM13700 is available on JLCPCB for about $0.53 (providing 2 OTAs) so its cost looks cheaper than discrete variants on BCM857 and BCM847.

But it has limitation on power supply range and output range.

I will try to create LTSpice model of such PLL based on LM13700 a bit later.

Possible advantage of high supply voltage could be a higher drive signal voltage swing - resulting in antenna voltage swing counted in kilovolts.

[markallie] Your designs are certainly low component cost. Not really board space cost. Sometimes that matters for us.
Us and we are the students and myself in one particular analog electronics lab at UW Madison.
When some of these IC's become unobtainable the transistor only versions will be great to have.
I have already made a discrete version of the gilbert cell, and OTA for this reason.
We just don't have to use them yet. We use BCM857 and BCM847 matched pairs in some of the circuits.
These may help your specs in some of the circuits. Nexperia has LTSpice models for them. Please keep it up. I love discrete designs.


I think, labs with OTAs and analog multipliers are very useful for the students.
I only learned about OTAs here on TW forums from Eric's posts. OTAs are great in many areas where normal op amps are not. Especially when you need to create tunable filters or variable gain circuits.

Thank you for pointing at BCM857 and BCM847 mathed pairs. Although, they are a bit more expensive than BC854/BC847 ($0.15 .. $0.2 vs $0.015 .. $0.03).

[markallie] I missed the part where you went to Porto Portugal. Can you tell us why you made the move?

Just moved from Russia to Portugal because of the war, 2.5 years ago.

[dewster] I'm reading "Phase-Locked Loops: System Perspectives and Circuit Design Aspects" by Woogeun Rhee and Zhiping Yu (2024) and they show a set / reset flip-flop type phase detector that works at 0 or 180 degrees.  It is edge rather than level sensitive, and because of that might also be duty cycle sensitive in this application, though that could likely be mitigated by inverting the inputs to a second set / reset flip-flop and combing the outputs algebraically.  I'll post something on it soon.

I feel that 90 degrees analog multiplier PLL than one based on triggers.

In my recent schematic, 90 degrees shift is free (actually, it does the filtering of possible noise from the antenna).


Simplified version of oscillator with current sensing and analog PLL

* Moved 90 degrees phase shift from separate component to current sensing circuit

* Removed sallen-key LP filter on control voltage

Tried to replace output buffer with current feedback opamp IC, but they require 5V or higher power supply, have output voltage swing offset 1.2 / 1.4V from rails, and cost about $5.


Posted: 3/31/2025 9:40:06 PM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

It looks like fast opamp like ADA4891 ($2.82 on JLCPCB) is good as an output buffer.
(the rest of opamps here are MCP6021 - $0.84 on JLCPCB).

So, even simpler schematic:

Drives LC tank with 8.5mA 2.5Vpp pure sine wave (-60dB harmonics)
Draws about 15mA in this mode


You must be logged in to post a reply. Please log in or register for a new account.