Propeller Chip and 555 timer make a Theremin
A few years ago I saw this PDF http://thereminvision.com/version-2/ThereminVision-II-manual.pdf which on page 20 contains a schematic for a 555 oscillator, a circuit to compare the oscillator output against a reference frequency, and a circuit to shift it into the audio range. It is supposed to be used as a proximity sensor for a BS2 robot. It occurred to me that a Propeller chip could do most of the signal measurement and audio output, so I would only need the 555 timer oscillator to do the same.
Well the 555 timer has been sitting in my parts box for the better part of a year, but tonight I finally built the oscillator, used a propeller chip to measure the reference frequency, and a piezo speaker to output the results. Here's a video of the result:
The piezo speaker is quiet, but you can hear the change in pitch as I move my hand. The propeller code to do it is easy using the BS2 functions.
Well the 555 timer has been sitting in my parts box for the better part of a year, but tonight I finally built the oscillator, used a propeller chip to measure the reference frequency, and a piezo speaker to output the results. Here's a video of the result:
The piezo speaker is quiet, but you can hear the change in pitch as I move my hand. The propeller code to do it is easy using the BS2 functions.
{{
File...... Theremin.spin
Purpose... Measures the output of an oscillator on pin 0
Author.... Martin Heermance
E-mail....
Started... 16 October 2012
This program uses a 555 oscilator to measure frequency against a reference
to measure changes in capacitance as audio output. IE it's a theremin!
}}
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
tIn = 0 ' 555 output connected here via level shifter
DAT
CLREOL byte "\033[K", 0 ' ASCII terminal control codes to match PBASIC commands.
CRSRXY byte "\033[%d;%dH", 0
HOME byte "\033[H", 0
OBJ
BS2 : "BS2_Functions" ' Create BS2 Object
VAR
long refFreq
long freq
Pub Main | i
BS2.start (31,30) ' Initialize BS2 Object timing, Rx and Tx pins for DEBUG
refFreq := BS2.FreqIn(0, 15) ' Sample the reference frequence.
repeat ' Begin the scan-and-process loop.
freq := BS2.FreqIn(0, 15) ' Sample current oscillator frequency
BS2.FREQOUT_Set(4, refFreq - freq)
BS2.DEBUG_STR(STRING("Freq="))
BS2.DEBUG_DEC(freq)
BS2.DEBUG_CR


Comments