A one chip theremin

Posted: 6/18/2009 6:54:17 PM
JimTurner

From: Monterey Bay

Joined: 6/18/2009

I'd been thinking about building an optical theremin for a few days. I'd looked for CDS photocells at my local Radio Shack, but they didn't have any in stock. I mentioned it to my boss, and he said he'd check the Radio Shack near his home. Not only did he buy me two packs of 5 assorted CDS photocells yesterday, but he also bought me a TSL230R Light-to-Frequency converter chip. I had never heard of this chip before. It generates a square wave whose frequency depends on the intensity of the light that strikes it. It can produce an exceptionally wide range of frequencies, and both its frequency range and its sensitivity to light are adjustable. There is more info here: TSL230R (http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/27924/List/0/SortField/4/ProductID/88/Default.aspx)

It only took a few minutes to breadboard a working theremin with this chip. I connected pin 4 to ground, pins 5, 7, and 8 to +5 VDC, and pin 6 to one terminal of a small full range speaker. I connected the other speaker terminal to ground. That's all it took to make a working pitch-only theremin.

Pins 5 and 7 are the frequency range control. Connecting both gives this theremin a range of 1 Hz to 14,000 Hz. (Pianos have a range of 27.5 Hz to 4,186 Hz.) Of course, frequencies below about 20 Hz are too low for humans to hear.

