A DIY musical instrument inspired by the theremin, an early analog electronic instrument controlled by proximity of the performer's hands.
This project was originally made as a secret santa gift, with a £10 budget and a 2-week timeframe. This was made possible by not incorporating a power supply or speaker, instead opting for a 'batteries-not-included' design where the user can plug in their own power supply and speaker/headphones.
- Independent volume and pitch control via 2 ultrasounic rangefinder (sonar) sensors
- Automatic quantisation to make playing songs
actually possibleeasier - Built-in analog low-pass filter with control knob to adjust brightness of output sound
- Transpose and portamento time functions
- Scale function that cycles through a range of scales including chromatic, major, minor, pentatonic and blues
- Raspberry Pi Pico Rev3 (£3.60), running MicroPython 1.18
- 2x HC-SR04 ultrasonic rangefinder modules (£2 each)
- 3.5mm TRS audio jack connector (£0.80)
- 2x 10k linear* potentiometers (£0.80 each), one for controlling amplification and the other controlling the low-pass filter.
... plus a few things I already had, or cost me next-to-nothing:
- 3D printed housing with laser-cut acrylic lid
- 3D printed potentiometer knobs and button covers
- IRLB8721PbF N-channel power MOSFET
- Veroboard, solder and a few passive components
* Volume is of course logarithmic, but it was easier to source a linear potentiometer and convert the output to log in software
Here's how to make one yourself:
- Solder up the circuit as shown in the schematic
- Plug the Pico into a PC. Download the official MicroPython image and copy it to the Pico to install.
pip install adafruit-ampy
(you've already got Python installed, right?)- Download/clone this repo
- Figure out what COM port your Pico has been assigned, then edit
.ampy
and change the COM_PORT option accordingly. - Run
flash_project.bat
- Unplug the Pico, plug in a USB power supply (any micro-USB should do just fine) and speakers/headphones (anything with a 3.5mm audio jack will work - turn the volume down the first time you plug it in, just in case), and start playing!