Post Go back to editing

An ADAU1701 "Theremin"

   Invented in 1928, the Theremin -- Theremin - Wikipedia was a milestone in early electronic music.  Ninety years later, you can demonstrate a Theremin-like device with just a ADAU1701MINIZ board, a speaker, two resistors and a pair of metal objects to serve as antennas.

   In this version, a fixed 44 KHz oscillator drives the antennas through 22 K ohm resistors. A nearby hand contributes capacitance to ground, adding phase lag,  The project detects this phase shift on each of its two antennas, driving the pitch via a VCO and the volume with a simple multiplier.

As one might expect, approaching the pitch antenna raises the pitch.  In the original Theremin the volume decreases as one moves toward the volume antenna.  In my version the volume increases with proximity since this helps insure silence when not being played.  This of course could easily be reworked to provide traditional operation.  As shown below the 22 K resistors are under the orange tape, and two cat food bowls serve as the antennas.  

   Adjust the fractional delay for a near-zero measurement at both readbacks.  An auto-cal arrangement brings volume and pitch to zero at startup, eliminating tedious fine-tuning (at the risk of stating the obvious, stay away from the antennas during this five-second startup delay).  Since the external circuit ties up both input and output jacks on the -1701 eval board, I used the board's class-D amplifier for the output audio.  The speaker I had handy is a 8" ceiling mount with a 70 V transformer -- this keeps the volume low.  Approach the volume antenna too closely and the thing overloads and screeches -- "That's not a fault, it's a feature!"  In any event, the fix is the punch line for the old joke, "Doctor, it hurts when I do this."  Sometimes I hear "bumps" in the pitch and volume, apparently caused by noise pickup at the antennas -- after all, the circuit by design must be very sensitive to what happens there.  Making a 1 KHz change in the operating frequency accompanied by a corresponding re-tuning of the fractional delay often cures this.  Powering the board (in self-boot) from a switching wall-wart caused hum modulation for me -- I suggest a 5V regulated linear supply.  If anyone can make this project more "bullet-proof" from these effects, I'd love to hear about it.

   Likely you might imagine additional features which would prove to be "ahead of what's possible" in the analog world -- multiple VCOs in selectable major/minor/7th harmony, for example.  Presently these are limited by the project's 192K sample rate with its corresponding instruction count.  You do need a high operating frequency to sense the pico-farad capacitance changes.  Even worse, the multiplying phase detectors double the 44 KHz working frequency to 88 KHz.  If despite this you can get the thing to work at a 96K rate, you'll have plenty of extra instructions to play with.

   The now-defunct kit company, Ramsey Electronics, used to print on their cartons, Electronics is fun!  --  where I work we often joke about this when things aren't going well, yet this project was fun for me!