Since I had the CDS photocells that my boss bought, I decided to add an optical volume control. I tried each of photocells in series between pin 6 and the speaker, but they all lowered the volume too much even when fully illuminated. I then tried using the photocells in parallel with each other, and in series with the speaker. Using the 4 photocells with the lowest resistance in parallel worked well. There is a photo of the breadboard here: TSL230R-based theremin (http://picasaweb.google.com/nyponen/Theremins#5348796081781892962)

As is, the TSL230R chip is too sensitive for a sunny room. I put a cardboard tube about 1.25" long and .75" wide over it, and that helped a lot. I'm also going to try putting different films on it to block some of the light.

The pitch control and volume control are too close on this small breadboard. Moving a hand over one can affect the other. I'm going to try putting a vertical barrier between them. If I decide to make this circuit permanent, I'll place the pitch and volume controls further apart.

One thing that bothers me about this circuit is that the output to the speakers goes from 0 VDC to about +5 VDC. It would be better if went from, for example, +2.5 to -2.5. Does anyone have a simple easy way to change the voltage range?
Posted: 6/19/2009 12:30:15 AM
RS Theremin

From: 60 mi. N of San Diego CA

Joined: 2/15/2005

Jim - I think you’re on the road to many discoveries. All of us technical types begin our projects on those white proto experimenter boards. What you have accomplished so far works so it must be a reasonable design. I found your photo diode array chip interesting.

Two things to mention are that you should have a 100 uf capacitor on the output to the speaker. This will improve your battery life and you won’t need to worry about a split supply voltage. Also, I use single CdS light dependent resistors for volume control and they work best when used with an amplifier that has a line level input like a keyboard amp. A raw square wave does not generate a pleasing musical sound but will be fun to explore.

Christopher
.
Posted: 6/19/2009 4:09:10 PM
JimTurner

From: Monterey Bay

Joined: 6/18/2009

Thank you for your response, Christopher. Where should the 100 uf capacitor go in the circuit? Between the photocell and the speaker? Does it matter what type (electrolytic, polypropylene, ceramic, ...)? Would the capacitor be the same regardless of whether the output is to a speaker or an amp? Thank you for your help!

This wasn't the kind of circuit that I had intended to build. When my boss gave me the TSL230R chip, and I saw its specs, it seemed to me that it was pretty close to being a theremin on a chip. I built this prototype to test that idea. I connected the speaker directly to the circuit because that was the easiest way to test it. It worked surprisingly well. I agree that a single CDS photocell connected to an amp would be the best approach for a permanent circuit. I want to experiment more with the TSL230R before I decide whether to make a permanent circuit using it. The TSL230R is good for making an ultra-simple theremin for fun or to demonstrate the principles. I'm not sure yet whether it is good enough for a serious musical instrument.

I agree that a square wave isn't the most pleasant sound. If someone wants to make a theremin using the TSL230R, they can make the sound somewhat less harsh by reducing the high-order harmonics. For example, if you want to connect it directly to a speaker, use a single large speaker (no tweeter). The larger the speaker, the less the high-frequency harmonics. Come to think of it, didn't the early theremins use single large speakers without tweeters? That would restrict their high frequency range.
Posted: 6/19/2009 5:15:16 PM
GordonC

From: Croxley Green, Hertfordshire, UK

Joined: 10/5/2005

Hi Jim,

I think you're right in your comment on the Roll Call thread that this could be a distraction in your aim to build the theremin you really want.

Still, let's run with the optical theremin on a chip - that is pretty neat. Hmm. 0V to 5V - aren't those logic states? Perhaps it would be an interesting experiment to set up an array of these chips and stream the outputs through an arbitrary arrangement of logic gates (*) before reaching the speaker(s). It seems to me it's the sort of thing that could appeal to makers of Noise.

With regard to the timbre, I understand that a basic low pass filter is not a complicated thing.


(*) I imagine a "[i]meaningful[/i] arrangement of logic gates" in these conditions would require a lot of head-scratching and experimentation. Perhaps jumper leads could permit it to be hard-programmable.
Posted: 6/19/2009 6:32:42 PM
RS Theremin

From: 60 mi. N of San Diego CA

Joined: 2/15/2005

Jim said:

[i]Where should the 100 uf capacitor go in the circuit? Between the photocell and the speaker? Does it matter what type (electrolytic, polypropylene, ceramic, ...)? Would the capacitor be the same regardless of whether the output is to a speaker or an amp?[/i]

The 100 uf capacitor would go at the chip output, first the capacitor, then the CdS cell and then the speaker, then to ground. “The cap positive side should be towards the chip”. The negative side goes towards the CdS cell. Any type of electrolytic capacitor will work fine. The RS in my login name actually means Radio Shack which is the only source of electronic components I use to limit my constructions and to keep them simple while challenging. If you were to go to an amplifier input instead of a speaker the 100 uf would be reduced to about .22 uf which could be polypropylene or some other film type cap.

The three main aspects of a theremin that I think you will eventually find important are: the sound of the voice, the response to aerial fingering and a touch-less volume control.

It’s all about experimenting so enjoy!

Christopher
.
Posted: 6/19/2009 7:27:02 PM
teslatheremin

From: Toledo, Ohio United States of America

Joined: 2/22/2006

I am really disappointed with the electronic component selection at RS, lately. They are not the valuable electronics parts resource they once were.
Sad!

Good Luck!
teslatheremin
Posted: 6/20/2009 9:18:40 AM
JimTurner

From: Monterey Bay

Joined: 6/18/2009

Thanks, Christopher. I'll go look for both 100 uf and .22 uf caps at my local Radio Shack today. They sometimes don't have what I want in stock, but they can always get it within a day or two.

Gordon, a low pass filter would certainly work, and you could tweak it to get exactly the response you want. It's probably easier to use a large speaker, whether you connect it directly or through an amp, but it's harder to tweak a speaker. Some preamps and amps have audio equalizers. Another approach would be to limit high frequencies with an equalizer.

I've spent a little time playing my circuit. Its response is very dependent on the ambient light. I've made several cardboard tubes of different lengths to put over the chip. I use the longest one in the brightest conditions, and the shortest in the darkest conditions. That allows me to have approximately the same range of notes over the same distance in different lighting conditions.

It would help to build some sort of hood over the circuit to block the ambient light. The hood would have a steady light source, like LEDs, inside it. It should be possible to space the LEDs inside the hood to give a linear frequency response, i.e., more LEDs near the top of the hood and fewer LEDs near the bottom of the hood. The disadvantage of a hood is that it would block the audience's view of the performer's hands, which is one of the fun things about the theremin.
Posted: 6/20/2009 8:30:23 PM
teslatheremin

From: Toledo, Ohio United States of America

Joined: 2/22/2006

What about placing the LEDs in the tube with a resistor control for brightness and a multiple position switch to turn specific LEDs off and on according to the ambient lighting to achieve a close approximation to linearity in many ambient light venues. Wow, what a run-on sentence!
Good Luck!
teslatheremin
Posted: 6/21/2009 6:21:49 PM
JimTurner

From: Monterey Bay

Joined: 6/18/2009

I've added the electrolytic capacitor and removed the CDS photocells. They were so close to the TSL230R chip that it was hard to control the volume without affecting the pitch. If I make a permanent circuit with the TSL230R, I'll include a CDS photocell. Here is a photo of the current circuit (http://picasaweb.google.com/nyponen/Theremins#5349883638455343298). It's hard to imagine a simpler theremin circuit.

The cardboard tubes that I mentioned previously had some light leakage at the bottom. I cut the black foam that the TLS230R chip came on to block the light at the bottom of the tube. Here is a closeup of the black foam surround (http://picasaweb.google.com/nyponen/Theremins#5349901620444687522).

Here is a photo of the theremin with one of the cardboard tubes (http://picasaweb.google.com/nyponen/Theremins#5349901620842849906) in place.

I've been using this circuit with an old two way speaker with a 5 inch woofer and a small tweeter. I disconnected the tweeter, leaving the low pass filter on the woofer intact. The improvement in sound quality was amazing. Most of the square wave harshness was gone. It didn't adversely affect the frequency range. It can still produce pitches higher than you would normally use in music.

teslatheremin, I think that some form of intelligent control of the light source could greatly improve optical theremins.
Posted: 6/21/2009 7:34:21 PM
Thierry

From: Colmar, France

Joined: 12/31/2007

Saw the last pic and found a name: "BRT - the bumf roll theremin"

:-)))

Just wait a few days, I'm almost sure that there will be a "scientific" if not religious discussion here: "Does the color of the bumf have an impact on pitch linearity?"

*ROFL*

Sorry for being off topic, but I'm actually in an exceptionally good mood...

Now, to be serious:
a) You risk to kill this IC at long term when connecting directly a low impedance speaker to its output since it will draw too much current. It would be a better idea to connect a 1:50 voltage divider, eventually in combination with a low pass filter (can be realized with 2 resistors and 1 capacitor) and then an external amplifier.
b) you may surround the IC not with black foam but with a green color filter in order to reduce its dependency from ambient light and then use a well positioned green LED.

You must be logged in to post a reply. Please log in or register for a new account.