Idea for simple extra sensitive Open.Theremin sensor.
Instead of oscillator and heterodyne, use simple phase detection (as suggested by dewster).
Compare phase shift of reference clock passing through LC tank.
XOR based phase shift detector gives PWM output.
LP filter converts PWM to voltage which can be measured by ADC.
When input frequency equals to LC tank resonant frequency, PWM is 50% duty cycle, and OUT is VCC/2.
When hand approaches antenna, OUT increases, when hand distance increases - OUT decreases.
Q correction: R1 value (and R2) may be chosen to tradeoff between sensitivity at higher hand distance and near distance.
Output voltage depending on R1 (sumulate C_hand changing from 0 to 3pF with 0.1pF steps).
Lower line - C_hand=0pF, upper line - C_hand=3pF
R1 = 330
R1 = 470
R1 = 680
R1 = 1000
Probably, such R1 and Fref may be chosen than OUT voltage linearly correspond to hand distance.
Calibraton stage:
when hand is far from antenna, tune reference frequency F0 to get output voltage somewhere in range 0.8..1.5V
detect Q: measure output voltage for F0 + diff, F0 - diff : this will provide K for
Fine tunable reference clocks are required.
For Teensy, internal PLLs may be used to generate reference clocks.
For Arduino, following one may be used:
Clock Generator: SI5351 with I2C interface.
ADAFRUIT breakout ($7.95)
2 PLLS - allows to generate reference frequency with very high precision
25MHz base clock * multiplier (5..90) / divider (4..900)
10bits of Arduino ADC may be not enough.
13bits of Teensy 3.X ADC - more than enough
For Arduino, following external ACD may be used:
16bit ADC with I2C interface.
ADS1115 breakout board ($14.95)
Getting value from sensor.
Measure OUT using ADC.
1) Calculate C_hand by linearisation depending on Q using atan() based formula
2) Convert C_hand to hand distance based on known C_hand/distance graph
3) Convert hand distance to note/frequency
All 3 steps may be combined into pre-calculated conversion table on calibration stage - just perform linear interpolation.
When using Teensy instead of Arduino, only following external components are needed:
2 74HC86 ICs (don't use one for both LC - for better decoupling).
2 L air core coils, e.g. D20-40mm, length = 1*D..2*D - use different coils for pitch and volume (e.g. winding length 2 times bigger for volume)
1 2-channel opamp AD8616 - for two LP filters
2 SP721 for ESD protection
8 caps, 9 resistors
Can anyone minimize digital theremin more?
Idea for high quality minimalistic Teensy 3.6 audio out:
Teensy 3.6 has 2 12-bit DAC pins.
12 bits seems too low for high quality, but only when we applying volume control directly to DAC input value.
We can use external VCA - using second DAC channel as volume control.
In this case we need
* 2 LP filters on DAC outputs
* VCA
* mono amplifier