Theremin as hand detector

Hi all!

For an arts project I've been asked to come up with a sensor that detects a hand being held above a column. The installation should then react to the presence of this hand by playing music or changing colour. That's the easy part - the hand detection of course is not.

Range: up to 30-50 cm would be great.

Directional sensitivity is important: it should react ideally only to the hand above the installation, not the person walking by.

Finally: it has to look good, i.e. be pretty much invisible, inside a translucent (milky white) acrylic tube of some 10-20 cm diameter. The tube will be lit from the inside using an LED strip. The antenna may be mounted at the top (it's a bit slanted; it will be capped with another piece of the same acrylic, a 1 mm wire around the inside edge should work.

So ultrasound sensors are out. Traditional capacitive as well - not enough range, just a few cm normally and that by using a complete surface.

Based on that, I'm first of all thinking capacitive sensing - and probably the theremin principle. I've done some reading on the theremin and it seems to tick all the boxes. Those antennas are very sensitive, reportedly up to 80 cm or even a bit more. Basically this makes use of an oscillator, a hand in the magnetic field of the antenna changes the capacitance of it, and that causes a shift in frequency. That shift is small: can be as little as 100 ppm in the far reaches, so needs stable oscillators.

The obvious oscillator, the 555, is no good for this. Definitely not stable enough - 1% according to the data sheet.

A 74HC00 based RC oscillator as suggested here should be an improvement when it comes to stability. Not sure what stability it gets, I haven't found any numbers. I built this oscillator on a breadboard and it oscillates just fine, a nice square wave shows up on the scope. Some tuning of the RC values will easily get the correct frequency.

Then I found another one: an LC based 74HC00 oscillator. Based on what I read elsewhere this should be giving even better stability - but I can't get this to oscillate. I built it on a breadboard; ceramic caps; ferrite core choke; metal film resistors. No luck, just when I touch the resistors I get to see a lot of noise. There's a dedicated thread about that project but it appears to be pretty dead with the OP not a member of this forum any more.

So... what to do? I may assume the circuit of the latter is correct, so it's probably either the breadboard with all its parasitics or the wrong kind of inductor that is stopping it from oscillating. I suppose it's C1 and L1 that are responsible for the frequency, not too sure of the function of C3 and C4. I'd like to have it working on breadboard before soldering it to perfboard in order to get to the correct frequency - the given values should produce about 4.1 MHz...

All suggestions are welcome, thanks in advance!

Google Arduino Theremin
There are a few hits and a shield.

Also, post your schematic

Well, of course I started there. That's where I got all the information from.

The shield is not of use to me. Not going to build a compete theremin, and no way I can fit that much bulk where the antenna is going to be. 74 Euro for one, times the 12 needed... no chance. I'm just trying to use the principle for hand detector.

For circuit,


this is what I'm trying to build, and as said don't get it to oscillate. Full explanation of this circuit (and of course the circuit itself) in the link above.

The theremin shield uses a resonator that's very similar to the one above; using NOT gates rather than NAND which shouldn't make a difference; also using a much larger inductor, 1 mH vs 10 µH so will get lower frequency, supporting my approach.

I just don't get the thing to oscillate.

You have to detect a hand being held above a column, that does not mean that the sensor has to be in the column. You could use an ultrasonic detector in the ceiling. Another solution would be to have a light sensor inside the column detecting either a fall in ambient light within the column or loss of contact with an IR light source above the column.

Consider a time of flight ranging module. This one has 1 m range.

I don't think that a circuit including essential 10pF caps (C3, C4) can be built on a breadboard. It also doesn't help to exchange the inductor only, the caps must be adjusted as well.

In general R1/R2 destabilize the logic gates, turning them into kind of high gain inverting analog amplifiers. Two in sequence form a non-inverting amplifier, with feedback by C3/C4 that should make it oscillate. Much larger caps should produce audible sound. The LC filter determines the oscillator frequency.

And if you get it to work, how do you intend to process the variable frequency further?

A directed PIR sensor may be easier to use.

ardly:
You have to detect a hand being held above a column, that does not mean that the sensor has to be in the column.

Seems I forgot to add this: it's going to be mobile, and most of the time there won't be a ceiling (it may be used outdoors). That's why it has to be inside the column.

Ambient light doesn't go well with internal lighting... so that's not useful. Daytime vs. nighttime is another deal breaker there.

IR time of flight can be a good backup plan. At least those sensors are pretty small.

DrDiettrich:
I don't think that a circuit including essential 10pF caps (C3, C4) can be built on a breadboard. It also doesn't help to exchange the inductor only, the caps must be adjusted as well.

I was afraid of that. Maybe I should just go ahead and build it on a piece of perfboard, everything as tight together as possible. Much less issues with parasitics. I think we'll be using a proper PCB for the final installation with SMD components for better stability and minimal parasitic capacitance.

Also worried about the inductor that I'm using. I don't have a data sheet but quite sure it's not designed for high frequency or anything special. It's from a cheap inductor kit, of the 5 pc x 15 values kind...

And if you get it to work, how do you intend to process the variable frequency further?

Using the timers of the Arduino and the T1 counter input. Start with the approach as described in the second link. I was thinking myself in similar lines already. A 10 Hz resolution on 4 MHz is 2.5 ppm, so that's good enough for this. I haven't studied the code yet.

It'd need some form of "autotune" as the frequency will vary with factors such as the air humidity level, and probably temperature. But that's a change in frequency that should be much slower than a hand waving above the sensor - provided the oscillator circuit itself is pretty much rock solid of course - so something like rate of change, or change from 10 measurements ago, or change from the last 10 seconds average.

Another issue that I don't know how to handle best is getting the signal to the Arduino that controls the lights and so. A 4 MHz signal over a 1-2m long wire in between flashing LEDs may not be a challenge. Though reading the signal should have very little actual processor overhead; just some timer interrupts as the timer overflows.

A directed PIR sensor may be easier to use.

No distance info... and probably won't be able to read through the acrylic due to the frosting (but it'd be worth a try if nothing else works).

