Stm32 Auto Tune Board

Same problem than John here: trying to use the library without much idea about these aValues. In my case it is a position control of DC motor and encoder.

A very cheap and easy to build Theremin for only 50$

  • Only an STM32 evaluation board, 2 oscillators and some knobs and switches needed.
  • Excellent audio quality: 16/24bit audio DAC with headphone amplifier
  • Can load waveforms with Theremin sound directly from an USB stick
  • Very fast autotune: 1sec

The STM32F407G-DISC1 evaluation board can be used.So you need only 2 additional oscillators and some potentiometers and switches.

Schematic

(Values of pitch oscillator)

Layout

The oscillators can be built up on a breadboard:

Bill of material

ComponentPitchVolumePrice
C1150pF180pF0.05$
C2150pF180pF0.05$
C3330pF390pF0.05$
C41µF1µF0.05$
R12M22M20.05$
R21k1k0.05$
R310R10R0.05$
IC1CD4069UBECD4069UBE0.48$

Suppliers:m: www.mouser.comf: www.farnell.com / www.newark.comd: www.digikey.com

L1 should be an air-coil with 1mH. Eg. 200 windings of 0.15mm wire on a core with 40mm diameter.

Use http://hamwaves.com/antennas/inductance.html for other diameters.

Pin maps

NamePIN NameConnectorDescription
GNDGNDP1Ground for oscillators and potentiometers
VDDVDDP13V supply for oscillators and potentiometers
PITCH_OSCPE9P1Signal from pitch oscillator
VOLUME_OSCPE11P1Signal from volume oscillator
ANALOG_1PA1P1Analog input from volume potentiometer
ANALOG_2PA2P1Analog input from zoom volume potentiometer
ANALOG_3PA3P1Analog input from shift pitch potentiometer
ANALOG_4PC4P1Analog input from zoom pitch potentiometer
ANALOG_5PC5P1Analog input from waveform potentiometer

Connect an extra 100nF capacitor under each potentiometer from the potentiometer output to GND.

Auto-tune

The blue button on the STM32 discovery board starts the Auto-Tune procedure.

You can also use an additional button and connect it to:

NamePIN NameConnectorDescription
VDDVDDP13V supply auto-tune button
Auto-tunePA0P1Signal from auto-tune button

Pitch LED display

Stm32 Auto Tune Board

Optional display to show the current played note one a piano like display.

Connect 3mm LEDs with a series resistor of 100R to these PINs and connect allcathodes of to GND:

Stm32 Dev Board

NamePIN NameConnectorDescription
PITCH LED 0PE12P1Note c
PITCH LED 1PE14P1Note cis
PITCH LED 2PE15P1Note d
PITCH LED 3PB11P1Note dis
PITCH LED 4PB12P1Note e
PITCH LED 5PB13P1Note f
PITCH LED 6PB14P1Note fis
PITCH LED 7PB15P1Note g
PITCH LED 8PD8P1Note gis
PITCH LED 9PD9P1Note a
PITCH LED 10PD10P1Note b
PITCH LED 11PD11P1Note h

Power supply

The STM32 discovery board must be supplied by 5V (100mA). It is importand that the GND is connected to earth (PE). If a normal wall adapter is used, there must be an extra connection to earth (PE).

The best power supply would be a linear one like this: https://github.com/gerdb/tinnitus32/wiki/Power-supply

USB-stick with sound file

It's possible to store a *.WAV or a *.C file on an USB-stick and use it as sound source for the theremin.

WAV file

The file name must be WAV1.WAV and it must contain 1 periode of a sound sample. File format must be WAV (Microsoft) and the data format signed 16 bit PCM with only one mono track. Use Audacity to export it. https://www.audacityteam.org/

C file

The file name must be WAV1.C and it must contain 1 periode of a sound sample. File format must be the same as the Audio Wavetables from the Open.Theremin V3 project. http://www.gaudi.ch/OpenTheremin/index.php/download/audio-wavetables

Programming software for STM32

You find the binary file in the 'Binary' folder. Download the tinnitus project as ZIP

Program the STM32 board with the STM32CUBEPROG tool.

Case and front panel

As case a wooden wine box could be used.

