You are on page 1of 5

instructables

MiniMin - a Theremin Style Instrument From 6 Components

by techno-womble

The aim of this project is to build a playable Theremin style instrument using the minimum number of components.
The Theremin is an electronic instrument played by moving both hands in close proximity to the device. It requires
no physical contact between the player and the instrument. A conventional Theremin uses electromagnetic fields
to sense the distance of the players hands from two antennae. The MiniMin uses two low cost ultrasonic distance
detectors controlled by an Arduino micro-controller.

Learning to play a traditional Theremin is notoriously difficult. For this reason, the MiniMin has a 'cheat' mode
where the pitch will 'snap' to the closest musical note in a scale. Four musical scale options are provided :-

Chromatic
C Major
C Minor
C Minor pentatonic

Additional scales can be added simply by defining an array of frequency values. Traditional behaviour or 'snap to
scale' mode can be selected when the Arduino sketch is compiled.

Supplies:

The MiniMin comprises only six components: -

1 X Arduino microcontroller - I used an Uno but any compatible should work

2 X Ultrasonic range sensors - I used the ELEGOO HC-SR04

1 X 270 Ohm resister

1 X 100 nF capacitor

1 X Audio output socket (6.3mm or 3.5mm)

The circuit is simple enough for point-to-point hand wiring or you could use a breadboard or perfboard.

The MiniMin runs happily off USB power so no special power supply is required.

You will also need a PC with the Arduino IDE installed to load the software.

MiniMin - a Theremin Style Instrument From 6 Components: Page 1


Step 1: How It Works

MiniMin - a Theremin Style Instrument From 6 Components: Page 2


The circuit for the MiniMin is shown above. is sent to the output.

The two Ultrasonic range detectors replace the The MiniMin has a usable range of around three
antenna of the traditional Theremin. One controls the octaves which is comparable to a mid-range
frequency (pitch) of the output and the other controls analogue Theremin. The sketch uses a tuning range
the amplitude (volume). Operation of the sensors is of C4 to C6 (one octave below Middle C to two
straightforward. The Arduino sends a digital pulse to octaves above) which can be changed by editing the
the TRIG pin of the sensor causing it to emit a burst values of 'lowestFreq' and 'highestFreq'. Similarly, the
of high frequency audio. If an echo is detected the operating distance of the sensors can be tweaked by
sensor toggles the ECHO pin which is monitored by changing the 'low' and 'high' threshold values.
the Arduino. By measuring the time delay between
the outgoing pulse and returning echo we can The two sensors of the Minimin are placed at 90
calculate the distance. As sound takes 29 degrees to each other, similar to the antennae on a
microseconds to travel one cm, and must travel out regular Theremin. The distances measured are
and back, we can divide the time to the echo by 5.8 to mapped to frequency and volume variables which are
get the distance in mm (the project uses time/6 as an applied to the Mozzi oscillator.
approximation).
Line 22 of the sketch determines the operating mode
The audio output is generated using Pulse Width of the MinMin. If set to 'false' it will operate as a
Modulation (PWM) to reduce the component count. It traditional theremin with a constantly variable
requires only one capacitor and resistor connected frequency response. If set to 'true' the MiniMin will
between the PWM output (digital pin 9 on the Uno) choose the closest note in the selected scale.
and the output socket. The PWM output is a string of
digital pulses. If the pulses are high enough const boolean stepMode = false;
frequency they will charge the capacitor and give a
rising voltage on the output. If the pulses are of low The desired scale is selected by 'uncommenting' the
frequency the capacitor will discharge and the output corresponding array of frequency values (lines 24 - 42
voltage falls. By varying the pulse frequency (or of the sketch).
pulsewidth) a waveform can be generated. Although
this kind of PWM audio is fairly low quality it is good The complete sketch can be found on my GitHub
enough for this application. The project uses the page.
Mozzi audio library to generate a triangle wave which

MiniMin - a Theremin Style Instrument From 6 Components: Page 3


Step 2: Demo and Future Plans

The video above gives a brief demo of the MinMin The aim of this project was to use as few components
(external delay and reverb effects have been added). as possible. However, the addition of a some extra
The current version is very much a breadboard hardware could greatly increase the functionality.
prototype. The next step is to choose a suitable Some simple switches would allow different
enclosure and hard wire the components. I like the waveforms, mode, scales and octaves to be selected.
idea of using a short length of drainpipe with a 90 Next job - the MiniMinMax!
degree elbow to keep the sensors at a right angle.
Swapping the Arduino Uno for the smaller Nano
would allow a more compact case to be used.

https://vimeo.com/385520521

I've built it! However, I'm not getting any audio out of it. I do get a "pop" whenever I power it on or
unplug the cable to the amp. Also, there is an orange led on the uno that flickers when I move my
hand in front of the pitch sensor but not the volume.

I've gone over the wiring diagram multiple times and can't seem to figure this out. I'm running the
code as stock without any changes. I used the same color wires as in the diagram just to keep
things easy. I'm including an image of my build hoping that you might see something that stands
out. Thanks for a neat project!

Sorry about this but there is an error in the circuit diagram. It shows a polarized capacitor that is
connected the wrong way round. My mistake. Connecting the side with stripe to GND should fix it.
Alternatively, a non-polarized capacitor would work.The flashing LED is a good sign as the pitch
sensor is connected to the same pin as the internal LED. I'll update the diagram.
I agree with MicheleA41, the capacitor looks like 100uF (or 100 F). I also wonder what its
purpose is. If it is there to block DC from reaching the jack-socket then it should be in series with
the resistor.

The jack-socket as shown is wired out of phase. The pin on the top is the one that will connect to
the sleeve of the jack, and this should be ground. It matters if this circuit is connected to the same
power source as the equipment that comes after it, an audio interface or small speaker for
example.

Otherwise it’s a very neat and cool project!


Thanks for spotting the error in the socket wiring! The resistor/capacitor network acts as an
integrator to smooth the rapid pulses from pin 9 into an analogue audio waveform. The values of
270 ohm and 100nF (0.1uF) are standard for this kind of application.
So should the capacitor NOT be connected to the black wire? i.e. just put it on the same line as the
resistor.
Hi, the diagram is correct and the capacitor is connected between the PWM output and GND. The
PWM output is a string of digital pulses. If the pulses are high enough frequency they will charge

MiniMin - a Theremin Style Instrument From 6 Components: Page 4


the capacitor and give a rising voltage on the output. If the pulses are of low frequency the
capacitor will discharge and the output voltage falls. By varying the pulse frequency (or pulsewidth)
a waveform can be generated.

This Instructable goes into much more details https://www.instructables.com/id/Arduino-RC-


Circui...
Hello!
Thanks for the beautiful project, I would like to try to do it!
looking for the necessary things, I found 100 microF capacitors that look like the one you used.
Can you confirm if it is nanoF or microF?
Thank you!

MiniMin - a Theremin Style Instrument From 6 Components: Page 5

You might also like