Go Down

Topic: cool unkown (to me) electrical property? (Read 3186 times) previous topic - next topic

winner10920

Ok so I was playing around with a burnt board of mine where basically the only useful working parts are the pwm and analog readings, so. I made a program while I was testing the analog reading without printing them out,
right now the affect that I get it when I move my hand closer to a 3 inch wire sticking out of the A0 pin, led 13 lights up momentarily unti. I move it closer or pull away and put it back
the range seems quite large, almost 2 feet away it will work,  pulsing to my movement
however the affect is dimished and sometimes goes away if I read another pin or do a dummy read before averaging it, also the amount of times I average it changes the range
can someone else try this and tell me what they think is going on? I added a minimum value to turn the led on and to turn on almost full brightness, so if I move it slow it lights dim, faster its brighter
also I don't understand if my hand is close and it has already gone off, when I tap my foot it relights as if my hand moved
its a pretty noisy enviroment, the arduino itself being ontop a laptop keybard, which is on a box radio playing music, yet seems unaffected by them

Here's my code

Code: [Select]
int brightness ;
int reading;
int avgreading[200];
unsigned long avg;



void setup(){
  pinMode(13,1);
  pinMode(A0,0);
}
void loop(){
  analogWrite(13, brightness);
  for(int avgplace; avgplace < sizeof(avgreading); avgplace++){
  avgreading[avgplace] = analogRead(A0);
  }
  avg = 0;
  for(int i; i < sizeof(avgreading); i++){
    avg = avg + avgreading[i];
  }
  avg = avg / sizeof(avgreading);
  if(avg < 70) avg = 0;
  if(avg > 100) avg = 1020;

  brightness = map(avg, 0, 1023, 0,255);
}
 


nickgammon


also I don't understand if my hand is close and it has already gone off, when I tap my foot it relights as if my hand moved


And what happens if you bop yourself on the head?

This is pretty much expected behaviour ... the pin is reading electrical noise, and moving your hand close will influence it (sort of like an aerial). Tapping your foot might discharge some of the electrical energy in your body to ground.

If you tie the pin to ground with a resistor (eg. 10K) or to 5V with a similar resistor then the effect will go away.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

cmiyc

Yup, that's a property of floating pins.  Your body is coupling is a good antenna (for low frequency stuff.)

Here's a video I made of a floating pin attached to an oscilloscope.  You can see how the waveform goes nuts just by touching a wire connected to the pin.

http://www.youtube.com/watch?v=dBIBFLYCjMM
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

winner10920

I find it amazing how far it works, I think im gonna turn this affect into something maybe a set of air drums,  that's basically how it reacting now
im just wondering why would reading another analog pin or doing a dummy read dimish the affect? Usually the dummy read improves the accuracy but its seems the. Sensitivity to this small force goes away with it
I was gonna try and read another analog pin on the other end without a wire on it to set up a background noise level but then it does not act as expected

winner10920

Another strange this I found this morning , other than that there was some more noise causing it to flicker while I wasn't near, was that that random flicker would stop momentarily in an opposite affect while I was about 4 feet away, my hand movement caused the reading to temporarily lower while was farther, but when im 0-2 feet away it lights up from raised reading from my hand

cmiyc

You might be interested in learning about a Theremin.  You make music by manipulating an electromagnetic field.
http://en.wikipedia.org/wiki/Theremin


This is a cool demonstration (playing the Zelda theme on one):
http://www.youtube.com/watch?v=nJYho56INKU
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

winner10920

Wow thats pretty cool,
I just wonder why does the voltage raise when I get closer then drop as I hold it still? I guess its something to do with capacitance but how does that work?

retrolefty


Wow thats pretty cool,
I just wonder why does the voltage raise when I get closer then drop as I hold it still? I guess its something to do with capacitance but how does that work?


Yes the pickup sensors change capacitance as the users hand moves to and from them. The sensors are connected to variable audio oscillator and amplifier circuitry whos frequency and amplitude change with the changing input capacitance. Theremin have been around for many many decades even back to the vacuum tube days.

winner10920

So I the farther away there is less capacatance because its inverse porportinal to the distance apart, so what would cause the affect of the apparent drop in background noise as I move my hand around in the 2-4 feet range? At that amount of capacatance it is dropping the reading voltage instead of raising it?

winner10920

Also whiich I find weird is how a normal capacitance sensor uses a very high value resistor to pull up and down the input,  counting how long it takes to change,
since all I have is a 3 inch piece of wire sticking straight up, where is it detecting voltage from? The only pull up/down would be air so I don't understand how I can get a repeatable affect, as I imagine a metal wire would be more susceptible to being pulled up/down by stray fields rather than my hand which is receiving the same stray fields, which logic would say a capacitor wont work if both ends have the same voltage

cmiyc

The very high impedance (resistance) come from the input pin's logic. It is a large resistance. Your wire is acting as a conductor coupling in the electric field.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Grumpy_Mike

Quote
where is it detecting voltage from

From all the mains, radio signals and other crap that is in the modern world. You are acting as an antenna and re radiating the crap. If you were to do this in an electrically isolated chamber it would not happen. If you were to do it in an other environment it would not be the same. That is the problem, it is not a very repeatable phenomenon. That is why the theremin contains a radio transmitter to provide a field for you to interact with, rather than relying on any old field that is there.

winner10920

Would it be possible to map the reading im getting now to a tone, but without the tone function? Right now im just mapping the analog reading to 60000, 600 and using that as a delay to toggle a pin but im not getting much fluctuation in sound, but I haven't played around with it much yet
Im thinking perhaps as making it Into a theremin like device but without the radio frequency stuff, hopefully without any components if I can get away with it, just a 3 inch wire XD

ajofscott

In defense of your arduino, a series resistor of 1Meg at 1/2 watt in series with your antennas would be prudent just in case you scuffed your feet aon the way over. The half watt requirement is for breakover voltage end to end, not the actual power dissipation. You don't want the esd to jump over the limit resistor.

winner10920

Good idea, I just so happen to have one,
its kinda cool because It now makes a pretty unique static when nothing going on and makes some pretty cool tones when I touch it or wave my hand
what's also cool is I had set a pin low for ground input to my speaker system, and when I touch that wire it gets louder, so it makes for some cool affects but can that be damaging the pin sinking?

Go Up