The cheapest way for a professional looking front panel would be to use the service of a sign manufacturer. For example:https://www.digitaldruck-fabrik.de/werbeschilder/hart-pvc-polystyrolplatte.aspx

Price of a 380x110mm front panel is about 4€ or 5$

You can use the template under hardware/Frontpanel, but you have to adapt the size of the front panel file to your wine box. Use eg. https://inkscape.org



An easy to build Theremin for only 50$

  • Only an STM32 evaluation board, 3 oscillators and some knobs and switches needed.
  • Excellent audio quality: 16/24bit audio DAC with headphone amplifier
  • Can load waveforms with Theremin sound directly from an USB stick
  • Very fast autotune: 1sec

The STM32F407G-DISC1 evaluation board can be used.So you need only 3 additional oscillators and some potentiometers and switches.

Schematic

Layout

Stm32 Eval

The oscillators can be built up on a breadboard.With THD components:

Or with SMD components:

Bill of material

Stm32
ComponentVolume 1Volume 2Pitch
C11µF1µF1µFceramic capacitor
C2470pF470pF470pFceramic capacitor
C333pF68pF33pFceramic capacitor
C42.2nF2.2nF2.2nFceramic capacitor
R110R10R10Rresistor 1%
R222k22k1Megresistor 1%
R3100R100R100Rresistor 1%
IC1CD4011UBECD4011UBECD4011UBEQuad NAND

L1 should be an air-coil with 2.5mH, 3mH and 4mH.Eg. x windings of 0.15mm wire on a core with 50mm diameter.Picture below shows all 3 coils with different number of windings.

Use http://hamwaves.com/antennas/inductance.html for other diameters.

Pin maps

NamePIN NameConnectorDescription
GNDGNDP1Ground for oscillators and potentiometers
VDDVDDP13V supply for oscillators and potentiometers
PITCH_OSCPE9P1Signal from pitch oscillator
VOLUME_OSCPE11P1Signal from volume oscillator
ANALOG_1PA1P1Analog input from volume potentiometer
ANALOG_2PA2P1Analog input from zoom volume potentiometer
ANALOG_3PA3P1Analog input from shift pitch potentiometer
ANALOG_4PC4P1Analog input from zoom pitch potentiometer
ANALOG_5PC5P1Analog input from waveform potentiometer

Connect an extra 100nF capacitor under each potentiometer from the potentiometer output to GND.

Auto-tune

The blue button on the STM32 discovery board starts the Auto-Tune procedure.Connect an external button to:

Autotune
NamePIN NameConnectorDescription
VDDVDDP13V supply auto-tune button
Auto-tunePA0P1Signal from auto-tune button

Pitch LED display

Optional display to show the current played note one a piano like display.

Connect 3mm LEDs with a series resistor of 100R to these PINs and connect allcathodes of to GND:

NamePIN NameConnectorDescription
PITCH LED 0PE12P1Note c
PITCH LED 1PE14P1Note cis
PITCH LED 2PE15P1Note d
PITCH LED 3PB11P1Note dis
PITCH LED 4PB12P1Note e
PITCH LED 5PB13P1Note f
PITCH LED 6PB14P1Note fis
PITCH LED 7PB15P1Note g
PITCH LED 8PD8P1Note gis
PITCH LED 9PD9P1Note a
PITCH LED 10PD10P1Note b
PITCH LED 11PD11P1Note h

Power supply

The STM32 discovery board must be supplied by 5V (100mA). It is importand that the GND is connected to earth (PE). If a normal wall adapter is used, there must be an extra connection to earth (PE).

The best power supply would be a linear one like this: https://github.com/gerdb/tinnitus32/wiki/Power-supply

Programming software for STM32

You find the binary file in the 'Binary' folder. Download the tinnitus project as ZIP

Program the STM32 board with the STM32CUBEPROG tool.

Case and front panel

A wooden wine box or a bamboo box for the kitchen (both about 10$) can be used as a case for the timbremin.

The cheapest way for a professional looking front panel is to use the service of a sign manufacturer. For example:https://www.digitaldruck-fabrik.de/werbeschilder/hart-pvc-polystyrolplatte.aspx

Price of a 380x110mm front panel: 5$

You can use the template under hardware/Frontpanel, but you have to adapt the size of the front panel file to your case. Use eg. https://inkscape.org