Theremin-1.dspproj.zip
  • Hi KJBob,

    sorry for my Englich.

    I design a Theremin with 4 Channel Amplifier helping your exemple with ADAU1710, but i don't know, how i use the input in this Project, until the Theremin works. 

    Can you help me?

    Thanks!!!Pitch_AntennaA Channel Amplifier

  •      Hello Mhano,

         The Theremin project above was just a fun gadget to play with -- it doesn't work as well as one purpose-built from RF components.  I had it on a shelf just outside my office at work, and folks would pass by and try it.

         I'm afraid I don't know about the amplifier you're working with -- and looking at the HiFiBerry site didn't help much.  Your amplifier appears to use a ADAU1452 -- is that correct?  I have a ADAU1452 board, yet unlike your Beocreate, my board only runs at 48 kHz.  The Theremin needs the DSP to run at 192K, so I can't try this out on something closer to what you have.  Here's a few suggestions, though:

    • Before attempting this project, try some easier projects to get familiar with SigmaStudio.  For example, can you  make a project that does EQ?  Do you know how to make it work properly at a 192K sample rate?
    • The Theremin's 44 kHz oscillator feeds two DAC outputs.  Connect a 22K ohm resistor from each DAC output (not the amplifier speaker output) to its own ADC input.  Hopefully the DAC outputs are available as pins on the board.  I don't recommend soldering to this board as it appears rather expensive.  Connect an antenna to each of these inputs as shown.

    • You'll need something like the metal bowls I used for the antennas -- the wires alone don't have enough capacitance.
    • DSP Readbacks are useful to monitor DC or slowly changing levels.  They cannot track the output of an audio oscillator, they will just give random numbers each time you press the read button.

         Best regards,

         Bob

  • sorties

    Hi KJBob,
    Thank you for your answer to the previous question.
    So far I still haven't found enough information about Hifi unfortunately. I'm a newbie in Sigmastudio and I have to write my thesis soon so I need if possible to have some pictures of your setup with the ADAU1710 to get an idea.
    The Beocreate I have already works at 44 kHz as a sampling frequency, at 192 kHz it also works perfectly. I tried what you recommended with the 22kOhm resistor, but now I'm confused about the Sigmastudio input and the Board input. I tried to use the GPIOS inputs but alas. So now I don't know if my Theremin on Sigmastudio is right...
    I thank you once again for your help.
    Sincerely

  •      Hello Mhano,

         The ADAU1701MINIZ board I used for this project is described here.  Its audio input jack is AC coupled to the ADAU1701's ADCs.  The ADAU1701 has four DACs.  DACs 0 and 1 connect to the board's 2 watt amplifier.  DACs 2 & 3 are AC-coupled to the board's output jack.  The picture below is from Page 8 of the board's manual, with the connections for one of the antennas in red.  The other antenna is connected in a similar way.

         In the Theremin project, only DAC0 outputs the sound to an amplifier.  DACs 2 and 3 are used to output the 44 kHz signal to drive the antennas.  The ADAU1701 board brings these out to a jack, not to amplifiers.  This is what the Theremin needs to operate.

         What documentation do you have for the Beocreate board?  I'd expect it to come with a manual like the one for the ADAU1701MINIZ linked above.  To do this project you need a schematic diagram showing how your board's DSP and its external DAC / ADC chips are wired to the accessible pins.  Most likely the Beocreate board has audio input jack(s) AC coupled to ADCs -- where in normal operation you would connect an audio source.  And it has four DACs, each coupled to one of four amplifiers.

         The Beocreate's input jacks are likely AC coupled to ADCs, in a manner similar to the input jack on the ADAU1701 board.  Thus they may work fine as antenna inputs.

         This project needs just one DAC -- in my board it's DAC0 -- connected to one amplifier and speaker.  Two more DACs are needed to output the 44 kHz signal through the 22 K resistors to the antennas and ADC inputs.  Since these two DACs output a frequency above the audio range, they should not be connected to amplifiers.  This may be a problem with the Beocreate board if all its DAC outputs are hard-wired to amplifiers.  Does this board allow you to disable two of its four amplifiers with jumpers?   Again I can't recommend that you modify or solder on the board, especially without good documents for it.

         Does the Beocreate have any GPIOs that aren't used internally and are wired to header pins you can access?  If so, you could use these for the 44 kHz outputs instead of DACs.  Although these output square waves instead of sine waves, the phase-shift sensing at the antennas may still work.  To use the GPIOs, you'll need to modify your SigmaStudio project:

               The Clipper removes the negative half of the 44 kHz sine wave, making it zero.  The GPIO outputs a High for any nonzero input, and a Low for zero input.  Thus the pin outputs a square wave.

         Set this GPIO to the unused MP pin you have chosen.  Go into your project's Hardware Configuration tab, and then the Register Controls section.  Select the Multipurpose / Aux ADC tab, then for the numbered MP pin you're using, select the mode Output with pull-up, and the Multipurpose function.

         Finally, find that GPIO on your board's header pin and wire this through a 22K resistor to one of the audio inputs.

         Set up another GPIO the same way for the other antenna and input.

         With no way of testing this over here, I'm afraid you're on your own.  It would be good to enlist some local help with troubleshooting this project.  There's nothing else I can do from here.

         Best regards,

         Bob