Skip to main content
Version: FILS English

Theremin

An instrument that plays without you ever touching it.

info

Description

A theremin is an instrument that uses your hands as a capacitor between two metal rods. This project aims to recreate that using two ultrasonic sensors. It also has a few effects that can be applied to the sound so it can be your own.

Motivation

My hobby is music production. I have been doing ambiental, metal and digicore or adjacent genres. Especially digicore plays with the form of the wave to make unique melodies. I got the idea for this project when I was making a song - and I thought a theremin would be an interesting concept to explore.

Architecture

Arhitecture

Log

Week 13 - 19 April

The STM32 arrived. Played with it and everything worked fine. I also messed around with an HC-SR04 from a friend to see how it works before mine arrives.

Week 20 - 26 April

I ordered my own sensors and an LED display. Plan to make a working skeleton.

Week 27 April - 3 May

Spent my weekend celebrating May Day. Glory to all workers whose blood was shed fighting for our rights.

Week 4 - 10 May

It seems one of the HC-SR04+ sensors I have ordered is faulty (plan to check in with my colleagues, see if a replacement helps). Glad I spent an entire weekend evening not knowing what part of my code doesn't work. Did the KiCad schematic and got a WCMCU-1334 DAC from one of my colleagues.

Early Hardware

Barely made the sensors work thus far, but I did figure out all the connections I need by KiCad and reading the documentation.

Week 11 - 17 May

It seemed that the sensors were not faulty. The DAC is though. A noisy output is better than nothing, at least.

Week 18 - 24 May

Programmed the majority of software. Getting out 2 waveforms and 2 effects is nice. It wasn't a pleasure, but it feels good to hit some of your goals.

Week 25 - 28 May

Here comes the deadline. Crunch time to make the noise as low as possible. Even the professor said embassy isn't exactly good for low-latency stuff, but I tried my best. Making the last software and hardware adjustments to limit cable interference, frequency usage and buffer starvations that sometimes happen.

Hardware

  • STM32U545 - the MCU
  • 2 x HC-SR04+ - sensors to detect distance to hands
  • "ST7735" LCD Display - used to show current effect. Also mine is most likely a knockoff.
  • WCMCU-1334 - DAC to convert the read data into an interpretation of a signal.

Schematics

KiCad Schematic

Bill of Materials

DeviceUsagePrice
STM32U545Microcontroller106 RON
2 x HC-SR04+Ultrasonic Sensors2 x 15 RON
"ST7735 LCD"Displaying effect information35 RON
WCMCU-1334 DACConverting data to audio23 RON

Software

LibraryDescriptionUsage
embassy-stm32Embassy for STM32Used for async stm32 tasks
ST7735Display driver for ST7735SUsed for the display
embedded-graphics2D graphics libraryUsed for drawing to the display
SAISerial Audio InterfaceProtocol used for writing to the DAC
SPISerial Peripheral InterfaceProtocol for Display communication
mipidsiGeneric Display DriverUsed for my ease of use for the display

...