Directional sensitivity is important: it should react ideally only to the hand above the installation, not the person walking by.

Have you ever played with a Theremin? You say you want it to only detect directly above the column, but the antenna on a theremin will pick up in any direction. Anyone walks by the column and it will affect that resonant frequency. If you ever watch someone play one on stage they are always standing perfectly still like a statue except for the one hand they're controlling with and they are always very careful that nobody else on stage moves very much. I would think that if you have very many people moving around then this idea is going to fall flat.

this idea is going to fall flat.

Yep, but the OP is stuck on the idea for the moment.

Never had the chance to play with one :slight_smile: Going to be interesting to see how the column is going to interact. Very interesting. Maybe it works even better than intended, maybe indeed it's going to fall flat. Maybe I have to tune down the sensitivity, to make it react only if you're pretty close.

I'm hoping that a horizontal circular antenna is at least somewhat directional: it should have more field above and below than to the sides. Maybe not as of course "antenna" is not the best word for it. Everything else failing it for sure is going to be an interesting kind of proximity sensor, which can have other fun uses. Even without antenna I see an effect of moving my hand close to the board on the scope signal.

DrDiettrich:
I don't think that a circuit including essential 10pF caps (C3, C4) can be built on a breadboard.

Indeed soldering on perfboard did the trick. It's oscillating. Just over 5 MHz without antenna attached (10 µH inductor + 100 pF + 47 pF capacitor)

jremington:
Yep, but the OP is stuck on the idea for the moment.

It's just a very interesting idea to explore, regardless of whether it'll be useful in the intended application.

By all means, enjoy building and playing with a Theremin!

But it will not be a solution to the detection problem that you posted.

wvmarle:
. . .I'm hoping that a horizontal circular antenna is at least somewhat directional: it should have more field above and below than to the sides. Maybe not as of course "antenna" is not the best word for it. . . .

A loop antenna nominally has it's strongest radiation in the plane of the antenna and a null normal to the plane, my guess is the directionality, such as it is, will be the opposite of what you hope, but I'm interested to see how it works out in practice. I think it's more typical to build theremins with a vertical element, but that too should have a horizontal radiation pattern.

Leon Theremin playing his own instrument (video).

Can you mount something on top, or have a small hole on top? Or if not, how about next to it, looking up. If so a time-of-flight sensor would be accurate, directional and small.

I have just seen a video two black men made of them trying to use an automated soap dispenser. One could get the soap out with no difficulty. The other, no matter how he placed his hands under the dispenser, could not get any soap because he was "too black". The only way he could get soap was to hold a white paper towel

I was shocked by this. I was aware of the "white geek bias" but I always thought of it as being a subtle problem not so in your face black and white.

Anyway, test your detector with hands; big, small, white, black, and very black.

Interesting! I never thought of that. May indeed be an issue for optical solutions. Not many black people here, though. Gonna be tough to find a test subject.

There seem to be a few of these videos around, this is not the one I saw previously;

You could just use some black card.

I knew some people had a problem with biometrics as some racial groups don't have very pronounced fingerprints, and others don't fair well with iris scanners. Something as simple as a hand detector was a surprise though.

Just done some experimenting with the NAND based oscillator. I'm getting a frequency of 5.78 MHz out of it (so significantly higher than the 4.3 MHz expected and quite close to the Arduino's 8 MHz limit), with a stability of about +/- 150 Hz. So that's just over 50 ppm variation. Not bad at all! Very likely a better quality inductor will improve this.

The thing is very sensitive indeed. I can see measurable effects 30-40 cm away (below that the effects drown in the oscillator noise - a more stable oscillator should solve this), and indeed from the sides of the ring the sensitivity is far higher than from above and below. It's very clearly directional. I see effects of up to about 10 kHz frequency change when moving my hand close.

Awesome results. I don't know if we're going to use it, it would definitely be able to detect a person getting close to one of the tubes. It can also definitely be used as general cheap proximity sensor.

For the hand detection, probably time of flight sensors are the best option. Really tiny and easy to read out (I2C interface).