Theremin as hand detector

ardly:
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.

Of course it's a conspiracy, not an oversight, the people involved should be rounded up and beat.

If you don't like my music then you don't have to use it.
But you could take a hint from me and get some plastic surgery.

wvmarle:
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.

How do you know who is what shade of brown however light or dark? Arduino is worldwide.

Why a white paper towel except too push "race"? Was his buddy paper white? No.

My guess is that the circuit could be made more sensitive though how it's aimed or optics may be needed to keep the sink bowl from tripping it.

Think of all the problems with trying to get the dispensers to work reliably at all for anyone. I will think of when we pushed up on a spout and the germs we could share.

Such a dispenser is not based on visible light, so the color of the surface is unimportant. Easy, isn't it? :-]

The thing requires a certain amount of reflected IR. That much has been demonstrated to not work for everyone.

It's IR so the colour is definitely important - it's just a colour that we can't see. Just like those invisible lines a UV based line follower can detect, same thing, just the other end of the spectrum.

I'm a Caucasian myself but all the time have problems getting those automatic taps to react to my hands... moving up and down often does the trick but not always.

Every live hand emits IR, sufficient to make a PIR sensor work.

Maybe it is a silly idea but what about using a crystal instead of the LC circuit? You may use the "variable" cap as a load capacitor for the crystal, changing the frequency slightly. You may also use another crystal of the same type with the same driving circuit but with fixed load caps as a reference.

I only have 8 MHz crystals and 32 kHz RTC crystals... So can't do a quick test.

I've never seen a theremin based on crystals. I think they're too insensitive to the change in load, which is in the order of 1-10 fF so <1% of the load. Probably less effect than the normal 20-50 ppm drift, which isn't that much better than the NAND oscillator.

Then how to count the frequency difference between the two? The atmega328 has only one 16-bit timer. I'd have to employ an attiny841 to have a second 16-bit timer and still it'd not be easy.

My LC oscillator reacts to presence of my hand or other conductive objects even without having an antenna attached.

It was just an idea. If the variable cap is in fF range the frequency drift will be too low to be detectable I am afraid.
But I think you can use an 8 bit timer to compare frequency difference. Also you could use a 32kHz crystal and compare phase of the crystals. Maybe ... I have never tried anything close to the above, just daydreaming - too little time.

No problem there, it's always interesting to explore other possibilities.

There are also 555 based theremin circuits, it seems they are less sensitive, and less stable. What I read is that LC oscillators are more stable than RC oscillators, I suppose that's why they're used in radio reception as well. Can't accept much if any drift there.

In former days it was near impossible to produce audible sound, much easier to produce variable RF. Then a mix (difference) of two frequencies (fix and variable) could be in the desired frequency range. The same principle can be used nowadays, with an analog mixer for the two frequencies, to obtain a low frequency difference signal whose frequency can be measured easily by an Arduino.

Coming out of the NAND gate should be a block wave (it looks like a sine on my scope, but that's probably due to it being too high frequency). Don't think you can simply mix block waves. Otherwise it'd be an interesting approach.

wvmarle:
Coming out of the NAND gate should be a block wave (it looks like a sine on my scope, but that's probably due to it being too high frequency). Don't think you can simply mix block waves. Otherwise it'd be an interesting approach.

Low Pass Filter((bit stream A) xor (bit stream B)) will give something approximating the difference frequency of two block waves.

This works best if the difference frequency is small relative to the bit stream frequency otherwise the filter needs a sharp cutoff. This is effectively a PWM mixer.

If the bit stream frequency is higher than the upper frequency response of the speaker you might not need the low pass filter.

Another untested idea: a latch that latches B at rising edge of A should work as square wave mixer. In theory. Hard to say what will happen when B has an edge close to A's edge.

The first stages of the RF generator produce kind of sine waves, which can be mixed up. For rectangular signals a digital PLL looks more promising.